Skip to content

Commit

Permalink
more improvements for range detection with the new system
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Dec 14, 2024
1 parent 7c7ac08 commit 9b9ec73
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
6 changes: 5 additions & 1 deletion ElvUI/Core/Modules/UnitFrames/Elements/Range.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ function UF:UpdateRangeList(db)
return spells
end

function UF:UpdateRangeSpells()
function UF:UpdateRangeSpells(event, arg1)
if event == 'CHARACTER_POINTS_CHANGED' and (not arg1 or arg1 > 0) then
return -- Not interested in gained points from leveling
end

local db = E.global.unitframe.rangeCheck
if db then
list[1] = UF:UpdateRangeList(db.ENEMY[E.myclass])
Expand Down
25 changes: 21 additions & 4 deletions ElvUI/Core/Modules/UnitFrames/UnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,10 @@ function UF:ZONE_CHANGED_NEW_AREA(event)
end
end

function UF:UNIT_INVENTORY_CHANGED()
UF:UpdateRangeSpells()
end

function UF:PLAYER_ENTERING_WORLD(_, initLogin, isReload)
UF:RegisterRaidDebuffIndicator()
UF:UpdateRangeSpells()
Expand Down Expand Up @@ -2112,10 +2116,22 @@ function UF:Initialize()
ElvUF:Factory(UF.Setup)

UF:UpdateColors()

UF:RegisterEvent('PLAYER_ENTERING_WORLD')
UF:RegisterEvent('PLAYER_TARGET_CHANGED')
UF:RegisterEvent('PLAYER_FOCUS_CHANGED')
UF:RegisterEvent('SOUNDKIT_FINISHED')

UF:RegisterEvent('SPELLS_CHANGED', 'UpdateRangeSpells')
UF:RegisterEvent('LEARNED_SPELL_IN_TAB', 'UpdateRangeSpells')
UF:RegisterEvent('CHARACTER_POINTS_CHANGED', 'UpdateRangeSpells')

if E.Retail or E.Cata then
UF:RegisterEvent('PLAYER_TALENT_UPDATE', 'UpdateRangeSpells')
elseif E.ClassicSOD and E.myclass == 'MAGE' then
UF:RegisterUnitEvent('UNIT_INVENTORY_CHANGED', 'player')
end

UF:DisableBlizzard()

hooksecurefunc('CompactRaidGroup_InitializeForGroup', UF.DisableBlizzard_InitializeForGroup)
Expand All @@ -2127,10 +2143,11 @@ function UF:Initialize()
end

local ORD = E.oUF_RaidDebuffs or _G.oUF_RaidDebuffs
if not ORD then return end
ORD.ShowDispellableDebuff = true
ORD.FilterDispellableDebuff = true
ORD.MatchBySpellName = false
if ORD then
ORD.ShowDispellableDebuff = true
ORD.FilterDispellableDebuff = true
ORD.MatchBySpellName = false
end
end

E:RegisterInitialModule(UF:GetName())

0 comments on commit 9b9ec73

Please sign in to comment.