cooldowns test only active icons

This commit is contained in:
Sumsebrum 2022-03-25 00:02:25 +01:00
parent c6c3d23074
commit 10caa05e31

View File

@ -311,13 +311,17 @@ end
function Cooldowns:UpdateTestCooldowns(unit)
local button = Gladdy.buttons[unit]
self:UpdateCooldowns(button)
-- use class spells
for spellId,_ in pairs(Gladdy:GetCooldownList()[button.class]) do
self:CooldownUsed(unit, button.class, spellId)
local orderedIcons = {}
for _,icon in pairs(button.spellCooldownFrame.icons) do
tinsert(orderedIcons, icon)
end
-- use race spells
for spellId,_ in pairs(Gladdy:GetCooldownList()[button.race]) do
self:CooldownUsed(unit, button.race, spellId)
tbl_sort(orderedIcons, function(a, b)
return Gladdy.db.cooldownCooldownsOrder[button.class][tostring(a.spellId)] < Gladdy.db.cooldownCooldownsOrder[button.class][tostring(b.spellId)]
end)
for _,icon in ipairs(orderedIcons) do
self:CooldownUsed(unit, button.class, icon.spellId)
end
end