unitframes: add option to show self in group

This commit is contained in:
shagu
2017-09-03 18:28:05 +02:00
parent 1d08a7619d
commit e93b52c2ba
4 changed files with 33 additions and 4 deletions
+24
View File
@@ -38,6 +38,22 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
local f = CreateFrame("Button", "pf" .. fname, UIParent)
-- show self in group
if unit == "party" and id == "0" then
unit = "player"
id = ""
end
if unit == "partypet" and id == "0" then
unit = "pet"
id = ""
end
if unit == "party0target" then
unit = "target"
id = ""
end
if not pfValidUnits[unit .. id] then
f.unitname = unit
f.RegisterEvent = function() return end
@@ -525,6 +541,14 @@ function pfUI.uf:RefreshUnit(unit, component)
-- break early on misconfigured UF's
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 pfScanActive == true then return end
end