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:
Brues
2026-10-30 19:49:43 -05:00
parent f7680ded0b
commit 4616c2bc5f
10 changed files with 21 additions and 77 deletions
+2 -10
View File
@@ -42,11 +42,7 @@ pfUI:RegisterModule("unitxp", function ()
end
local success, behind = pcall(UnitXP, "behind", "player", "target")
if success and behind then
this.text:Show()
else
this.text:Hide()
end
this.text:SetShown(success and behind)
end)
pfUI.uf.target.behindIndicator = behindFrame
@@ -76,11 +72,7 @@ pfUI:RegisterModule("unitxp", function ()
end
local success, inSight = pcall(UnitXP, "inSight", "player", "target")
if success and inSight == false then
this.text:Show()
else
this.text:Hide()
end
this.text:SetShown(success and inSight == false)
end)
pfUI.uf.target.losIndicator = losFrame