Automap (OSS) GIT software repository
Revisión | 71f44a94cf2ad64387400c832e52fb8ba0d838a7 (tree) |
---|---|
Tiempo | 2022-08-15 09:44:02 |
Autor | ![]() |
Commiter | melchior |
Fixes for Automatic startup
@@ -14,6 +14,7 @@ namespace Automap | ||
14 | 14 | private const string _noteTextKey = @"edtNote"; |
15 | 15 | private const string _swAutostart = @"swAutostart"; |
16 | 16 | private const string _btnRunKey = @"btnRun"; |
17 | + private const string _btnSnapKey = @"btnSnap"; | |
17 | 18 | |
18 | 19 | private ILogger Logger; |
19 | 20 | private PersistedConfiguration configuration; |
@@ -32,11 +33,10 @@ namespace Automap | ||
32 | 33 | |
33 | 34 | public AutomapGUIDialog(ICoreClientAPI capi, AutomapSystem ams, PersistedConfiguration cfg) : base(capi) |
34 | 35 | { |
35 | - | |
36 | + configuration = cfg; | |
36 | 37 | Logger = capi.Logger; |
37 | 38 | SetupDialog(); |
38 | 39 | capi.Event.RegisterEventBusListener(AutomapStatusMsg, 1.0D, AutomapSystem.AutomapStatusEventKey); |
39 | - configuration = cfg; | |
40 | 40 | } |
41 | 41 | |
42 | 42 | public AutomapGUIDialog(ICoreClientAPI capi) : base(capi) |
@@ -90,7 +90,7 @@ namespace Automap | ||
90 | 90 | .AddDynamicText("Idle.", CairoFont.WhiteSmallText().WithFontSize(12), EnumTextOrientation.Left, txtStatusBounds, _statusTextKey) |
91 | 91 | .AddTextInput(txtNoteArea, null, CairoFont.WhiteMediumText().WithFontSize(16), _noteTextKey) |
92 | 92 | .AddButton("Note:", CreateNote, btnNoteArea, CairoFont.ButtonText()) |
93 | - .AddButton("Snapshot!", TriggerSnapshot, btnSnapshotArea, CairoFont.ButtonText( )) | |
93 | + .AddButton("Snapshot!", TriggerSnapshot, btnSnapshotArea, CairoFont.ButtonText( ), key: _btnSnapKey) | |
94 | 94 | .Compose(); |
95 | 95 | |
96 | 96 | //Controls for ALL Block & Entity Designators (Enable/Disable) <-- block edits while in 'Run' state |
@@ -98,8 +98,8 @@ namespace Automap | ||
98 | 98 | //_automapSystem.Entity_Designators |
99 | 99 | //Renderer selection |
100 | 100 | //Message verbosity? Speed? |
101 | - | |
102 | - | |
101 | + var swAutostart = this.SingleComposer.GetSwitch(_swAutostart); | |
102 | + swAutostart.On = this.configuration.Autostart; | |
103 | 103 | |
104 | 104 | } |
105 | 105 |
@@ -186,25 +186,17 @@ namespace Automap | ||
186 | 186 | statusText.SetNewText($"State: {lastState}, Total: {totalShards}, Delta: ±{changesThisTick} Nulls: {voidShards} "); |
187 | 187 | |
188 | 188 | if (!btnRun.On) btnRun.SetValue(true); |
189 | - | |
190 | - LockGUIElements(true); | |
189 | + | |
191 | 190 | } |
192 | 191 | else if (lastState == CommandType.Stop && btnRun.Enabled) { |
193 | 192 | statusText.SetNewText($"State: {lastState}, Total: {totalShards}, Nulls: {voidShards} "); |
194 | 193 | |
195 | 194 | if (btnRun.On) btnRun.SetValue(false); |
196 | - | |
197 | - LockGUIElements(true); | |
195 | + | |
198 | 196 | } |
199 | 197 | } |
200 | 198 | |
201 | - private void LockGUIElements(bool state) | |
202 | - { | |
203 | - var swAutostart = this.SingleComposer.GetSwitch(_swAutostart); | |
204 | 199 | |
205 | - swAutostart.Enabled = state; | |
206 | - | |
207 | - } | |
208 | 200 | |
209 | 201 | } |
210 | 202 | } |
@@ -81,14 +81,6 @@ namespace Automap | ||
81 | 81 | |
82 | 82 | //Listen on bus for commands |
83 | 83 | 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 | - | |
92 | 84 | } |
93 | 85 | |
94 | 86 |
@@ -124,6 +116,10 @@ namespace Automap | ||
124 | 116 | }; |
125 | 117 | |
126 | 118 | ClientAPI.Event.RegisterGameTickListener(ThreadDecider, 6000); |
119 | + | |
120 | + if (configuration.Autostart) { | |
121 | + CurrentState = CommandType.Run; | |
122 | + } | |
127 | 123 | } |
128 | 124 | |
129 | 125 | private void ChunkAChanging(Vec3i chunkCoord, IWorldChunk chunk, EnumChunkDirtyReason reason) |
@@ -886,7 +882,7 @@ namespace Automap | ||
886 | 882 | } |
887 | 883 | |
888 | 884 | return null; |
889 | - } | |
885 | + } | |
890 | 886 | } |
891 | 887 | |
892 | 888 | } |
@@ -4,7 +4,7 @@ | ||
4 | 4 | "description" : "Automap; Generates a static HTML5 map dynamically, with P.O.I. Tracking & more.", |
5 | 5 | "authors": ["Melchior","VeryGoodDog"], |
6 | 6 | "contributors":["VeryGoodDog", "Drakker"], |
7 | - "version": "0.1.8", | |
7 | + "version": "0.1.8-pre.1", | |
8 | 8 | "side":"Client", |
9 | 9 | "dependencies": { |
10 | 10 | "game": "1.16.5" |