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,11 +106,13 @@ 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
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
@ -118,6 +120,11 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName) Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName)
Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName]) Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
end end
end
if Gladdy.db.racialEnabled and Gladdy:Racials()[unitRace].spellName == spellName and Gladdy:Racials()[unitRace][spellID] then
Gladdy:SendMessage("RACIAL_USED", srcUnit)
end
if not Gladdy.buttons[srcUnit].class then if not Gladdy.buttons[srcUnit].class then
Gladdy:SpotEnemy(srcUnit, true) Gladdy:SpotEnemy(srcUnit, true)