From d2c03c1d290b46955ee633f63aef88de7cf0ed07 Mon Sep 17 00:00:00 2001 From: urnati Date: Tue, 2 Jan 2024 09:51:35 -0500 Subject: [PATCH] - Bags : Default 'open bags' to true for Classic versions; occurs on first use of 8.* or no saved vars for each toon --- TitanBag/TitanBag.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/TitanBag/TitanBag.lua b/TitanBag/TitanBag.lua index abfc64f..90ba680 100644 --- a/TitanBag/TitanBag.lua +++ b/TitanBag/TitanBag.lua @@ -264,8 +264,16 @@ function TitanPanelBagButton_OnLoad(self) ShowColoredText = 1, DisplayOnRightSide = false, OpenBags = false, + OpenBagsClassic = "new_install", } }; + if TITAN_ID == "Titan" then -- 10.* / Retail + -- for taint issue + self.registry.savedVariables.OpenBags = false + else + -- does not taint so default to open bags on click + self.registry.savedVariables.OpenBags = true + end self:RegisterEvent("PLAYER_ENTERING_WORLD"); @@ -284,7 +292,7 @@ function TitanPanelBagButton_OnEvent(self, event, a1, a2, ...) self:RegisterEvent("BAG_UPDATE") TitanPanelButton_UpdateButton(TITAN_BAG_ID); - if a1 == true then + if a1 == true and TITAN_ID == "Titan" then -- 10.* / Retail -- initial login TitanPrint("" @@ -294,7 +302,15 @@ function TitanPanelBagButton_OnEvent(self, event, a1, a2, ...) .." "..tostring(ADDON_DISABLED or "Disabled").."" .." "..tostring("Until taint is fixed or work around found.").."" , "warning") - else + else -- either Classic version + local open = TitanGetVar(TITAN_BAG_ID, "OpenBagsClassic") + if open == "new_install" then -- + -- set to default behavior of opening bag on left click + TitanSetVar(TITAN_BAG_ID, "OpenBags", true) + TitanSetVar(TITAN_BAG_ID, "OpenBagsClassic", "processed") -- don't do again + else + -- already processed... + end end end -- 1.7.9.5