mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-17 18:20:49 +00:00
unitframes: use unitname for validation
This commit is contained in:
+10
-6
@@ -803,12 +803,14 @@ function pfUI.uf:RefreshUnitState(unitframe)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function pfUI.uf:RefreshUnit(unit, component)
|
function pfUI.uf:RefreshUnit(unit, component)
|
||||||
|
-- break early on misconfigured UF's
|
||||||
if not unit.label then return end
|
if not unit.label then return end
|
||||||
if not unit.hp then return end
|
if not unit.hp then return end
|
||||||
if not unit.power then return end
|
if not unit.power then return end
|
||||||
|
|
||||||
local component = component or ""
|
local component = component or ""
|
||||||
-- break early on misconfigured UF's
|
|
||||||
|
-- don't update scanner activity
|
||||||
if unit.label == "target" or unit.label == "targettarget" then
|
if unit.label == "target" or unit.label == "targettarget" then
|
||||||
if pfScanActive == true then return end
|
if pfScanActive == true then return end
|
||||||
end
|
end
|
||||||
@@ -838,15 +840,17 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
default_border = pfUI_config.appearance.border.unitframes
|
default_border = pfUI_config.appearance.border.unitframes
|
||||||
end
|
end
|
||||||
|
|
||||||
local C = pfUI_config
|
|
||||||
|
|
||||||
-- hide and return early on unused frames
|
-- hide and return early on unused frames
|
||||||
if not ( pfUI.unlock and pfUI.unlock:IsShown() ) then
|
if not ( pfUI.unlock and pfUI.unlock:IsShown() ) then
|
||||||
|
|
||||||
|
--keep focus and named frames visible
|
||||||
if unit.unitname and unit.unitname ~= "focus" then
|
if unit.unitname and unit.unitname ~= "focus" then
|
||||||
--keep focus and named frames visible
|
|
||||||
unit:Show()
|
unit:Show()
|
||||||
elseif UnitExists(unit.label .. unit.id) then
|
|
||||||
|
|
||||||
|
-- only update visibility state for existing units
|
||||||
|
elseif UnitName(unit.label .. unit.id) then
|
||||||
|
|
||||||
-- hide group while in raid and option is set
|
-- hide group while in raid and option is set
|
||||||
if pfUI_config["unitframes"]["group"]["hide_in_raid"] == "1" and strsub(unit.label,0,5) == "party" and UnitInRaid("player") then
|
if pfUI_config["unitframes"]["group"]["hide_in_raid"] == "1" and strsub(unit.label,0,5) == "party" and UnitInRaid("player") then
|
||||||
unit:Hide()
|
unit:Hide()
|
||||||
@@ -869,12 +873,12 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
|
|
||||||
unit:Show()
|
unit:Show()
|
||||||
else
|
else
|
||||||
-- hide unused frame
|
|
||||||
unit:Hide()
|
unit:Hide()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- create required fields
|
||||||
if not unit.cache then unit.cache = {} end
|
if not unit.cache then unit.cache = {} end
|
||||||
if not unit.id then unit.id = "" end
|
if not unit.id then unit.id = "" end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user