Skip to content

Commit

Permalink
Fixes to AOE display
Browse files Browse the repository at this point in the history
Update aura helpers
  • Loading branch information
Hekili committed Feb 15, 2025
1 parent e0ec208 commit b32de9e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
11 changes: 7 additions & 4 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,10 @@ local aoeDisplayRule = function( p )
local spec = rawget( p.specs, state.spec.id )
if not spec or not class.specs[ state.spec.id ] then return false end

if Hekili:GetToggleState( "mode" ) == "reactive" and ns.getNumberTargets() < ( spec.aoe or 3 ) then
local mode = Hekili:GetToggleState( "mode" )

if mode == "dual" then return true end
if mode == "reactive" and ns.getNumberTargets() < ( spec.aoe or 3 ) then
if HekiliDisplayAOE.RecommendationsStr then
HekiliDisplayAOE.RecommendationsStr = nil
HekiliDisplayAOE.NewRecommendations = true
Expand All @@ -1515,17 +1518,17 @@ local aoeDisplayRule = function( p )
end

local displayRules = {
Interrupts = { function( p ) return p.toggles.interrupts.value and p.toggles.interrupts.separate end, true, "Defensives" },
Interrupts = { function( p ) return p.toggles.interrupts.value and p.toggles.interrupts.separate end, true , "Defensives" },
Defensives = { function( p ) return p.toggles.defensives.value and p.toggles.defensives.separate end, false, "Cooldowns" },
Cooldowns = { function( p ) return p.toggles.cooldowns.value and p.toggles.cooldowns.separate end, false, "Primary" },
Primary = { function( ) return true end, false, "AOE" },
AOE = { aoeDisplayRule , false, "Interrupts" },
AOE = { aoeDisplayRule , true , "Interrupts" },
}

local hasSnapped
local lastSnapshot = {}

function Hekili.Update( initial )
function Hekili.Update()
if not Hekili:ScriptsLoaded() then
Hekili:LoadScripts()
return
Expand Down
2 changes: 1 addition & 1 deletion UI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ do
d.Buttons[ i ] = self:CreateButton( id, i )
d.Buttons[ i ]:Hide()

if conf.enabled and self:IsDisplayActive( id ) and i <= conf.numIcons then
if self:IsDisplayActive( id ) and i <= conf.numIcons then
if d.Recommendations[ i ] and d.Recommendations[ i ].actionName then
d.Buttons[ i ]:Show()
end
Expand Down
26 changes: 6 additions & 20 deletions Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ ns.UnitBuffByID = function( unitToken, spellID, filter )
end, unitToken, filter )
end

ns.FindUnitBuffByID = ns.UnitBuffByID

ns.UnitDebuffByID = function( unitToken, spellID, filter )
local playerOrPet = UnitIsUnit( "player", unitToken ) or UnitIsUnit( "pet", unitToken )
filter = filter or "HARMFUL"
Expand All @@ -50,6 +52,8 @@ ns.UnitDebuffByID = function( unitToken, spellID, filter )
end, unitToken, filter )
end

ns.FindUnitDebuffByID = ns.UnitDebuffByID

local UnitBuff, UnitDebuff = ns.UnitBuff, ns.UnitDebuff
local UnitBuffByID, UnitDebuffByID = ns.UnitBuffByID, ns.UnitDebuffByID

Expand Down Expand Up @@ -575,28 +579,10 @@ end

function ns.FindUnitDebuffByID( unit, id, filter )
if unit == "player" then return FindPlayerAuraByID( id ) end

local playerOrPet = false

if filter == "PLAYER|PET" then
playerOrPet = true
filter = nil
end

local i = 1
local name, icon, count, debuffType, duration, expirationTime, caster, stealable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff, nameplateShowAll, timeMod, value1, value2, value3 = UnitDebuff( unit, i, filter )

while( name ) do
if spellID == id and ( not playerOrPet or UnitIsUnit( caster, "player" ) or UnitIsUnit( caster, "pet" ) ) then break end
i = i + 1
name, icon, count, debuffType, duration, expirationTime, caster, stealable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff, nameplateShowAll, timeMod, value1, value2, value3 = UnitDebuff( unit, i, filter )
end

if name and name ~= nil then
return name, icon, count, debuffType, duration, expirationTime, caster, stealable, nameplateShowPersonal, spellID, canApplyAura, isBossDebuff, nameplateShowAll, timeMod, value1, value2, value3
end
return UnitDebuffByID( unit, id, filter )
end


function ns.IsActiveSpell( id )
local slot = FindSpellBookSlotBySpellID( id )
if not slot then return false end
Expand Down

0 comments on commit b32de9e

Please sign in to comment.