• R/O
  • HTTP
  • SSH
  • HTTPS

automap: Commit

Automap (OSS) GIT software repository


Commit MetaInfo

Revisión71f44a94cf2ad64387400c832e52fb8ba0d838a7 (tree)
Tiempo2022-08-15 09:44:02
Autormelchior <melchior@user...>
Commitermelchior

Log Message

Fixes for Automatic startup

Cambiar Resumen

Diferencia incremental

--- a/Automap/Subsystems/AutomapGUIDialog.cs
+++ b/Automap/Subsystems/AutomapGUIDialog.cs
@@ -14,6 +14,7 @@ namespace Automap
1414 private const string _noteTextKey = @"edtNote";
1515 private const string _swAutostart = @"swAutostart";
1616 private const string _btnRunKey = @"btnRun";
17+ private const string _btnSnapKey = @"btnSnap";
1718
1819 private ILogger Logger;
1920 private PersistedConfiguration configuration;
@@ -32,11 +33,10 @@ namespace Automap
3233
3334 public AutomapGUIDialog(ICoreClientAPI capi, AutomapSystem ams, PersistedConfiguration cfg) : base(capi)
3435 {
35-
36+ configuration = cfg;
3637 Logger = capi.Logger;
3738 SetupDialog();
3839 capi.Event.RegisterEventBusListener(AutomapStatusMsg, 1.0D, AutomapSystem.AutomapStatusEventKey);
39- configuration = cfg;
4040 }
4141
4242 public AutomapGUIDialog(ICoreClientAPI capi) : base(capi)
@@ -90,7 +90,7 @@ namespace Automap
9090 .AddDynamicText("Idle.", CairoFont.WhiteSmallText().WithFontSize(12), EnumTextOrientation.Left, txtStatusBounds, _statusTextKey)
9191 .AddTextInput(txtNoteArea, null, CairoFont.WhiteMediumText().WithFontSize(16), _noteTextKey)
9292 .AddButton("Note:", CreateNote, btnNoteArea, CairoFont.ButtonText())
93- .AddButton("Snapshot!", TriggerSnapshot, btnSnapshotArea, CairoFont.ButtonText( ))
93+ .AddButton("Snapshot!", TriggerSnapshot, btnSnapshotArea, CairoFont.ButtonText( ), key: _btnSnapKey)
9494 .Compose();
9595
9696 //Controls for ALL Block & Entity Designators (Enable/Disable) <-- block edits while in 'Run' state
@@ -98,8 +98,8 @@ namespace Automap
9898 //_automapSystem.Entity_Designators
9999 //Renderer selection
100100 //Message verbosity? Speed?
101-
102-
101+ var swAutostart = this.SingleComposer.GetSwitch(_swAutostart);
102+ swAutostart.On = this.configuration.Autostart;
103103
104104 }
105105
@@ -186,25 +186,17 @@ namespace Automap
186186 statusText.SetNewText($"State: {lastState}, Total: {totalShards}, Delta: ±{changesThisTick} Nulls: {voidShards} ");
187187
188188 if (!btnRun.On) btnRun.SetValue(true);
189-
190- LockGUIElements(true);
189+
191190 }
192191 else if (lastState == CommandType.Stop && btnRun.Enabled) {
193192 statusText.SetNewText($"State: {lastState}, Total: {totalShards}, Nulls: {voidShards} ");
194193
195194 if (btnRun.On) btnRun.SetValue(false);
196-
197- LockGUIElements(true);
195+
198196 }
199197 }
200198
201- private void LockGUIElements(bool state)
202- {
203- var swAutostart = this.SingleComposer.GetSwitch(_swAutostart);
204199
205- swAutostart.Enabled = state;
206-
207- }
208200
209201 }
210202 }
--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -81,14 +81,6 @@ namespace Automap
8181
8282 //Listen on bus for commands
8383 ClientAPI.Event.RegisterEventBusListener(CommandListener, 1.0, AutomapSystem.AutomapCommandEventKey);
84-
85-
86- if (configuration.Autostart)
87- {
88- CurrentState = CommandType.Run;
89- Logger.Notification("Autostart is Enabled.");
90- }
91-
9284 }
9385
9486
@@ -124,6 +116,10 @@ namespace Automap
124116 };
125117
126118 ClientAPI.Event.RegisterGameTickListener(ThreadDecider, 6000);
119+
120+ if (configuration.Autostart) {
121+ CurrentState = CommandType.Run;
122+ }
127123 }
128124
129125 private void ChunkAChanging(Vec3i chunkCoord, IWorldChunk chunk, EnumChunkDirtyReason reason)
@@ -886,7 +882,7 @@ namespace Automap
886882 }
887883
888884 return null;
889- }
885+ }
890886 }
891887
892888 }
--- a/Automap/modinfo.json
+++ b/Automap/modinfo.json
@@ -4,7 +4,7 @@
44 "description" : "Automap; Generates a static HTML5 map dynamically, with P.O.I. Tracking & more.",
55 "authors": ["Melchior","VeryGoodDog"],
66 "contributors":["VeryGoodDog", "Drakker"],
7- "version": "0.1.8",
7+ "version": "0.1.8-pre.1",
88 "side":"Client",
99 "dependencies": {
1010 "game": "1.16.5"
Show on old repository browser