show "one hour buffs" if they aren't 100% uptime.

This commit is contained in:
Tercio Jose
2024-07-22 13:33:12 -03:00
committed by andrew6180
parent 1dec8b7540
commit 4409149841
6 changed files with 76 additions and 9 deletions
+28
View File
@@ -32,7 +32,35 @@ function AuraScan.FindAndIgnoreWorldAuras()
end
end
function AuraScan.CheckForOneHourBuffs()
---@type combat
local currentCombat = Details:GetCurrentCombat()
---@type actorcontainer
local utilityContainer = currentCombat:GetContainer(DETAILS_ATTRIBUTE_MISC)
---@type combattime
local combatTime = floor(currentCombat:GetCombatTime())
for _, utilityActor in utilityContainer:ListActors() do
---@cast utilityActor actorutility
if (utilityActor:IsPlayer()) then
--get the buff container
---@type spellcontainer
local buffUptimeContainer = utilityActor.buff_uptime_spells
if (buffUptimeContainer) then
for spellId, spellTable in buffUptimeContainer:ListSpells() do
---@cast spellTable spelltable
if (Details222.OneHourAuras[spellId]) then
--is this buff have 100% uptime?
if (spellTable.uptime == combatTime) then
utilityActor.buff_uptime = utilityActor.buff_uptime - spellTable.uptime
utilityActor.buff_uptime_spells._ActorTable[spellId] = nil
end
end
end
end
end
end
end
function AuraScan.RegisterCallback(callback)
AuraScan.Callbacks[callback] = true