From 6c17a3d29a2ff986df3b040cf783069dbfb66eff Mon Sep 17 00:00:00 2001 From: Simpy Date: Sun, 1 Dec 2024 04:26:34 -0500 Subject: [PATCH] these too --- ElvUI_Libraries/Core/oUF/elements/power.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ElvUI_Libraries/Core/oUF/elements/power.lua b/ElvUI_Libraries/Core/oUF/elements/power.lua index f2d0c0b24c..eff4263ef6 100644 --- a/ElvUI_Libraries/Core/oUF/elements/power.lua +++ b/ElvUI_Libraries/Core/oUF/elements/power.lua @@ -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 @@ -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 @@ -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