Skip to content

Commit

Permalink
add more to pooler
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Nov 30, 2024
1 parent d5fb0e0 commit f9ab56e
Show file tree
Hide file tree
Showing 21 changed files with 132 additions and 132 deletions.
11 changes: 5 additions & 6 deletions ElvUI_Libraries/Core/oUF/elements/additionalpower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ end
local function ElementEnable(self)
local element = self.AdditionalPower

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

element:Show()

element.__isEnabled = true

Path(self, 'ElementEnable', 'player', POWER_NAME)
Expand All @@ -186,12 +185,12 @@ end
local function ElementDisable(self)
local element = self.AdditionalPower

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

element:Hide()

element.__isEnabled = false

Path(self, 'ElementDisable', 'player', POWER_NAME)
end

Expand Down
23 changes: 11 additions & 12 deletions ElvUI_Libraries/Core/oUF/elements/alternativepower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,19 @@ local function Visibility(self, event, unit)

local barID = UnitPowerBarID(unit)
local barInfo = GetUnitPowerBarInfoByID(barID)

element.__barID = barID
element.__barInfo = barInfo
if(barInfo and (barInfo.showOnRaid and (UnitInParty(unit) or UnitInRaid(unit))
or not barInfo.hideFromOthers
or UnitIsUnit(unit, 'player')))
then
self:RegisterEvent('UNIT_POWER_UPDATE', Path)
self:RegisterEvent('UNIT_MAXPOWER', Path)

if(barInfo and (barInfo.showOnRaid and (UnitInParty(unit) or UnitInRaid(unit)) or not barInfo.hideFromOthers or UnitIsUnit(unit, 'player'))) then
oUF:RegisterEvent(self, 'UNIT_POWER_UPDATE', Path)
oUF:RegisterEvent(self, 'UNIT_MAXPOWER', Path)

element:Show()
Path(self, event, unit, ALTERNATE_POWER_NAME)
else
self:UnregisterEvent('UNIT_POWER_UPDATE', Path)
self:UnregisterEvent('UNIT_MAXPOWER', Path)
oUF:UnregisterEvent(self, 'UNIT_POWER_UPDATE', Path)
oUF:UnregisterEvent(self, 'UNIT_MAXPOWER', Path)

element:Hide()
Path(self, event, unit, ALTERNATE_POWER_NAME)
Expand Down Expand Up @@ -251,8 +250,8 @@ local function Enable(self, unit)
element.__owner = self
element.ForceUpdate = ForceUpdate

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

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

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

if(unit == 'player') then
PlayerPowerBarAlt:RegisterEvent('UNIT_POWER_BAR_SHOW')
Expand Down
16 changes: 8 additions & 8 deletions ElvUI_Libraries/Core/oUF/elements/assistantindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate

self:RegisterEvent('UNIT_FLAGS', Path)
self:RegisterEvent('GROUP_ROSTER_UPDATE', Path, true)
self:RegisterEvent('PLAYER_REGEN_DISABLED', Path, true)
self:RegisterEvent('PLAYER_REGEN_ENABLED', Path, true)
oUF:RegisterEvent(self, 'UNIT_FLAGS', Path)
oUF:RegisterEvent(self, 'GROUP_ROSTER_UPDATE', Path, true)
oUF:RegisterEvent(self, 'PLAYER_REGEN_DISABLED', Path, true)
oUF:RegisterEvent(self, 'PLAYER_REGEN_ENABLED', Path, true)

if(element:IsObjectType('Texture') and not element:GetTexture()) then
element:SetTexture([[Interface\GroupFrame\UI-Group-AssistantIcon]])
Expand All @@ -97,10 +97,10 @@ local function Disable(self)
if(element) then
element:Hide()

self:UnregisterEvent('UNIT_FLAGS', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path)
self:UnregisterEvent('PLAYER_REGEN_DISABLED', Path)
self:UnregisterEvent('PLAYER_REGEN_ENABLED', Path)
oUF:UnregisterEvent(self, 'UNIT_FLAGS', Path)
oUF:UnregisterEvent(self, 'GROUP_ROSTER_UPDATE', Path)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_DISABLED', Path)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_ENABLED', Path)
end
end

Expand Down
30 changes: 15 additions & 15 deletions ElvUI_Libraries/Core/oUF/elements/classpower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ local function Visibility(self, event, unit)
-- use 'player' instead of unit because 'SPELLS_CHANGED' is a unitless event
if(not RequirePower or RequirePower == UnitPowerType('player')) then
if(not RequireSpell or IsPlayerSpell(RequireSpell)) then
self:UnregisterEvent('SPELLS_CHANGED', Visibility)
oUF:UnregisterEvent(self, 'SPELLS_CHANGED', Visibility)
shouldEnable = true
unit = 'player'
else
self:RegisterEvent('SPELLS_CHANGED', Visibility, true)
oUF:RegisterEvent(self, 'SPELLS_CHANGED', Visibility, true)
end
end
end
Expand Down Expand Up @@ -258,13 +258,13 @@ end

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

if oUF.isRetail then -- according to Blizz any class may receive this event due to specific spell auras
self:RegisterEvent('UNIT_POWER_POINT_CHARGE', Path)
oUF:RegisterEvent(self, 'UNIT_POWER_POINT_CHARGE', Path)
else
self:RegisterEvent('PLAYER_TARGET_CHANGED', VisibilityPath, true)
oUF:RegisterEvent(self, 'PLAYER_TARGET_CHANGED', VisibilityPath, true)
end

self.ClassPower.__isEnabled = true
Expand All @@ -277,13 +277,13 @@ do
end

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

if oUF.isRetail then
self:UnregisterEvent('UNIT_POWER_POINT_CHARGE', Path)
oUF:UnregisterEvent(self, 'UNIT_POWER_POINT_CHARGE', Path)
else
self:UnregisterEvent('PLAYER_TARGET_CHANGED', VisibilityPath)
oUF:UnregisterEvent(self, 'PLAYER_TARGET_CHANGED', VisibilityPath)
end

local element = self.ClassPower
Expand Down Expand Up @@ -331,11 +331,11 @@ local function Enable(self, unit)
element.ForceUpdate = ForceUpdate

if(oUF.isRetail or oUF.isCata) and (RequireSpec or RequireSpell) then
self:RegisterEvent('PLAYER_TALENT_UPDATE', VisibilityPath, true)
oUF:RegisterEvent(self, 'PLAYER_TALENT_UPDATE', VisibilityPath, true)
end

if(RequirePower) then
self:RegisterEvent('UNIT_DISPLAYPOWER', VisibilityPath)
oUF:RegisterEvent(self, 'UNIT_DISPLAYPOWER', VisibilityPath)
end

element.ClassPowerEnable = ClassPowerEnable
Expand All @@ -361,11 +361,11 @@ local function Disable(self)
ClassPowerDisable(self)

if oUF.isRetail or oUF.isCata then
self:UnregisterEvent('PLAYER_TALENT_UPDATE', VisibilityPath)
oUF:UnregisterEvent(self, 'PLAYER_TALENT_UPDATE', VisibilityPath)
end

self:UnregisterEvent('UNIT_DISPLAYPOWER', VisibilityPath)
self:UnregisterEvent('SPELLS_CHANGED', Visibility)
oUF:UnregisterEvent(self, 'UNIT_DISPLAYPOWER', VisibilityPath)
oUF:UnregisterEvent(self, 'SPELLS_CHANGED', Visibility)
end
end

Expand Down
4 changes: 2 additions & 2 deletions ElvUI_Libraries/Core/oUF/elements/combatindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate

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

if(element:IsObjectType('Texture') and not element:GetTexture()) then
element:SetTexture([[Interface\CharacterFrame\UI-StateIcon]])
Expand All @@ -92,7 +92,7 @@ local function Disable(self)
if(element) then
element:Hide()

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

Expand Down
16 changes: 8 additions & 8 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)
self:RegisterEvent('UNIT_POWER_FREQUENT', Path)
oUF:RegisterEvent(self, 'UNIT_POWER_FREQUENT', Path)

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

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

self.EclipseBar:Hide()

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

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

if(element.LunarBar and element.LunarBar:IsObjectType('StatusBar') and not element.LunarBar:GetStatusBarTexture()) then
element.LunarBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]])
Expand All @@ -138,9 +138,9 @@ local function Disable(self)
if(element) then
ElementDisable(self)

self:UnregisterEvent('ECLIPSE_DIRECTION_CHANGE', EclipseDirectionPath)
self:UnregisterEvent('PLAYER_TALENT_UPDATE', VisibilityPath)
self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', VisibilityPath)
oUF:UnregisterEvent(self, 'ECLIPSE_DIRECTION_CHANGE', EclipseDirectionPath)
oUF:UnregisterEvent(self, 'PLAYER_TALENT_UPDATE', VisibilityPath)
oUF:UnregisterEvent(self, 'UPDATE_SHAPESHIFT_FORM', VisibilityPath)
end
end

Expand Down
16 changes: 8 additions & 8 deletions ElvUI_Libraries/Core/oUF/elements/grouproleindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate

self:RegisterEvent('PLAYER_REGEN_DISABLED', Path, true)
self:RegisterEvent('PLAYER_REGEN_ENABLED', Path, true)
oUF:RegisterEvent(self, 'PLAYER_REGEN_DISABLED', Path, true)
oUF:RegisterEvent(self, 'PLAYER_REGEN_ENABLED', Path, true)

if(self.unit == 'player') then
self:RegisterEvent('PLAYER_ROLES_ASSIGNED', Path, true)
oUF:RegisterEvent(self, 'PLAYER_ROLES_ASSIGNED', Path, true)
else
self:RegisterEvent('GROUP_ROSTER_UPDATE', Path, true)
oUF:RegisterEvent(self, 'GROUP_ROSTER_UPDATE', Path, true)
end

if(element:IsObjectType('Texture') and not element:GetTexture()) then
Expand All @@ -112,10 +112,10 @@ local function Disable(self)
if(element) then
element:Hide()

self:UnregisterEvent('PLAYER_REGEN_DISABLED', Path)
self:UnregisterEvent('PLAYER_REGEN_ENABLED', Path)
self:UnregisterEvent('PLAYER_ROLES_ASSIGNED', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path, true)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_DISABLED', Path)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_ENABLED', Path)
oUF:UnregisterEvent(self, 'PLAYER_ROLES_ASSIGNED', Path)
oUF:UnregisterEvent(self, 'GROUP_ROSTER_UPDATE', Path, true)
end
end

Expand Down
20 changes: 10 additions & 10 deletions ElvUI_Libraries/Core/oUF/elements/leaderindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate

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

return true
end
Expand All @@ -120,11 +120,11 @@ local function Disable(self)
if(element) then
element:Hide()

self:UnregisterEvent('UNIT_FLAGS', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path)
self:UnregisterEvent('PARTY_LEADER_CHANGED', Path)
self:UnregisterEvent('PLAYER_REGEN_DISABLED', Path)
self:UnregisterEvent('PLAYER_REGEN_ENABLED', Path)
oUF:UnregisterEvent(self, 'UNIT_FLAGS', Path)
oUF:UnregisterEvent(self, 'GROUP_ROSTER_UPDATE', Path)
oUF:UnregisterEvent(self, 'PARTY_LEADER_CHANGED', Path)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_DISABLED', Path)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_ENABLED', Path)
end
end

Expand Down
20 changes: 10 additions & 10 deletions ElvUI_Libraries/Core/oUF/elements/masterlooterindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ local function Enable(self, unit)
element.__owner = self
element.ForceUpdate = ForceUpdate

self:RegisterEvent('UNIT_FLAGS', Path)
self:RegisterEvent('GROUP_ROSTER_UPDATE', Path, true)
self:RegisterEvent('PARTY_LOOT_METHOD_CHANGED', Path, true)
self:RegisterEvent('PLAYER_REGEN_DISABLED', Path, true)
self:RegisterEvent('PLAYER_REGEN_ENABLED', Path, true)
oUF:RegisterEvent(self, 'UNIT_FLAGS', Path)
oUF:RegisterEvent(self, 'GROUP_ROSTER_UPDATE', Path, true)
oUF:RegisterEvent(self, 'PARTY_LOOT_METHOD_CHANGED', Path, true)
oUF:RegisterEvent(self, 'PLAYER_REGEN_DISABLED', Path, true)
oUF:RegisterEvent(self, 'PLAYER_REGEN_ENABLED', Path, true)

if(element:IsObjectType('Texture') and not element:GetTexture()) then
element:SetTexture([[Interface\GroupFrame\UI-Group-MasterLooter]])
Expand All @@ -121,11 +121,11 @@ local function Disable(self)
if(element) then
element:Hide()

self:UnregisterEvent('UNIT_FLAGS', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path)
self:UnregisterEvent('PARTY_LOOT_METHOD_CHANGED', Path)
self:UnregisterEvent('PLAYER_REGEN_DISABLED', Path)
self:UnregisterEvent('PLAYER_REGEN_ENABLED', Path)
oUF:UnregisterEvent(self, 'UNIT_FLAGS', Path)
oUF:UnregisterEvent(self, 'GROUP_ROSTER_UPDATE', Path)
oUF:UnregisterEvent(self, 'PARTY_LOOT_METHOD_CHANGED', Path)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_DISABLED', Path)
oUF:UnregisterEvent(self, 'PLAYER_REGEN_ENABLED', Path)
end
end

Expand Down
8 changes: 4 additions & 4 deletions ElvUI_Libraries/Core/oUF/elements/partyindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate

self:RegisterEvent('UPDATE_CHAT_COLOR', Path, true)
self:RegisterEvent('GROUP_ROSTER_UPDATE', Path, true)
oUF:RegisterEvent(self, 'UPDATE_CHAT_COLOR', Path, true)
oUF:RegisterEvent(self, 'GROUP_ROSTER_UPDATE', Path, true)

if(element.HomeIcon and element.HomeIcon:IsObjectType('Texture') and not element.HomeIcon:GetTexture()) then
element.HomeIcon:SetTexture([[Interface\FriendsFrame\UI-Toast-FriendOnlineIcon]])
Expand All @@ -82,8 +82,8 @@ local function Disable(self)
if(element) then
element:Hide()

self:UnregisterEvent('UPDATE_CHAT_COLOR', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path)
oUF:UnregisterEvent(self, 'UPDATE_CHAT_COLOR', Path)
oUF:UnregisterEvent(self, 'GROUP_ROSTER_UPDATE', Path)
end
end

Expand Down
4 changes: 2 additions & 2 deletions ElvUI_Libraries/Core/oUF/elements/phaseindicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate

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

local icon = (element.Icon or element)
if(icon:IsObjectType('Texture') and not icon:GetTexture()) then
Expand Down Expand Up @@ -154,7 +154,7 @@ local function Disable(self)
if(element) then
element:Hide()

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

Expand Down
Loading

0 comments on commit f9ab56e

Please sign in to comment.