• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Automap (client) [VS plugin mod]


Commit MetaInfo

Revisionf5ba0cca3cc3904cc386bcbd37c3a2b1f8211e64 (tree)
Time2020-02-20 09:59:46
Authormelchior <melchior@user...>
Commitermelchior

Log Message

Adjusted notes GUI, POI/EOI JSON metadata added

Change Summary

Incremental Difference

--- a/Automap/Subsystems/AutomapGUIDialog.cs
+++ b/Automap/Subsystems/AutomapGUIDialog.cs
@@ -57,14 +57,14 @@ namespace Automap
5757 txtStatusBounds.fixedHeight = 16;
5858 txtStatusBounds.percentWidth = 1;
5959
60- ElementBounds txtNoteArea = textBounds.CopyOffsetedSibling(20, 42, 1, 6);
61- txtNoteArea.fixedHeight = 24;
62- txtNoteArea.percentWidth = 25;
63-
6460 ElementBounds btnNoteArea = textBounds.CopyOffsetedSibling(0, 42, 2, 5);
6561 btnNoteArea.fixedHeight = 24;
6662 btnNoteArea.fixedWidth = 20;
6763
64+ ElementBounds txtNoteArea = btnNoteArea.CopyOffsetedSibling(64, 0, 1, 6);
65+ txtNoteArea.fixedHeight = 24;
66+ txtNoteArea.fixedWidth = 256;
67+
6868
6969 this.SingleComposer = capi.Gui.CreateCompo("automapControlPanel", dialogBounds)
7070 .AddShadedDialogBG(bgBounds)
@@ -126,7 +126,7 @@ namespace Automap
126126
127127 capi.Event.PushEvent(AutomapSystem.AutomapCommandEventKey, noteCmd);
128128 }
129- return true;//???
129+ return false;//???
130130 }
131131
132132 private void AutomapStatusMsg(string eventName, ref EnumHandling handling, IAttribute data)
--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -38,8 +38,8 @@ namespace Automap
3838
3939 private ConcurrentDictionary<Vec2i, uint> columnCounter = new ConcurrentDictionary<Vec2i, uint>(3, 150 );
4040 private ColumnsMetadata chunkTopMetadata;
41- private PointsOfInterest POIs;
42- private EntitiesOfInterest EOIs;
41+ private PointsOfInterest POIs = new PointsOfInterest();
42+ private EntitiesOfInterest EOIs = new EntitiesOfInterest();
4343
4444 internal Dictionary<int, BlockDesignator> BlockID_Designators { get; private set;}
4545 internal Dictionary<AssetLocation, EntityDesignator> Entity_Designators { get; private set; }
@@ -126,6 +126,9 @@ namespace Automap
126126 //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})");
127127 //#endif
128128 }
129+ else if (CurrentState == RunState.Snapshot) {
130+ //TODO: Snapshot generator second thread...
131+ }
129132
130133 }
131134
@@ -217,8 +220,7 @@ namespace Automap
217220
218221 private void Prefill_POI_Designators( )
219222 {
220- this.POIs = new PointsOfInterest( );
221- this.EOIs = new EntitiesOfInterest( );
223+
222224 this.BlockID_Designators = new Dictionary<int, BlockDesignator>( );
223225 this.Entity_Designators = new Dictionary<AssetLocation, EntityDesignator>( );
224226 this.RockIdCodes = Helpers.ArbitrarytBlockIdHunter(ClientAPI, new AssetLocation(GlobalConstants.DefaultDomain, "rock"), EnumBlockMaterial.Stone);
@@ -473,6 +475,7 @@ namespace Automap
473475 {
474476 jsonWriter.WriteLine("var worldSeedNum = {0};", ClientAPI.World.Seed);
475477 jsonWriter.WriteLine("var genTime = new Date('{0}');", DateTimeOffset.UtcNow.ToString("O"));
478+ jsonWriter.WriteLine("var startCoords = {{X:{0},Y:{1}}};", startChunkColumn.X, startChunkColumn.Y);
476479 jsonWriter.WriteLine("var chunkSize = {0};", chunkSize);
477480 jsonWriter.WriteLine("var northMostChunk ={0};", chunkTopMetadata.North_mostChunk);
478481 jsonWriter.WriteLine("var southMostChunk ={0};", chunkTopMetadata.South_mostChunk);
@@ -484,23 +487,43 @@ namespace Automap
484487 {
485488 jsonWriter.Write("['{0}_{1}',", shard.Location.X, shard.Location.Y);
486489 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);
496499 //TODO: Heightmap
497500 //TODO: Rock-ratio
498501 jsonWriter.Write("}],");
499502 }
500503 jsonWriter.Write("]);\n\n");
501504
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+ }
503516
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");
504527
505528 jsonWriter.Flush( );
506529 }
--- a/Automap/modinfo.json
+++ b/Automap/modinfo.json
@@ -7,7 +7,7 @@
77 "version": "0.1.2",
88 "side":"Client",
99 "dependencies": {
10- "game": "1.11.0"
10+ "game": "1.12.0"
1111 },
1212 "website": "http://nowebsite.nope"
1313 }
\ No newline at end of file