Skip to content

Commit

Permalink
Merge branch 'main' into ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Dec 1, 2024
2 parents 01563ad + 6c17a3d commit 3a1a927
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ElvUI_Libraries/Core/oUF/elements/power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,6 @@ local function Enable(self)
element.SetColorTapping = SetColorTapping
element.SetColorThreat = SetColorThreat

oUF:RegisterEvent(self, 'UNIT_POWER_UPDATE', Path)

if(element.colorDisconnected) then
oUF:RegisterEvent(self, 'UNIT_CONNECTION', ColorPath)
end
Expand All @@ -379,10 +377,12 @@ local function Enable(self)
end

oUF:RegisterEvent(self, 'UNIT_DISPLAYPOWER', Path)
oUF:RegisterEvent(self, 'UNIT_MAXPOWER', Path)
oUF:RegisterEvent(self, 'UNIT_POWER_BAR_HIDE', Path)
oUF:RegisterEvent(self, 'UNIT_POWER_BAR_SHOW', Path)

self:RegisterEvent('UNIT_POWER_UPDATE', Path)
self:RegisterEvent('UNIT_MAXPOWER', Path)

if(element:IsObjectType('StatusBar') and not element:GetStatusBarTexture()) then
element:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]])
end
Expand All @@ -403,14 +403,15 @@ local function Disable(self)
element:Hide()

oUF:UnregisterEvent(self, 'UNIT_DISPLAYPOWER', Path)
oUF:UnregisterEvent(self, 'UNIT_MAXPOWER', Path)
oUF:UnregisterEvent(self, 'UNIT_POWER_BAR_HIDE', Path)
oUF:UnregisterEvent(self, 'UNIT_POWER_BAR_SHOW', Path)
oUF:UnregisterEvent(self, 'UNIT_POWER_UPDATE', Path)
oUF:UnregisterEvent(self, 'UNIT_CONNECTION', ColorPath)
oUF:UnregisterEvent(self, 'UNIT_FACTION', ColorPath)
oUF:UnregisterEvent(self, 'UNIT_FLAGS', ColorPath)
oUF:UnregisterEvent(self, 'UNIT_THREAT_LIST_UPDATE', ColorPath)

self:UnregisterEvent('UNIT_POWER_UPDATE', Path)
self:UnregisterEvent('UNIT_MAXPOWER', Path)
end
end

Expand Down

0 comments on commit 3a1a927

Please sign in to comment.