mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-31 07:56: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:
+2
-10
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user