mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-31 16:06:57 +00:00
Toggle visibility with SetShown instead of Show/Hide branches
Each if/else that only showed one object in one branch and hid it in the other is now ClassicAPI's SetShown, which shows on any truthy value. 21 sites across 10 modules.
This commit is contained in:
+3
-15
@@ -40,11 +40,7 @@ pfUI:RegisterModule("bags", function ()
|
||||
|
||||
-- overwrite some bag functions
|
||||
function _G.OpenAllBags()
|
||||
if pfUI.bag.right:IsShown() then
|
||||
pfUI.bag.right:Hide()
|
||||
else
|
||||
pfUI.bag.right:Show()
|
||||
end
|
||||
pfUI.bag.right:SetShown(not pfUI.bag.right:IsShown())
|
||||
end
|
||||
|
||||
function _G.CloseAllBags()
|
||||
@@ -52,11 +48,7 @@ pfUI:RegisterModule("bags", function ()
|
||||
end
|
||||
|
||||
function _G.ToggleBackpack()
|
||||
if pfUI.bag.right:IsShown() then
|
||||
pfUI.bag.right:Hide()
|
||||
else
|
||||
pfUI.bag.right:Show()
|
||||
end
|
||||
pfUI.bag.right:SetShown(not pfUI.bag.right:IsShown())
|
||||
end
|
||||
|
||||
function _G.OpenBackpack()
|
||||
@@ -1140,11 +1132,7 @@ pfUI:RegisterModule("bags", function ()
|
||||
end)
|
||||
|
||||
frame.bags:SetScript("OnClick", function()
|
||||
if pfUI.bag.left.bagslots:IsShown() then
|
||||
pfUI.bag.left.bagslots:Hide()
|
||||
else
|
||||
pfUI.bag.left.bagslots:Show()
|
||||
end
|
||||
pfUI.bag.left.bagslots:SetShown(not pfUI.bag.left.bagslots:IsShown())
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user