From de90556632b1aaf2110a03847feda9e41c7e6f2d Mon Sep 17 00:00:00 2001 From: melchior Date: Sat, 10 Sep 2022 17:19:22 -0400 Subject: [PATCH] VS 1.17 Hot-Fix, minor tweaks --- Automap/AutomapMod.cs | 12 +++++++++++- Automap/Data/CommandData.cs | 7 +++++++ Automap/Data/StatusData.cs | 6 ++++++ Automap/modinfo.json | 4 ++-- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Automap/AutomapMod.cs b/Automap/AutomapMod.cs index 7b24649..8538f0b 100644 --- a/Automap/AutomapMod.cs +++ b/Automap/AutomapMod.cs @@ -35,7 +35,6 @@ namespace Automap ClientAPI.Logger.VerboseDebug("Automap Present!"); PrepareClientsideConfig( ); _localAutomap = new AutomapSystem(this.ClientAPI, this.Logger, this.CachedConfiguration); - _automapDialog = new AutomapGUIDialog(ClientAPI, _localAutomap, this.CachedConfiguration); ClientAPI.Input.RegisterHotKey(AutomapGUIDialog._automapControlPanelKey, "Automap control panel", GlKeys.M, HotkeyType.GUIOrOtherControls, shiftPressed: true); ClientAPI.Input.SetHotKeyHandler(AutomapGUIDialog._automapControlPanelKey, ToggleAM_Dialog); @@ -53,6 +52,7 @@ namespace Automap private bool ToggleAM_Dialog(KeyCombination comb) { + _automapDialog = _automapDialog ?? new AutomapGUIDialog(ClientAPI, _localAutomap, this.CachedConfiguration); if (_automapDialog.IsOpened()) _automapDialog.TryClose(); else _automapDialog.TryOpen(); @@ -84,6 +84,16 @@ namespace Automap this.CachedConfiguration = config; } + public override void Dispose( ) + { + //TAKE OUT THE TRASH! + //_localAutomap = null; + _automapDialog.Dispose( ); + _automapDialog = null; + + base.Dispose( ); + } + internal void PersistParameterChange( ) { //Store altered parameters diff --git a/Automap/Data/CommandData.cs b/Automap/Data/CommandData.cs index 7f14a30..0535efc 100644 --- a/Automap/Data/CommandData.cs +++ b/Automap/Data/CommandData.cs @@ -81,6 +81,13 @@ namespace Automap return false; } + + public IAttribute Clone( ) + { + var cloneCmd = new CommandData(this.State); + cloneCmd.Notation = this.Notation; + return cloneCmd; + } } } diff --git a/Automap/Data/StatusData.cs b/Automap/Data/StatusData.cs index 761bc86..a653174 100644 --- a/Automap/Data/StatusData.cs +++ b/Automap/Data/StatusData.cs @@ -55,6 +55,12 @@ namespace Automap { } return false; } + + public IAttribute Clone( ) + { + var statusData = new StatusData(this.TotalUpdates, this.VoidChunks,this.Delta, this.CurrentState); + return statusData; + } } } diff --git a/Automap/modinfo.json b/Automap/modinfo.json index 22f4de3..bcc745e 100644 --- a/Automap/modinfo.json +++ b/Automap/modinfo.json @@ -4,10 +4,10 @@ "description" : "Automap; Generates a static HTML5 map dynamically, with P.O.I. Tracking & more.", "authors": ["Melchior","VeryGoodDog"], "contributors":["VeryGoodDog", "Drakker"], - "version": "0.1.8-pre.1", + "version": "0.1.8-pre.2", "side":"Client", "dependencies": { - "game": "1.16.5" + "game": "1.17.0" }, "website": "http://automap.osdn.io/" } \ No newline at end of file -- 2.11.0