Skip to content

Commit

Permalink
leaderindicator: Show indicator for other leaders too
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Nov 20, 2024
1 parent 91d0de9 commit 98fd06c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion elements/leaderindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ local function Update(self, event)
-- UnitLeadsAnyGroup(unit). Inside the group formed by the dungeon finder UnitIsGroupLeader(unit) will only return
-- true for the instance leader.
local isInLFGInstance = HasLFGRestrictions()
local isLeader = UnitIsGroupLeader(unit)
local isLeader
if(IsInInstance()) then

Check warning on line 52 in elements/leaderindicator.lua

View workflow job for this annotation

GitHub Actions / lint

accessing undefined variable 'IsInInstance'
isLeader = UnitIsGroupLeader(unit)
else
isLeader = UnitLeadsAnyGroup(unit)

Check warning on line 55 in elements/leaderindicator.lua

View workflow job for this annotation

GitHub Actions / lint

accessing undefined variable 'UnitLeadsAnyGroup'
end

if(isLeader) then
if(isInLFGInstance) then
element:SetTexture([[Interface\LFGFrame\UI-LFG-ICON-PORTRAITROLES]])
Expand Down Expand Up @@ -96,6 +102,7 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate

self:RegisterEvent('UNIT_FLAGS', Path)
self:RegisterEvent('PARTY_LEADER_CHANGED', Path, true)
self:RegisterEvent('GROUP_ROSTER_UPDATE', Path, true)

Expand All @@ -108,6 +115,7 @@ local function Disable(self)
if(element) then
element:Hide()

self:UnregisterEvent('UNIT_FLAGS', Path)
self:UnregisterEvent('PARTY_LEADER_CHANGED', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path)
end
Expand Down

0 comments on commit 98fd06c

Please sign in to comment.