Added a search box into the '/details scroll' command

This commit is contained in:
Tercio Jose
2022-04-26 12:43:37 -03:00
parent aa1b97b4c9
commit 3afc9ce24d
10 changed files with 117 additions and 20 deletions
+31
View File
@@ -216,4 +216,35 @@ 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