mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-17 18:20:49 +00:00
unitframes: rework hide mechanics
This commit is contained in:
+21
-11
@@ -541,14 +541,6 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
-- break early on misconfigured UF's
|
-- break early on misconfigured UF's
|
||||||
if not unit.label then return end
|
if not unit.label then return end
|
||||||
|
|
||||||
-- hide self in group
|
|
||||||
if unit.fname == "Group0" or unit.fname == "PartyPet0" or unit.fname == "Party0Target" then
|
|
||||||
if GetNumPartyMembers() <= 0 then
|
|
||||||
unit:Hide()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
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
|
||||||
@@ -565,17 +557,35 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
unit.lastUnit = UnitName(unit.label .. unit.id)
|
unit.lastUnit = UnitName(unit.label .. unit.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 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
|
||||||
if UnitName(unit.label .. unit.id) or unit.unitname then
|
-- check existing units or focus frames
|
||||||
|
if unit.unitname then
|
||||||
|
unit:Show()
|
||||||
|
elseif UnitName(unit.label .. unit.id) then
|
||||||
|
-- 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()
|
||||||
|
return
|
||||||
|
|
||||||
|
-- hide existing but too far away pet
|
||||||
elseif strsub(unit.label,0,8) == "partypet" and not UnitIsVisible(unit.label .. unit.id) then
|
elseif strsub(unit.label,0,8) == "partypet" and not UnitIsVisible(unit.label .. unit.id) then
|
||||||
unit:Hide()
|
unit:Hide()
|
||||||
else
|
return
|
||||||
unit:Show()
|
|
||||||
|
-- hide self in group if solo or hide in raid is set
|
||||||
|
elseif unit.fname == "Group0" or unit.fname == "PartyPet0" or unit.fname == "Party0Target" then
|
||||||
|
if ( GetNumPartyMembers() <= 0 ) or ( pfUI_config["unitframes"]["group"]["hide_in_raid"] == "1" and UnitInRaid("player") ) then
|
||||||
|
unit:Hide()
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unit:Show()
|
||||||
else
|
else
|
||||||
|
-- hide unused frame
|
||||||
unit:Hide()
|
unit:Hide()
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user