From 6384d2f42d3247361b041ed8a9b92af6c5d31347 Mon Sep 17 00:00:00 2001 From: ebisuke Date: Tue, 28 Sep 2021 08:13:50 +0900 Subject: [PATCH] Fixed a bug when combined with certain add-ons. --- savequest/addon_d.ipf/savequest/savequest.lua | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/savequest/addon_d.ipf/savequest/savequest.lua b/savequest/addon_d.ipf/savequest/savequest.lua index 2256e6b..7ae2b6f 100644 --- a/savequest/addon_d.ipf/savequest/savequest.lua +++ b/savequest/addon_d.ipf/savequest/savequest.lua @@ -1,5 +1,7 @@ -SaveQuest = {} -SaveQuest.FRAME_SHORTCUT_USERVALUE_LAYERLEVEL = 'SAVEQUEST_LAYERLEVEL' +_G["SAVEQUEST"]=_G["SAVEQUEST"] or {} +local SaveQuest = _G["SAVEQUEST"]["SAVEQUEST"] or {} +SaveQuest.FRAME_SHORTCUT_USERVALUE_LAYERLEVEL = "SAVEQUEST_LAYERLEVEL" +local saqu=_G["SAVEQUEST"]["SAQU"] -- constructor. function SaveQuest.new(self) @@ -470,6 +472,13 @@ setmetatable(SaveQuest, {__call = SaveQuest.new}); -- frame initialize. function SAVEQUEST_ON_INIT(addon, frame) + -- remove old state. + if (saqu ~= nil) then + saqu:Destroy() + end + -- create instance. + saqu = SaveQuest() + _G["SAVEQUEST"]["SAQU"]=saqu -- override quest update event. if (saqu.UPDATE_QUESTINFOSET_2 == nil) then saqu.UPDATE_QUESTINFOSET_2 = UPDATE_QUESTINFOSET_2; @@ -608,9 +617,7 @@ function SAVEQUEST_END_WHEEL(frame, ctrl, delta, argNum) frame:SetLayerLevel(level) end --- remove old state. -if (saqu ~= nil) then - saqu:Destroy(); -end --- create instance. -saqu = SaveQuest(); +-- いる? + +_G["SAVEQUEST"]["SAQU"]=saqu +_G["SAVEQUEST"]["SAVEQUEST"] =SaveQuest \ No newline at end of file