From 75ffa6f54bcf256b3015e90571c090cf1f2d022b Mon Sep 17 00:00:00 2001 From: wduda Date: Mon, 5 Dec 2022 09:54:34 +0100 Subject: [PATCH] readded unload event handling, added metadata --- .gitattributes | 0 CHANGELOG.md | 8 +++++++- TravelWindowII.plugin | 2 +- TravelWindowII.plugincompendium | 2 +- doc/lotroforums.md | 6 ++---- doc/lotrointerface.md | 6 ++---- src/Main.lua | 15 ++++++++++----- src/SettingsMenu.lua | 1 - src/TravelButton.lua | 1 - src/TravelWindow.lua | 5 ----- 10 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e69de29 diff --git a/CHANGELOG.md b/CHANGELOG.md index 41c4538..d051c6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog -v1.0.21beta +## v1.0.23beta +- saving options is now reliably done on every logout +## v1.0.22beta +- fixed bug with duplicate skillID affecting hunters trying to sort their travel skills +- fixed TWII button not saving position when being moved +- fixed error message when resetting skills to default +## v1.0.21beta - added U34 skills for EN/DE/FR - fixed two Muster skills in DE - PluginManager button for options no longer opens a second copy of options window diff --git a/TravelWindowII.plugin b/TravelWindowII.plugin index 162505d..344fb02 100644 --- a/TravelWindowII.plugin +++ b/TravelWindowII.plugin @@ -3,7 +3,7 @@ Travel Window II Hyoss - v1.0.22beta + v1.0.23beta This plugin creates a single window that contains all the available travel skills, including the race, class and reputation skills. It is a further development of Travel Window, that has been worked on by multiple authors before. diff --git a/TravelWindowII.plugincompendium b/TravelWindowII.plugincompendium index e3ee0f5..bfce48d 100644 --- a/TravelWindowII.plugincompendium +++ b/TravelWindowII.plugincompendium @@ -2,7 +2,7 @@ 1113 Travel Window II - v1.0.22beta + v1.0.23beta Hyoss http://www.lotrointerface.com/downloads/info1113 http://www.lotrointerface.com/downloads/download1113 diff --git a/doc/lotroforums.md b/doc/lotroforums.md index 2a0bd77..5c03695 100644 --- a/doc/lotroforums.md +++ b/doc/lotroforums.md @@ -1,8 +1,6 @@ A new version is available! -v1.0.22beta -- fixed bug with duplicate skillID affecting hunters trying to sort their travel skills -- fixed TWII button not saving position when being moved -- fixed error message when resetting skills to default +v1.0.23beta +- saving options is now reliably done on every logout Download it at [url=https://www.lotrointerface.com/downloads/fileinfo.php?id=1113]Lotrointerface[/url], [url=https://github.com/wduda/TravelWindowII/releases]GitHub[/url], via [url=https://github.com/JeremyStepp/OneLauncher]OneLauncher[/url] or via [url=https://www.lotrointerface.com/downloads/info663-LOTROPluginCompendium.html]Plugin Compendium[/url]. \ No newline at end of file diff --git a/doc/lotrointerface.md b/doc/lotrointerface.md index e2ea1a4..0b0388b 100644 --- a/doc/lotrointerface.md +++ b/doc/lotrointerface.md @@ -42,9 +42,7 @@ How to handle the settings reset introduced by v1.0.7beta? [/LIST] Version history: -v1.0.22beta -- fixed bug with duplicate skillID affecting hunters trying to sort their travel skills -- fixed TWII button not saving position when being moved -- fixed error message when resetting skills to default +v1.0.23beta +- saving options is now reliably done on every logout Rest of changelog found [URL="https://github.com/wduda/TravelWindowII/blob/master/CHANGELOG.md"]here[/URL]. \ No newline at end of file diff --git a/src/Main.lua b/src/Main.lua index e66a255..5ca2102 100644 --- a/src/Main.lua +++ b/src/Main.lua @@ -1,7 +1,12 @@ import "TravelWindowII.src"; -- create the travel window -travel = TravelWindow(); +_G.travel = TravelWindow(); + +-- handle unload event and save settings +plugin.Unload = function() + _G.travel:SaveSettings(); +end -- create a new command line command for the travel window TravelCommand = Turbine.ShellCommand(); @@ -9,13 +14,13 @@ TravelCommand = Turbine.ShellCommand(); -- handle the travel commands function TravelCommand:Execute(command, arguments) if (arguments == "show") then - travel:SetVisible(true); + _G.travel:SetVisible(true); elseif (arguments == "hide") then - travel:SetVisible(false); + _G.travel:SetVisible(false); elseif (arguments == "toggle") then - travel:SetVisible(not travel:IsVisible()); + _G.travel:SetVisible(not _G.travel:IsVisible()); elseif (arguments == "dump") then - travel:DoDump(); + _G.travel:DoDump(); elseif (arguments ~= nil) then TravelCommand:GetHelp(); end diff --git a/src/SettingsMenu.lua b/src/SettingsMenu.lua index 119e94b..d03f9cf 100644 --- a/src/SettingsMenu.lua +++ b/src/SettingsMenu.lua @@ -196,6 +196,5 @@ function SettingsMenu:Update(string) -- update the main window settings self.parent:UpdateSettings(); - self.parent:SaveSettings(); end diff --git a/src/TravelButton.lua b/src/TravelButton.lua index 444bb03..3efa209 100644 --- a/src/TravelButton.lua +++ b/src/TravelButton.lua @@ -90,7 +90,6 @@ function TravelButton:Constructor(parent) Settings.buttonPositionX = one; Settings.buttonPositionY = two; self.mainWindow:UpdateSettings(); - self.mainWindow:SaveSettings(); hasMoved = false; self:SetBackColor(Turbine.UI.Color(0, 0.5, 0.5, 0.5)); diff --git a/src/TravelWindow.lua b/src/TravelWindow.lua index 80b398d..e6131e8 100644 --- a/src/TravelWindow.lua +++ b/src/TravelWindow.lua @@ -166,7 +166,6 @@ function TravelWindow:Constructor() local one, two = self:GetPosition(); Settings.positionX = one; Settings.positionY = two; - self:SaveSettings(); self.PullTab:ClosePulldown(); end @@ -284,8 +283,6 @@ function TravelWindow:Constructor() Settings.width = self:GetWidth(); Settings.height = self:GetHeight(); self:UpdateSettings(); - self:SaveSettings(); - end -- perform the resize @@ -447,7 +444,6 @@ function TravelWindow:SaveMapHome(shortcut) end -- update and save everything self:UpdateSettings(); - self:SaveSettings(); end function TravelWindow:SetShortcuts() @@ -652,7 +648,6 @@ end -- function to close the options window if it exists function TravelWindow:CloseOptions() if (self.options ~= nil) then - self:SaveSettings(); self.options:SetVisible(false); end self.options = nil;