Skip to content

Commit

Permalink
power bar toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Dec 1, 2024
1 parent 739ceca commit ef3d6cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions ElvUI_Libraries/Core/oUF/elements/alternativepower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ local function Enable(self, unit)
element.__owner = self
element.ForceUpdate = ForceUpdate

oUF:RegisterEvent(self, 'UNIT_POWER_BAR_SHOW', VisibilityPath)
oUF:RegisterEvent(self, 'UNIT_POWER_BAR_HIDE', VisibilityPath)
self:RegisterEvent('UNIT_POWER_BAR_SHOW', VisibilityPath)
self:RegisterEvent('UNIT_POWER_BAR_HIDE', VisibilityPath)

if(element:IsObjectType('StatusBar') and not element:GetStatusBarTexture()) then
element:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]])
Expand Down Expand Up @@ -291,8 +291,8 @@ local function Disable(self, unit)
if(element) then
element:Hide()

oUF:UnregisterEvent(self, 'UNIT_POWER_BAR_SHOW', VisibilityPath)
oUF:UnregisterEvent(self, 'UNIT_POWER_BAR_HIDE', VisibilityPath)
self:UnregisterEvent('UNIT_POWER_BAR_SHOW', VisibilityPath)
self:UnregisterEvent('UNIT_POWER_BAR_HIDE', VisibilityPath)

if(unit == 'player') then
PlayerPowerBarAlt:RegisterEvent('UNIT_POWER_BAR_SHOW')
Expand Down
9 changes: 4 additions & 5 deletions ElvUI_Libraries/Core/oUF/elements/power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,9 @@ local function Enable(self)
oUF:RegisterEvent(self, 'UNIT_THREAT_LIST_UPDATE', ColorPath)
end

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

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

Expand All @@ -402,14 +401,14 @@ local function Disable(self)
if(element) then
element:Hide()

oUF:UnregisterEvent(self, 'UNIT_POWER_BAR_HIDE', Path)
oUF:UnregisterEvent(self, 'UNIT_POWER_BAR_SHOW', 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_DISPLAYPOWER', Path)
self:UnregisterEvent('UNIT_POWER_BAR_HIDE', Path)
self:UnregisterEvent('UNIT_POWER_BAR_SHOW', Path)
self:UnregisterEvent('UNIT_POWER_FREQUENT', Path)
self:UnregisterEvent('UNIT_MAXPOWER', Path)
end
Expand Down

0 comments on commit ef3d6cd

Please sign in to comment.