unitframes: add option to always show self in raid

This commit is contained in:
shagu
2019-04-06 13:03:20 +02:00
parent 5b984714a9
commit d90f11e2cc
3 changed files with 20 additions and 17 deletions
+16 -15
View File
@@ -992,22 +992,23 @@ function pfUI.uf:RefreshUnit(unit, component)
local C = pfUI_config
-- show groupframes as raid
if C["unitframes"]["raidforgroup"] == "1" then
if strsub(unit:GetName(),0,6) == "pfRaid" then
local id = tonumber(strsub(unit:GetName(),7,8))
if strsub(unit:GetName(),0,6) == "pfRaid" then
local id = tonumber(strsub(unit:GetName(),7,8))
if not UnitInRaid("player") and GetNumPartyMembers() > 0 then
if id == 1 then
unit.id = ""
unit.label = "player"
elseif id <= 5 then
unit.id = id - 1
unit.label = "party"
end
elseif unit.label == "party" or unit.label == "player" then
unit.id = id
unit.label = "raid"
if not UnitInRaid("player") and GetNumPartyMembers() == 0 and C.unitframes.selfinraid == "1" and id == 1 then
unit.id = ""
unit.label = "player"
elseif not UnitInRaid("player") and GetNumPartyMembers() > 0 and C.unitframes.raidforgroup == "1" then
if id == 1 then
unit.id = ""
unit.label = "player"
elseif id <= 5 then
unit.id = id - 1
unit.label = "party"
end
elseif unit.label == "party" or unit.label == "player" then
unit.id = id
unit.label = "raid"
end
end
@@ -1049,7 +1050,7 @@ function pfUI.uf:RefreshUnit(unit, component)
-- 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 ( C["unitframes"]["group"]["hide_in_raid"] == "1" and UnitInRaid("player") ) then
if ( C["unitframes"]["group"]["hide_in_raid"] == "1" and UnitInRaid("player") ) then
unit:Hide()
return
end