From c474b762bb6299754549341f5cf996c7b22ef03b Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Mon, 30 Jan 2023 14:14:47 -0300 Subject: [PATCH] Open Raid Lib updates: now is capable to track item cooldown --- Libs/LibOpenRaid/Functions.lua | 3 +++ Libs/LibOpenRaid/GetPlayerInformation.lua | 6 +++-- Libs/LibOpenRaid/LibOpenRaid.lua | 2 +- .../ThingsToMantain_Dragonflight.lua | 9 ++++++- boot.lua | 1 + classes/container_segments.lua | 2 +- frames/window_cdtracker.lua | 25 +++++++++++++------ 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Libs/LibOpenRaid/Functions.lua b/Libs/LibOpenRaid/Functions.lua index f3150ff9..501ed0d5 100644 --- a/Libs/LibOpenRaid/Functions.lua +++ b/Libs/LibOpenRaid/Functions.lua @@ -18,6 +18,7 @@ local CONST_COOLDOWN_TYPE_DEFENSIVE_TARGET = 3 local CONST_COOLDOWN_TYPE_DEFENSIVE_RAID = 4 local CONST_COOLDOWN_TYPE_UTILITY = 5 local CONST_COOLDOWN_TYPE_INTERRUPT = 6 +local CONST_COOLDOWN_TYPE_ITEM = 10 --hold spellIds and which custom caches the spell is in --map[spellId] = map[filterName] = true @@ -179,6 +180,7 @@ local filterStringToCooldownType = { ["ofensive"] = CONST_COOLDOWN_TYPE_OFFENSIVE, ["utility"] = CONST_COOLDOWN_TYPE_UTILITY, ["interrupt"] = CONST_COOLDOWN_TYPE_INTERRUPT, + ["item"] = CONST_COOLDOWN_TYPE_ITEM, } local filterStringToCooldownTypeReverse = { @@ -188,6 +190,7 @@ local filterStringToCooldownTypeReverse = { [CONST_COOLDOWN_TYPE_OFFENSIVE] = "ofensive", [CONST_COOLDOWN_TYPE_UTILITY] = "utility", [CONST_COOLDOWN_TYPE_INTERRUPT] = "interrupt", + [CONST_COOLDOWN_TYPE_ITEM] = "item", } local removeSpellFromCustomFilterCache = function(spellId, filterName) diff --git a/Libs/LibOpenRaid/GetPlayerInformation.lua b/Libs/LibOpenRaid/GetPlayerInformation.lua index 3cf600ec..44b52900 100644 --- a/Libs/LibOpenRaid/GetPlayerInformation.lua +++ b/Libs/LibOpenRaid/GetPlayerInformation.lua @@ -579,8 +579,10 @@ local updateCooldownAvailableList = function() --build a list of all spells assigned as cooldowns for the player class for spellID, spellData in pairs(LIB_OPEN_RAID_COOLDOWNS_INFO) do - if (spellData.class == playerClass or spellData.raceid == playerRaceId) then --need to implement here to get the racial as racial cooldowns does not carry a class - if (spellBookSpellList[spellID]) then + --type 10 is an item cooldown and does not have a class or raceid + if (spellData.class == playerClass or spellData.raceid == playerRaceId or spellData.type == 10) then --need to implement here to get the racial as racial cooldowns does not carry a class + --type 10 is an item cooldown and does not have a spellbook entry + if (spellBookSpellList[spellID] or spellData.type == 10) then LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellID] = spellData end end diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index f6c8b684..334e8041 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -64,7 +64,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t end local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 93 +local CONST_LIB_VERSION = 94 if (not LIB_OPEN_RAID_MAX_VERSION) then LIB_OPEN_RAID_MAX_VERSION = CONST_LIB_VERSION diff --git a/Libs/LibOpenRaid/ThingsToMantain_Dragonflight.lua b/Libs/LibOpenRaid/ThingsToMantain_Dragonflight.lua index 61452c60..b2310a15 100644 --- a/Libs/LibOpenRaid/ThingsToMantain_Dragonflight.lua +++ b/Libs/LibOpenRaid/ThingsToMantain_Dragonflight.lua @@ -195,7 +195,7 @@ do [370511] = 1, --Refreshing Healing Potion [371039] = 1, --Potion of Withering Vitality [370607] = 1, --Aerated Mana Potion - [371024] = 1, --Elemental Potion of Power + [371024] = 1, --Elemental Potion of Power --querying cooldown with GetSpellCooldown(371024) gives the cooldown of both potions [371028] = 1, --Elemental Potion of Ultimate Power [371033] = 1, --Potion of Frozen Focus [371125] = 1, --Potion of the Hushed Zephyr @@ -256,6 +256,13 @@ do -- 7 dispel -- 8 crowd control -- 9 racials + -- 10 items + + --attack potions + [371024] = {cooldown = 300, duration = 30, specs = {}, talent = false, charges = 1, class = "", type = 10}, --Elemental Potion of Power + --defensive potions + [6262] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, class = "", type = 10}, --Healthstone + [370511] = {cooldown = 300, duration = 0, specs = {}, talent = false, charges = 1, class = "", type = 10}, --Refreshing Healing Potion --racials --maintanance: login into the new race and type /run Details.GenerateRacialSpellList() diff --git a/boot.lua b/boot.lua index b1c32446..d66cfc92 100644 --- a/boot.lua +++ b/boot.lua @@ -97,6 +97,7 @@ do --Remove multi-spec entries for shaman guessing (Flamanis). --More Demon hunter abilities added to be merged (Flamanis). --Added duck polymorph to Mage CCs (Flamanis). + --Fixed offline player showing as party members in the /keys panel (Flamanis). --Fixed an issue with some options not updating when the window is selected at the bottom right corner of the options panel (Flamanis). diff --git a/classes/container_segments.lua b/classes/container_segments.lua index 7fb81434..39afc47b 100644 --- a/classes/container_segments.lua +++ b/classes/container_segments.lua @@ -517,7 +517,7 @@ function segmentClass:resetar() wipe(Details.cache_healing_group) Details:UpdateParserGears() - if (not InCombatLockdown() and not UnitAffectingCombat("player")) then + if (not InCombatLockdown() and not UnitAffectingCombat("player") and false) then --workarround for the "script run too long" issue while outside the combat lockdown local cleargarbage = function() collectgarbage() diff --git a/frames/window_cdtracker.lua b/frames/window_cdtracker.lua index c14a272a..8f3b542b 100644 --- a/frames/window_cdtracker.lua +++ b/frames/window_cdtracker.lua @@ -478,7 +478,7 @@ end Details222.CooldownTracking.RefreshCooldownFrames() end, name = "Defensive: Raid", - desc = "Exanple: druid tranquility.", + desc = "Example: druid tranquility.", }, {--filter: show target defensive cooldowns @@ -489,7 +489,7 @@ end Details222.CooldownTracking.RefreshCooldownFrames() end, name = "Defensive: Target", - desc = "Exanple: priest pain suppression.", + desc = "Example: priest pain suppression.", }, {--filter: show personal defensive cooldowns @@ -500,7 +500,7 @@ end Details222.CooldownTracking.RefreshCooldownFrames() end, name = "Defensive: Personal", - desc = "Exanple: mage ice block.", + desc = "Example: mage ice block.", }, {--filter: show ofensive cooldowns @@ -511,7 +511,7 @@ end Details222.CooldownTracking.RefreshCooldownFrames() end, name = "Offensive Cooldowns", - desc = "Exanple: priest power infusion.", + desc = "Example: priest power infusion.", }, {--filter: show utility cooldowns @@ -522,7 +522,7 @@ end Details222.CooldownTracking.RefreshCooldownFrames() end, name = "Utility Cooldowns", - desc = "Exanple: druid roar.", + desc = "Example: druid roar.", }, {--filter: show interrupt cooldowns @@ -533,8 +533,19 @@ end Details222.CooldownTracking.RefreshCooldownFrames() end, name = "Interrupt Cooldowns", - desc = "Exanple: rogue kick.", - }, + desc = "Example: rogue kick.", + }, + + {--filter: item cooldowns + type = "toggle", + get = function() return Details.ocd_tracker.filters["item"] end, + set = function(self, fixedparam, value) + Details.ocd_tracker.filters["item"] = value + Details222.CooldownTracking.RefreshCooldownFrames() + end, + name = "Item Cooldowns", + desc = "Example: Healthstone.", + }, {type = "breakline"},