From 7f51fdf83a65c4c9555dded3040f417f911c0b0b Mon Sep 17 00:00:00 2001 From: Flamanis Date: Mon, 27 Feb 2023 16:53:10 -0600 Subject: [PATCH] Add Demonhunter and Evoker to DefensiveCooldownSpells. Use LibOpenRaid if possible --- functions/spells.lua | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/functions/spells.lua b/functions/spells.lua index 1d7e2b56..91abaedc 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -3061,11 +3061,31 @@ do } + local cooldownKeys = { --LIB_OPEN_RAID_COOLDOWNS_INFO types + [1] = true, + [2] = true, + [3] = true, + [4] = true, + [5] = true, + [6] = true, + [7] = true, + [8] = true, + } + local getCooldownsForClass = function(class) local result = {} - for spellId, spellInfo in pairs(_G.DetailsFramework.CooldownsInfo) do - if (class == spellInfo.class) then - result[#result+1] = spellId + --Use LibOpenRaid if possible. Otherwise fallback to DF. + if (LIB_OPEN_RAID_COOLDOWNS_INFO) then + for spellId, spellInfo in pairs(LIB_OPEN_RAID_COOLDOWNS_INFO) do + if (class == spellInfo.class and cooldownKeys[spellInfo.type]) then + result[#result+1] = spellId + end + end + else + for spellId, spellInfo in pairs(_G.DetailsFramework.CooldownsInfo) do + if (class == spellInfo.class) then + result[#result+1] = spellId + end end end return result @@ -3073,7 +3093,9 @@ do _detalhes.DefensiveCooldownSpells = { ["DEATHKNIGHT"] = getCooldownsForClass("DEATHKNIGHT"), + ["DEMONHUNTER"] = getCooldownsForClass("DEMONHUNTER"), ["DRUID"] = getCooldownsForClass("DRUID"), + ["EVOKER"] = getCooldownsForClass("EVOKER"), ["HUNTER"] = getCooldownsForClass("HUNTER"), ["MAGE"] = getCooldownsForClass("MAGE"), ["MONK"] = getCooldownsForClass("MONK"),