Racial module added to Eventlistener and Version check updated

This commit is contained in:
Sumsebrum 2021-05-18 16:41:25 +02:00
parent 8a27f88014
commit f2bfbe3211

View File

@ -1,4 +1,4 @@
local select, string_gsub = select, string.gsub local select, string_gsub, tostring = select, string.gsub, tostring
local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
local RAID_CLASS_COLORS = RAID_CLASS_COLORS local RAID_CLASS_COLORS = RAID_CLASS_COLORS
@ -34,7 +34,7 @@ function EventListener:JOINED_ARENA()
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START") self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
self:SetScript("OnEvent", EventListener.OnEvent) self:SetScript("OnEvent", EventListener.OnEvent)
Gladdy:SendCommMessage("GladdyVCheck", Gladdy.version, "RAID", UnitName("player")) Gladdy:SendCommMessage("GladdyVCheck", tostring(Gladdy.version_num), "RAID", UnitName("player"))
end end
function EventListener:Reset() function EventListener:Reset()
@ -106,17 +106,24 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
end end
end end
if srcUnit then if srcUnit then
local unitRace = Gladdy.buttons[srcUnit].race
-- cooldown tracker -- cooldown tracker
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 (Cooldowns.cooldownSpells[Gladdy.buttons[srcUnit].class][spellId]) then if Gladdy.db.cooldownCooldowns[tostring(spellId)] then
unitClass = Gladdy.buttons[srcUnit].class if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then
else unitClass = Gladdy.buttons[srcUnit].class
unitClass = Gladdy.buttons[srcUnit].race else
unitClass = Gladdy.buttons[srcUnit].race
end
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName)
Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
end end
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName) end
Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
if Gladdy.db.racialEnabled and Gladdy:Racials()[unitRace].spellName == spellName and Gladdy:Racials()[unitRace][spellID] then
Gladdy:SendMessage("RACIAL_USED", srcUnit)
end end
if not Gladdy.buttons[srcUnit].class then if not Gladdy.buttons[srcUnit].class then