Automap (client) [VS plugin mod]
Revision | f5ba0cca3cc3904cc386bcbd37c3a2b1f8211e64 (tree) |
---|---|
Time | 2020-02-20 09:59:46 |
Author | melchior <melchior@user...> |
Commiter | melchior |
Adjusted notes GUI, POI/EOI JSON metadata added
@@ -57,14 +57,14 @@ namespace Automap | ||
57 | 57 | txtStatusBounds.fixedHeight = 16; |
58 | 58 | txtStatusBounds.percentWidth = 1; |
59 | 59 | |
60 | - ElementBounds txtNoteArea = textBounds.CopyOffsetedSibling(20, 42, 1, 6); | |
61 | - txtNoteArea.fixedHeight = 24; | |
62 | - txtNoteArea.percentWidth = 25; | |
63 | - | |
64 | 60 | ElementBounds btnNoteArea = textBounds.CopyOffsetedSibling(0, 42, 2, 5); |
65 | 61 | btnNoteArea.fixedHeight = 24; |
66 | 62 | btnNoteArea.fixedWidth = 20; |
67 | 63 | |
64 | + ElementBounds txtNoteArea = btnNoteArea.CopyOffsetedSibling(64, 0, 1, 6); | |
65 | + txtNoteArea.fixedHeight = 24; | |
66 | + txtNoteArea.fixedWidth = 256; | |
67 | + | |
68 | 68 | |
69 | 69 | this.SingleComposer = capi.Gui.CreateCompo("automapControlPanel", dialogBounds) |
70 | 70 | .AddShadedDialogBG(bgBounds) |
@@ -126,7 +126,7 @@ namespace Automap | ||
126 | 126 | |
127 | 127 | capi.Event.PushEvent(AutomapSystem.AutomapCommandEventKey, noteCmd); |
128 | 128 | } |
129 | - return true;//??? | |
129 | + return false;//??? | |
130 | 130 | } |
131 | 131 | |
132 | 132 | private void AutomapStatusMsg(string eventName, ref EnumHandling handling, IAttribute data) |
@@ -38,8 +38,8 @@ namespace Automap | ||
38 | 38 | |
39 | 39 | private ConcurrentDictionary<Vec2i, uint> columnCounter = new ConcurrentDictionary<Vec2i, uint>(3, 150 ); |
40 | 40 | private ColumnsMetadata chunkTopMetadata; |
41 | - private PointsOfInterest POIs; | |
42 | - private EntitiesOfInterest EOIs; | |
41 | + private PointsOfInterest POIs = new PointsOfInterest(); | |
42 | + private EntitiesOfInterest EOIs = new EntitiesOfInterest(); | |
43 | 43 | |
44 | 44 | internal Dictionary<int, BlockDesignator> BlockID_Designators { get; private set;} |
45 | 45 | internal Dictionary<AssetLocation, EntityDesignator> Entity_Designators { get; private set; } |
@@ -126,6 +126,9 @@ namespace Automap | ||
126 | 126 | //ClientAPI.TriggerChatMessage($"Automap {updatedChunksTotal} Updates - MAX (N:{chunkTopMetadata.North_mostChunk},S:{chunkTopMetadata.South_mostChunk},E:{chunkTopMetadata.East_mostChunk}, W:{chunkTopMetadata.West_mostChunk} - TOTAL: {chunkTopMetadata.Count})"); |
127 | 127 | //#endif |
128 | 128 | } |
129 | + else if (CurrentState == RunState.Snapshot) { | |
130 | + //TODO: Snapshot generator second thread... | |
131 | + } | |
129 | 132 | |
130 | 133 | } |
131 | 134 |
@@ -217,8 +220,7 @@ namespace Automap | ||
217 | 220 | |
218 | 221 | private void Prefill_POI_Designators( ) |
219 | 222 | { |
220 | - this.POIs = new PointsOfInterest( ); | |
221 | - this.EOIs = new EntitiesOfInterest( ); | |
223 | + | |
222 | 224 | this.BlockID_Designators = new Dictionary<int, BlockDesignator>( ); |
223 | 225 | this.Entity_Designators = new Dictionary<AssetLocation, EntityDesignator>( ); |
224 | 226 | this.RockIdCodes = Helpers.ArbitrarytBlockIdHunter(ClientAPI, new AssetLocation(GlobalConstants.DefaultDomain, "rock"), EnumBlockMaterial.Stone); |
@@ -473,6 +475,7 @@ namespace Automap | ||
473 | 475 | { |
474 | 476 | jsonWriter.WriteLine("var worldSeedNum = {0};", ClientAPI.World.Seed); |
475 | 477 | jsonWriter.WriteLine("var genTime = new Date('{0}');", DateTimeOffset.UtcNow.ToString("O")); |
478 | + jsonWriter.WriteLine("var startCoords = {{X:{0},Y:{1}}};", startChunkColumn.X, startChunkColumn.Y); | |
476 | 479 | jsonWriter.WriteLine("var chunkSize = {0};", chunkSize); |
477 | 480 | jsonWriter.WriteLine("var northMostChunk ={0};", chunkTopMetadata.North_mostChunk); |
478 | 481 | jsonWriter.WriteLine("var southMostChunk ={0};", chunkTopMetadata.South_mostChunk); |
@@ -484,23 +487,43 @@ namespace Automap | ||
484 | 487 | { |
485 | 488 | jsonWriter.Write("['{0}_{1}',", shard.Location.X, shard.Location.Y); |
486 | 489 | jsonWriter.Write("{"); |
487 | - jsonWriter.Write("ChunkAge : '{0}',", shard.ChunkAge);//World age - relative? or last edit ?? | |
488 | - jsonWriter.Write("Temperature : {0},", shard.Temperature.ToString("F1")); | |
489 | - jsonWriter.Write("YMax : {0},", shard.YMax); | |
490 | - jsonWriter.Write("Fertility : {0},", shard.Fertility.ToString("F1")); | |
491 | - jsonWriter.Write("ForestDensity : {0},", shard.ForestDensity.ToString("F1")); | |
492 | - jsonWriter.Write("Rainfall : {0},", shard.Rainfall.ToString("F1")); | |
493 | - jsonWriter.Write("ShrubDensity : {0},", shard.ShrubDensity.ToString("F1")); | |
494 | - jsonWriter.Write("AirBlocks : {0},", shard.AirBlocks); | |
495 | - jsonWriter.Write("NonAirBlocks : {0},", shard.NonAirBlocks); | |
490 | + jsonWriter.Write("ChunkAge: '{0}',", shard.ChunkAge);//World age - relative? or last edit ?? | |
491 | + jsonWriter.Write("Temperature: {0},", shard.Temperature.ToString("F1")); | |
492 | + jsonWriter.Write("YMax: {0},", shard.YMax); | |
493 | + jsonWriter.Write("Fertility: {0},", shard.Fertility.ToString("F1")); | |
494 | + jsonWriter.Write("ForestDensity: {0},", shard.ForestDensity.ToString("F1")); | |
495 | + jsonWriter.Write("Rainfall: {0},", shard.Rainfall.ToString("F1")); | |
496 | + jsonWriter.Write("ShrubDensity: {0},", shard.ShrubDensity.ToString("F1")); | |
497 | + jsonWriter.Write("AirBlocks: {0},", shard.AirBlocks); | |
498 | + jsonWriter.Write("NonAirBlocks: {0},", shard.NonAirBlocks); | |
496 | 499 | //TODO: Heightmap |
497 | 500 | //TODO: Rock-ratio |
498 | 501 | jsonWriter.Write("}],"); |
499 | 502 | } |
500 | 503 | jsonWriter.Write("]);\n\n"); |
501 | 504 | |
502 | - //TODO: POIs | |
505 | + | |
506 | + jsonWriter.Write("let pointsOfInterest = new Map(["); | |
507 | + foreach (var poi in POIs) | |
508 | + { | |
509 | + jsonWriter.Write("['{0}_{1}',", poi.Location.X, poi.Location.Y); | |
510 | + jsonWriter.Write("{"); | |
511 | + jsonWriter.Write("notes: '{0}',", poi.Notes.Replace("'"," ")); | |
512 | + jsonWriter.Write("timestamp : new Date('{0}'),", poi.Timestamp.ToString("O")); | |
513 | + jsonWriter.Write("chunkPos:'{0}_{1}',", (poi.Location.X/chunkSize), (poi.Location.Y/chunkSize)); | |
514 | + jsonWriter.Write("}],"); | |
515 | + } | |
503 | 516 | |
517 | + foreach (var poi in EOIs.PointsList) | |
518 | + { | |
519 | + jsonWriter.Write("['{0}_{1}',", poi.Location.X, poi.Location.Y); | |
520 | + jsonWriter.Write("{"); | |
521 | + jsonWriter.Write("notes: '{0}',", poi.Notes.Replace("'", " ")); | |
522 | + jsonWriter.Write("timestamp : new Date('{0}'),", poi.Timestamp.ToString("O")); | |
523 | + jsonWriter.Write("chunkPos:'{0}_{1}',", (poi.Location.X / chunkSize), (poi.Location.Y / chunkSize)); | |
524 | + jsonWriter.Write("}],"); | |
525 | + } | |
526 | + jsonWriter.Write("]);\n\n"); | |
504 | 527 | |
505 | 528 | jsonWriter.Flush( ); |
506 | 529 | } |
@@ -7,7 +7,7 @@ | ||
7 | 7 | "version": "0.1.2", |
8 | 8 | "side":"Client", |
9 | 9 | "dependencies": { |
10 | - "game": "1.11.0" | |
10 | + "game": "1.12.0" | |
11 | 11 | }, |
12 | 12 | "website": "http://nowebsite.nope" |
13 | 13 | } |
\ No newline at end of file |