File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ read_globals = {
83
83
' GetUnitTotalModifiedMaxHealthPercent' ,
84
84
' HasLFGRestrictions' ,
85
85
' InCombatLockdown' ,
86
+ ' IsInInstance' ,
86
87
' IsLoggedIn' ,
87
88
' IsPlayerSpell' ,
88
89
' IsResting' ,
@@ -107,11 +108,11 @@ read_globals = {
107
108
' UnitClassBase' ,
108
109
' UnitExists' ,
109
110
' UnitFactionGroup' ,
111
+ ' UnitGUID' ,
110
112
' UnitGetIncomingHeals' ,
111
113
' UnitGetTotalAbsorbs' ,
112
114
' UnitGetTotalHealAbsorbs' ,
113
115
' UnitGroupRolesAssigned' ,
114
- ' UnitGUID' ,
115
116
' UnitHasIncomingResurrection' ,
116
117
' UnitHasVehiclePlayerFrameUI' ,
117
118
' UnitHasVehicleUI' ,
@@ -127,13 +128,14 @@ read_globals = {
127
128
' UnitIsGroupLeader' ,
128
129
' UnitIsMercenary' ,
129
130
' UnitIsOwnerOrControllerOfUnit' ,
130
- ' UnitIsPlayer' ,
131
131
' UnitIsPVP' ,
132
132
' UnitIsPVPFreeForAll' ,
133
+ ' UnitIsPlayer' ,
133
134
' UnitIsQuestBoss' ,
134
135
' UnitIsTapDenied' ,
135
136
' UnitIsUnit' ,
136
137
' UnitIsVisible' ,
138
+ ' UnitLeadsAnyGroup' ,
137
139
' UnitPhaseReason' ,
138
140
' UnitPlayerControlled' ,
139
141
' UnitPower' ,
Original file line number Diff line number Diff line change @@ -48,7 +48,13 @@ local function Update(self, event)
48
48
-- UnitLeadsAnyGroup(unit). Inside the group formed by the dungeon finder UnitIsGroupLeader(unit) will only return
49
49
-- true for the instance leader.
50
50
local isInLFGInstance = HasLFGRestrictions ()
51
- local isLeader = UnitIsGroupLeader (unit )
51
+ local isLeader
52
+ if (IsInInstance ()) then
53
+ isLeader = UnitIsGroupLeader (unit )
54
+ else
55
+ isLeader = UnitLeadsAnyGroup (unit )
56
+ end
57
+
52
58
if (isLeader ) then
53
59
if (isInLFGInstance ) then
54
60
element :SetTexture ([[ Interface\LFGFrame\UI-LFG-ICON-PORTRAITROLES]] )
@@ -96,6 +102,7 @@ local function Enable(self)
96
102
element .__owner = self
97
103
element .ForceUpdate = ForceUpdate
98
104
105
+ self :RegisterEvent (' UNIT_FLAGS' , Path )
99
106
self :RegisterEvent (' PARTY_LEADER_CHANGED' , Path , true )
100
107
self :RegisterEvent (' GROUP_ROSTER_UPDATE' , Path , true )
101
108
@@ -108,6 +115,7 @@ local function Disable(self)
108
115
if (element ) then
109
116
element :Hide ()
110
117
118
+ self :UnregisterEvent (' UNIT_FLAGS' , Path )
111
119
self :UnregisterEvent (' PARTY_LEADER_CHANGED' , Path )
112
120
self :UnregisterEvent (' GROUP_ROSTER_UPDATE' , Path )
113
121
end
You can’t perform that action at this time.
0 commit comments