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
+1 -1
View File
@@ -1,6 +1,6 @@
local dversion = 306
local dversion = 307
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
+4
View File
@@ -5394,6 +5394,8 @@ DF.IconRowFunctions = {
--add the spell into the cache
self.AuraCache [spellId or -1] = true
self.AuraCache [spellName] = true
self.AuraCache.canStealOrPurge = self.AuraCache.canStealOrPurge or canStealOrPurge
self.AuraCache.hasEnrage = self.AuraCache.hasEnrage or debuffType == "" --yes, enrages are empty-string...
--> show the frame
self:Show()
@@ -5448,6 +5450,8 @@ DF.IconRowFunctions = {
else
self.AuraCache [iconPool[i].spellId] = true
self.AuraCache [iconPool[i].spellName] = true
self.AuraCache.canStealOrPurge = self.AuraCache.canStealOrPurge or iconPool[i].canStealOrPurge
self.AuraCache.hasEnrage = self.AuraCache.hasEnrage or iconPool[i].debuffType == "" --yes, enrages are empty-string...
countStillShown = countStillShown + 1
end
end
+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
+20 -4
View File
@@ -24,10 +24,13 @@ Change Log:
- player information is always available even when not in a group.
TODO:
- track interrupts (interrupt list is done, need to tracker the use of the spell and share it)
- need to finish the CheckForSpellsAdeedOrRemoved(), need to send the comm, need to create the local callbacks
- create comm to add or remove a cooldown from an unit
- add unit_connected through comm to know if a unit disconnected
- keystone info (portion of the logic is implemented, need to share the information)
- raid lockouts normal-heroic-mythic
- soulbind character (covenant choise) - probably not used in 10.0
- add into gear info how many tier set parts the player has
- (bug) after a /reload, it is not starting new tickers for spells under cooldown
--]=]
@@ -57,10 +60,15 @@ LIB_OPEN_RAID_CAN_LOAD = false
local CONST_COMM_PREFIX = "LRS"
local CONST_COMM_FULLINFO_PREFIX = "F"
local CONST_COMM_COOLDOWNUPDATE_PREFIX = "U"
local CONST_COMM_COOLDOWNFULLLIST_PREFIX = "C"
local CONST_COMM_COOLDOWNADDSPELL_PREFIX = "S"
local CONST_COMM_COOLDOWNREMOVESPELL_PREFIX = "E"
local CONST_COMM_GEARINFO_FULL_PREFIX = "G"
local CONST_COMM_GEARINFO_DURABILITY_PREFIX = "R"
local CONST_COMM_PLAYER_DEAD_PREFIX = "D"
local CONST_COMM_PLAYER_ALIVE_PREFIX = "A"
local CONST_COMM_PLAYERINFO_PREFIX = "P"
@@ -1450,7 +1458,7 @@ end
currentValue = 1
end
return timeLeft <= 2, percent, timeLeft, charges, minValue, maxValue, min(currentValue, maxValue)
return timeLeft <= 2, percent, timeLeft, charges, minValue, maxValue, min(currentValue, maxValue), duration
end
--return the values to be use on a progress bar or cooldown frame
@@ -1481,7 +1489,7 @@ end
end
--> internals
function openRaidLib.CooldownManager.OnPlayerCast(event, spellId, isPlayerPet)
function openRaidLib.CooldownManager.OnPlayerCast(event, spellId, isPlayerPet) --~cast
--player casted a spell, check if the spell is registered as cooldown
local playerSpec = openRaidLib.GetPlayerSpecId()
if (playerSpec) then
@@ -1552,7 +1560,15 @@ end
end
function openRaidLib.CooldownManager.OnPlayerPetChanged()
openRaidLib.Schedules.NewUniqueTimer(0.5, openRaidLib.CooldownManager.SendAllPlayerCooldowns, "CooldownManager", "sendAllPlayerCooldowns_Schedule")
--local spellsAdded, spellsRemoved = openRaidLib.CooldownManager.CheckForSpellsAdeedOrRemoved()
--and send a comm telling this player has a new spell instead of sending all the list of spells
-- local dataToSend = CONST_COMM_COOLDOWNFULLLIST_PREFIX .. ","
-- openRaidLib.commHandler.SendCommData(dataToSend)
--openRaidLib.Schedules.NewUniqueTimer(0.5, openRaidLib.CooldownManager.SendAllPlayerCooldowns, "CooldownManager", "sendAllPlayerCooldowns_Schedule")
end
openRaidLib.internalCallback.RegisterCallback("onLeaveGroup", openRaidLib.CooldownManager.OnPlayerLeaveGroup)
+6 -6
View File
@@ -456,7 +456,7 @@ LIB_OPEN_RAID_COOLDOWNS_BY_SPEC = {
--> DEMON HUNTER
--havoc
[577] = {
[200166] = 1, --Metamorphosis
[191427] = 1, --Metamorphosis
[198589] = 2, --Blur
[196555] = 2, --Netherwalk (talent)
[196718] = 4, --Darkness
@@ -595,7 +595,7 @@ LIB_OPEN_RAID_COOLDOWNS_BY_SPEC = {
},
--marksmanship
[254] = {
[193526] = 1, --Trueshot
[288613] = 1, --Trueshot
[186265] = 2, --Aspect of the Turtle
[199483] = 2, --Camouflage (talent)
[109304] = 2, --Exhilaration
@@ -685,7 +685,7 @@ LIB_OPEN_RAID_COOLDOWNS_BY_SPEC = {
--restoration
[264] = {
[108271] = 2, --Astral Shift
[114052] = 2, --Ascendance (talent)
[114052] = 4, --Ascendance (talent)
[98008] = 4, --Spirit Link Totem
[108280] = 4, --Healing Tide Totem
[16191] = 4, --Mana Tide Totem
@@ -780,7 +780,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[51533] = {cooldown = 120, duration = 15, talent = false, charges = 1, class = "SHAMAN", type = 1}, --Feral Spirit
[114050] = {cooldown = 180, duration = 15, talent = 21675, charges = 1, class = "SHAMAN", type = 1}, --Ascendance (talent)
[114051] = {cooldown = 180, duration = 15, talent = 21972, charges = 1, class = "SHAMAN", type = 1}, --Ascendance (talent)
[114052] = {cooldown = 180, duration = 15, talent = 22359, charges = 1, class = "SHAMAN", type = 2}, --Ascendance (talent)
[114052] = {cooldown = 180, duration = 15, talent = 22359, charges = 1, class = "SHAMAN", type = 4}, --Ascendance (talent)
[98008] = {cooldown = 180, duration = 6, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Spirit Link Totem
[108280] = {cooldown = 180, duration = 10, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Healing Tide Totem
[207399] = {cooldown = 240, duration = 30, talent = 22323, charges = 1, class = "SHAMAN", type = 4}, --Ancestral Protection Totem (talent)
@@ -814,7 +814,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[193530] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "HUNTER", type = 1}, --Aspect of the Wild
[19574] = {cooldown = 90, duration = 12, talent = false, charges = 1, class = "HUNTER", type = 1}, --Bestial Wrath
[201430] = {cooldown = 180, duration = 12, talent = 23044, charges = 1, class = "HUNTER", type = 1}, --Stampede (talent)
[193526] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "HUNTER", type = 1}, --Trueshot
[288613] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "HUNTER", type = 1}, --Trueshot
[199483] = {cooldown = 60, duration = 60, talent = 23100, charges = 1, class = "HUNTER", type = 2}, --Camouflage (talent)
[281195] = {cooldown = 180, duration = 6, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
[266779] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "HUNTER", type = 1}, --Coordinated Assault
@@ -869,7 +869,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[212552] = {cooldown = 60, duration = 4, talent = 19228, charges = 1, class = "DEATHKNIGHT", type = 5}, --Wraith walk (talent)
--demon hunter
[200166] = {cooldown = 240, duration = 30, talent = false, charges = 1, class = "DEMONHUNTER", type = 1}, --Metamorphosis
[191427] = {cooldown = 240, duration = 30, talent = false, charges = 1, class = "DEMONHUNTER", type = 1}, --Metamorphosis
[198589] = {cooldown = 60, duration = 10, talent = false, charges = 1, class = "DEMONHUNTER", type = 2}, --Blur
[196555] = {cooldown = 120, duration = 5, talent = 21865, charges = 1, class = "DEMONHUNTER", type = 2}, --Netherwalk (talent)
[187827] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "DEMONHUNTER", type = 2}, --Metamorphosis