- fix cooldowns not showing when spec detected
- fix nature's swiftness cd starts when buff fades (shaman + druid) - change order (always detect spec before cd usage)
This commit is contained in:
parent
f1fde07e6c
commit
29c3a7596c
@ -107,6 +107,7 @@ local specBuffs = {
|
|||||||
-- WARLOCK
|
-- WARLOCK
|
||||||
[GetSpellInfo(19028)] = L["Demonology"], -- Soul Link
|
[GetSpellInfo(19028)] = L["Demonology"], -- Soul Link
|
||||||
[GetSpellInfo(23759)] = L["Demonology"], -- Master Demonologist
|
[GetSpellInfo(23759)] = L["Demonology"], -- Master Demonologist
|
||||||
|
[GetSpellInfo(35696)] = L["Demonology"], -- Demonic Knowledge
|
||||||
[GetSpellInfo(30302)] = L["Destruction"], -- Nether Protection
|
[GetSpellInfo(30302)] = L["Destruction"], -- Nether Protection
|
||||||
[GetSpellInfo(34935)] = L["Destruction"], -- Backlash
|
[GetSpellInfo(34935)] = L["Destruction"], -- Backlash
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ local specSpells = {
|
|||||||
[GetSpellInfo(33983)] = L["Feral"], -- Mangle (Cat)
|
[GetSpellInfo(33983)] = L["Feral"], -- Mangle (Cat)
|
||||||
[GetSpellInfo(33987)] = L["Feral"], -- Mangle (Bear)
|
[GetSpellInfo(33987)] = L["Feral"], -- Mangle (Bear)
|
||||||
[GetSpellInfo(18562)] = L["Restoration"], -- Swiftmend
|
[GetSpellInfo(18562)] = L["Restoration"], -- Swiftmend
|
||||||
[GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness
|
[GetSpellInfo(17116)] = L["Restoration"], -- Nature's Swiftness
|
||||||
[GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life
|
[GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life
|
||||||
|
|
||||||
-- HUNTER
|
-- HUNTER
|
||||||
@ -182,7 +183,7 @@ local specSpells = {
|
|||||||
[GetSpellInfo(17364)] = L["Enhancement"], -- Stormstrike
|
[GetSpellInfo(17364)] = L["Enhancement"], -- Stormstrike
|
||||||
[GetSpellInfo(16190)] = L["Restoration"], -- Mana Tide Totem
|
[GetSpellInfo(16190)] = L["Restoration"], -- Mana Tide Totem
|
||||||
[GetSpellInfo(32594)] = L["Restoration"], -- Earth Shield
|
[GetSpellInfo(32594)] = L["Restoration"], -- Earth Shield
|
||||||
--[GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness
|
[GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness
|
||||||
|
|
||||||
-- WARLOCK
|
-- WARLOCK
|
||||||
[GetSpellInfo(30405)] = L["Affliction"], -- Unstable Affliction
|
[GetSpellInfo(30405)] = L["Affliction"], -- Unstable Affliction
|
||||||
@ -190,6 +191,7 @@ local specSpells = {
|
|||||||
--[GetSpellInfo(30911)] = L["Affliction"], -- Siphon Life
|
--[GetSpellInfo(30911)] = L["Affliction"], -- Siphon Life
|
||||||
[GetSpellInfo(30414)] = L["Destruction"], -- Shadowfury
|
[GetSpellInfo(30414)] = L["Destruction"], -- Shadowfury
|
||||||
[GetSpellInfo(30912)] = L["Destruction"], -- Conflagrate
|
[GetSpellInfo(30912)] = L["Destruction"], -- Conflagrate
|
||||||
|
[GetSpellInfo(18708)] = L["Demonology"], -- Fel Domination
|
||||||
|
|
||||||
-- WARRIOR
|
-- WARRIOR
|
||||||
[GetSpellInfo(30330)] = L["Arms"], -- Mortal Strike
|
[GetSpellInfo(30330)] = L["Arms"], -- Mortal Strike
|
||||||
|
@ -57,13 +57,15 @@ function Gladdy:SpotEnemy(unit, auraScan)
|
|||||||
if not unit or not button then
|
if not unit or not button then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
button.stealthed = false
|
||||||
|
if UnitExists(unit) then
|
||||||
button.raceLoc = UnitRace(unit)
|
button.raceLoc = UnitRace(unit)
|
||||||
button.race = select(2, UnitRace(unit))
|
button.race = select(2, UnitRace(unit))
|
||||||
button.classLoc = select(1, UnitClass(unit))
|
button.classLoc = select(1, UnitClass(unit))
|
||||||
button.class = select(2, UnitClass(unit))
|
button.class = select(2, UnitClass(unit))
|
||||||
button.name = UnitName(unit)
|
button.name = UnitName(unit)
|
||||||
button.stealthed = false
|
|
||||||
Gladdy.guids[UnitGUID(unit)] = unit
|
Gladdy.guids[UnitGUID(unit)] = unit
|
||||||
|
end
|
||||||
if button.class and button.race then
|
if button.class and button.race then
|
||||||
Gladdy:SendMessage("ENEMY_SPOTTED", unit)
|
Gladdy:SendMessage("ENEMY_SPOTTED", unit)
|
||||||
end
|
end
|
||||||
@ -138,14 +140,19 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
|||||||
if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then
|
if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then
|
||||||
local unitClass
|
local unitClass
|
||||||
local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
|
local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
|
||||||
|
if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
|
||||||
|
spellId = spellID
|
||||||
|
end
|
||||||
if Gladdy.db.cooldownCooldowns[tostring(spellId)] then
|
if Gladdy.db.cooldownCooldowns[tostring(spellId)] then
|
||||||
if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then
|
if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then
|
||||||
unitClass = Gladdy.buttons[srcUnit].class
|
unitClass = Gladdy.buttons[srcUnit].class
|
||||||
else
|
else
|
||||||
unitClass = Gladdy.buttons[srcUnit].race
|
unitClass = Gladdy.buttons[srcUnit].race
|
||||||
end
|
end
|
||||||
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
|
|
||||||
self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
|
self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
|
||||||
|
if spellID ~= 16188 and spellID ~= 17116 then -- Nature's Swiftness CD starts when buff fades
|
||||||
|
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -153,6 +160,9 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
|||||||
Gladdy:SendMessage("RACIAL_USED", srcUnit)
|
Gladdy:SendMessage("RACIAL_USED", srcUnit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if (eventType == "SPELL_AURA_REMOVED" and (spellID ~= 16188 or spellID ~= 17116) and Gladdy.buttons[srcUnit].class) then
|
||||||
|
Cooldowns:CooldownUsed(srcUnit, Gladdy.buttons[srcUnit].class, spellID)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -333,8 +343,9 @@ end
|
|||||||
|
|
||||||
function EventListener:Test(unit)
|
function EventListener:Test(unit)
|
||||||
local button = Gladdy.buttons[unit]
|
local button = Gladdy.buttons[unit]
|
||||||
if (Gladdy.testData[unit].testSpec) then
|
if (button and Gladdy.testData[unit].testSpec) then
|
||||||
button.spec = nil
|
button.spec = nil
|
||||||
|
Gladdy:SpotEnemy(unit, false)
|
||||||
self:DetectSpec(unit, button.testSpec)
|
self:DetectSpec(unit, button.testSpec)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -91,7 +91,7 @@ function Cooldowns:Initialize()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:RegisterMessage("ENEMY_SPOTTED")
|
self:RegisterMessage("ENEMY_SPOTTED")
|
||||||
self:RegisterMessage("SPEC_DETECTED")
|
self:RegisterMessage("UNIT_SPEC")
|
||||||
self:RegisterMessage("UNIT_DEATH")
|
self:RegisterMessage("UNIT_DEATH")
|
||||||
self:RegisterMessage("UNIT_DESTROYED")
|
self:RegisterMessage("UNIT_DESTROYED")
|
||||||
end
|
end
|
||||||
@ -299,21 +299,14 @@ end
|
|||||||
|
|
||||||
function Cooldowns:Test(unit)
|
function Cooldowns:Test(unit)
|
||||||
if Gladdy.frame.testing then
|
if Gladdy.frame.testing then
|
||||||
local button = Gladdy.buttons[unit]
|
|
||||||
if Gladdy.db.cooldown then
|
|
||||||
button.spellCooldownFrame:Show()
|
|
||||||
else
|
|
||||||
button.spellCooldownFrame:Hide()
|
|
||||||
end
|
|
||||||
self:UpdateTestCooldowns(unit)
|
self:UpdateTestCooldowns(unit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Cooldowns:UpdateTestCooldowns(unit)
|
function Cooldowns:UpdateTestCooldowns(unit)
|
||||||
local button = Gladdy.buttons[unit]
|
local button = Gladdy.buttons[unit]
|
||||||
self:UpdateCooldowns(button)
|
|
||||||
|
|
||||||
local orderedIcons = {}
|
local orderedIcons = {}
|
||||||
|
|
||||||
for _,icon in pairs(button.spellCooldownFrame.icons) do
|
for _,icon in pairs(button.spellCooldownFrame.icons) do
|
||||||
tinsert(orderedIcons, icon)
|
tinsert(orderedIcons, icon)
|
||||||
end
|
end
|
||||||
@ -337,7 +330,7 @@ function Cooldowns:ENEMY_SPOTTED(unit)
|
|||||||
self:UpdateCooldowns(Gladdy.buttons[unit])
|
self:UpdateCooldowns(Gladdy.buttons[unit])
|
||||||
end
|
end
|
||||||
|
|
||||||
function Cooldowns:SPEC_DETECTED(unit)
|
function Cooldowns:UNIT_SPEC(unit)
|
||||||
if (not Gladdy.buttons[unit]) then
|
if (not Gladdy.buttons[unit]) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -854,6 +847,7 @@ function Cooldowns:GetCooldownOptions()
|
|||||||
Gladdy.db.cooldownCooldowns[tostring(spellId)] = value
|
Gladdy.db.cooldownCooldowns[tostring(spellId)] = value
|
||||||
for unit in pairs(Gladdy.buttons) do
|
for unit in pairs(Gladdy.buttons) do
|
||||||
Cooldowns:ResetUnit(unit)
|
Cooldowns:ResetUnit(unit)
|
||||||
|
Cooldowns:UpdateCooldowns(Gladdy.buttons[unit])
|
||||||
Cooldowns:Test(unit)
|
Cooldowns:Test(unit)
|
||||||
end
|
end
|
||||||
Gladdy:UpdateFrame()
|
Gladdy:UpdateFrame()
|
||||||
|
Loading…
Reference in New Issue
Block a user