Open Raid Library update
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user