Open Raid Library update

This commit is contained in:
Tercio Jose
2022-04-28 15:52:11 -03:00
parent d4f50e7cb7
commit 1afb897904
8 changed files with 298 additions and 63 deletions
-31
View File
@@ -216,35 +216,4 @@ function openRaidLib.FilterCooldowns(unitName, allCooldowns, filters)
end
return resultFilters
end
--compare the current list of spells of the player with a new spell list generated
--add or remove spells from the current list, make the cache dirt and return a table with spells removed or added
function openRaidLib.CooldownManager.CheckForSpellsAdeedOrRemoved()
local playerName = UnitName("player")
local currentCooldowns = openRaidLib.CooldownManager.UnitData[playerName]
local _, newCooldownList = openRaidLib.CooldownManager.GetPlayerCooldownList()
local spellsAdded, spellsRemoved = {}, {}
for spellId, cooldownInfo in pairs(newCooldownList) do
if (not currentCooldowns[spellId]) then
--a spell has been added
currentCooldowns[spellId] = cooldownInfo
spellsAdded[#spellsAdded+1] = {spellId}
--mark the filter cache of this unit as dirt
openRaidLib.CooldownManager.NeedRebuildFilters[playerName] = true
end
end
for spellId, cooldownInfo in pairs(currentCooldowns) do
if (not newCooldownList[spellId]) then
--a spell has been removed
currentCooldowns[spellId] = nil
spellsRemoved[#spellsRemoved+1] = {spellId}
--mark the filter cache of this unit as dirt
openRaidLib.CooldownManager.NeedRebuildFilters[playerName] = true
end
end
return spellsAdded, spellsRemoved
end