Skip to content

Commit

Permalink
swap these events back
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Dec 1, 2024
1 parent 7b6c7db commit c01043c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
6 changes: 3 additions & 3 deletions ElvUI/Core/General/Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ for textFormat in pairs(E.GetFormattedTextStyles) do
end
end)

E:AddTag(format('classpower:%s', tagFormat), (E.myclass == 'MONK' and 'UNIT_AURA ' or E.myclass == 'DEATHKNIGHT' and 'RUNE_POWER_UPDATE ' or '') .. 'UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER', function(unit)
E:AddTag(format('classpower:%s', tagFormat), (E.myclass == 'MONK' and 'UNIT_AURA ' or E.myclass == 'DEATHKNIGHT' and 'RUNE_POWER_UPDATE ' or '') .. 'UNIT_POWER_UPDATE UNIT_DISPLAYPOWER', function(unit)
local min, max = GetClassPower(unit)
if min ~= 0 then
return E:GetFormattedText(textFormat, min, max)
Expand Down Expand Up @@ -348,7 +348,7 @@ for textFormat in pairs(E.GetFormattedTextStyles) do
end
end, not E.Retail)

E:AddTag(format('classpower:%s:shortvalue', tagFormat), (E.myclass == 'MONK' and 'UNIT_AURA ' or E.myclass == 'DEATHKNIGHT' and 'RUNE_POWER_UPDATE ' or '') .. 'UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER', function(unit)
E:AddTag(format('classpower:%s:shortvalue', tagFormat), (E.myclass == 'MONK' and 'UNIT_AURA ' or E.myclass == 'DEATHKNIGHT' and 'RUNE_POWER_UPDATE ' or '') .. 'UNIT_POWER_UPDATE UNIT_DISPLAYPOWER', function(unit)
local min, max = GetClassPower(unit)
if min ~= 0 then
return E:GetFormattedText(textFormat, min, max, nil, true)
Expand Down Expand Up @@ -720,7 +720,7 @@ E:AddTag('pvptimer', 1, function(unit)
end
end)

E:AddTag('classpowercolor', 'UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER'..(E.Retail and ' PLAYER_SPECIALIZATION_CHANGED' or ''), function(unit)
E:AddTag('classpowercolor', 'UNIT_POWER_UPDATE UNIT_DISPLAYPOWER'..(E.Retail and ' PLAYER_SPECIALIZATION_CHANGED' or ''), function(unit)
local _, _, r, g, b = GetClassPower(unit)
return Hex(r, g, b)
end, E.Classic)
Expand Down
4 changes: 2 additions & 2 deletions ElvUI_Libraries/Core/oUF/elements/classpower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ end

do
function ClassPowerEnable(self)
self:RegisterEvent('UNIT_POWER_FREQUENT', Path)
self:RegisterEvent('UNIT_POWER_UPDATE', Path)
self:RegisterEvent('UNIT_MAXPOWER', Path)

if oUF.isRetail then -- according to Blizz any class may receive this event due to specific spell auras
Expand All @@ -277,7 +277,7 @@ do
end

function ClassPowerDisable(self)
self:UnregisterEvent('UNIT_POWER_FREQUENT', Path)
self:UnregisterEvent('UNIT_POWER_UPDATE', Path)
self:UnregisterEvent('UNIT_MAXPOWER', Path)

if oUF.isRetail then
Expand Down
10 changes: 6 additions & 4 deletions ElvUI_Libraries/Core/oUF/elements/eclipsebar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ local function EclipseDirectionPath(self, ...)
end

local function ElementEnable(self)
oUF:RegisterEvent(self, 'UNIT_POWER_FREQUENT', Path)
self:RegisterEvent('UNIT_POWER_UPDATE', Path)

self.EclipseBar:Show()
EclipseDirectionPath(self, 'ElementEnable', GetEclipseDirection())
Expand All @@ -71,7 +71,7 @@ local function ElementEnable(self)
end

local function ElementDisable(self)
oUF:UnregisterEvent(self, 'UNIT_POWER_FREQUENT', Path)
self:UnregisterEvent('UNIT_POWER_UPDATE', Path)

self.EclipseBar:Hide()

Expand Down Expand Up @@ -118,7 +118,8 @@ local function Enable(self, unit)
element.__owner = self
element.ForceUpdate = ForceUpdate

oUF:RegisterEvent(self, 'ECLIPSE_DIRECTION_CHANGE', EclipseDirectionPath, true)
self:RegisterEvent('ECLIPSE_DIRECTION_CHANGE', EclipseDirectionPath, true)

oUF:RegisterEvent(self, 'PLAYER_TALENT_UPDATE', VisibilityPath, true)
oUF:RegisterEvent(self, 'UPDATE_SHAPESHIFT_FORM', VisibilityPath, true)

Expand All @@ -138,7 +139,8 @@ local function Disable(self)
if(element) then
ElementDisable(self)

oUF:UnregisterEvent(self, 'ECLIPSE_DIRECTION_CHANGE', EclipseDirectionPath)
self:UnregisterEvent('ECLIPSE_DIRECTION_CHANGE', EclipseDirectionPath)

oUF:UnregisterEvent(self, 'PLAYER_TALENT_UPDATE', VisibilityPath)
oUF:UnregisterEvent(self, 'UPDATE_SHAPESHIFT_FORM', VisibilityPath)
end
Expand Down
4 changes: 2 additions & 2 deletions ElvUI_Libraries/Core/oUF/elements/range.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ local function Enable(self)
element.outsideAlpha = element.outsideAlpha or 0.55

if oUF.isRetail then
oUF:RegisterEvent(self, 'UNIT_IN_RANGE_UPDATE', Path)
self:RegisterEvent('UNIT_IN_RANGE_UPDATE', Path)
else
if not OnRangeFrame then
OnRangeFrame = CreateFrame('Frame')
Expand All @@ -132,7 +132,7 @@ local function Disable(self)
self:SetAlpha(element.insideAlpha)

if oUF.isRetail then
oUF:UnregisterEvent(self, 'UNIT_IN_RANGE_UPDATE', Path)
self:UnregisterEvent('UNIT_IN_RANGE_UPDATE', Path)
else
for index, frame in next, _FRAMES do
if frame == self then
Expand Down
10 changes: 5 additions & 5 deletions ElvUI_Libraries/Core/oUF/elements/tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ local tagEvents = {
['affix'] = 'UNIT_CLASSIFICATION_CHANGED',
['arenaspec'] = 'ARENA_PREP_OPPONENT_SPECIALIZATIONS',
['classification'] = 'UNIT_CLASSIFICATION_CHANGED',
['cpoints'] = 'UNIT_POWER_FREQUENT PLAYER_TARGET_CHANGED',
['cpoints'] = 'UNIT_POWER_UPDATE PLAYER_TARGET_CHANGED',
['curhp'] = 'UNIT_HEALTH UNIT_MAXHEALTH',
['curmana'] = 'UNIT_POWER_UPDATE UNIT_MAXPOWER',
['curpp'] = 'UNIT_POWER_UPDATE UNIT_MAXPOWER',
Expand Down Expand Up @@ -546,7 +546,7 @@ local tagEvents = {
['runes'] = 'RUNE_POWER_UPDATE',
['shortclassification'] = 'UNIT_CLASSIFICATION_CHANGED',
['smartlevel'] = 'UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED',
['soulshards'] = 'UNIT_POWER_FREQUENT',
['soulshards'] = 'UNIT_POWER_UPDATE',
['status'] = 'UNIT_HEALTH PLAYER_UPDATE_RESTING UNIT_CONNECTION PLAYER_FLAGS_CHANGED',
['threat'] = 'UNIT_THREAT_SITUATION_UPDATE',
['threatcolor'] = 'UNIT_THREAT_SITUATION_UPDATE',
Expand All @@ -565,9 +565,9 @@ local unitlessEvents = {
}

if oUF.isRetail then
tagEvents['arcanecharges'] = 'UNIT_POWER_FREQUENT PLAYER_TALENT_UPDATE'
tagEvents['chi'] = 'UNIT_POWER_FREQUENT PLAYER_TALENT_UPDATE'
tagEvents['holypower'] = 'UNIT_POWER_FREQUENT PLAYER_TALENT_UPDATE'
tagEvents['arcanecharges'] = 'UNIT_POWER_UPDATE PLAYER_TALENT_UPDATE'
tagEvents['chi'] = 'UNIT_POWER_UPDATE PLAYER_TALENT_UPDATE'
tagEvents['holypower'] = 'UNIT_POWER_UPDATE PLAYER_TALENT_UPDATE'
unitlessEvents.PLAYER_TALENT_UPDATE = true
elseif oUF.isCata then
unitlessEvents.PLAYER_TALENT_UPDATE = true
Expand Down
4 changes: 2 additions & 2 deletions ElvUI_Libraries/Core/oUF/elements/totems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ local function Enable(self)

element:Show()

oUF:RegisterEvent(self, 'PLAYER_TOTEM_UPDATE', Path, true)
self:RegisterEvent('PLAYER_TOTEM_UPDATE', Path, true)

return true
end
Expand All @@ -214,7 +214,7 @@ local function Disable(self)

element:Hide()

oUF:UnregisterEvent(self, 'PLAYER_TOTEM_UPDATE', Path)
self:UnregisterEvent('PLAYER_TOTEM_UPDATE', Path)
end
end

Expand Down

0 comments on commit c01043c

Please sign in to comment.