From f2bfbe3211d21387ac4d509168f550fa69b04567 Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Tue, 18 May 2021 16:41:25 +0200 Subject: [PATCH] Racial module added to Eventlistener and Version check updated --- EventListener.lua | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/EventListener.lua b/EventListener.lua index b16a00f..2b09a64 100644 --- a/EventListener.lua +++ b/EventListener.lua @@ -1,4 +1,4 @@ -local select, string_gsub = select, string.gsub +local select, string_gsub, tostring = select, string.gsub, tostring local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo 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_SUCCEEDED") self:SetScript("OnEvent", EventListener.OnEvent) - Gladdy:SendCommMessage("GladdyVCheck", Gladdy.version, "RAID", UnitName("player")) + Gladdy:SendCommMessage("GladdyVCheck", tostring(Gladdy.version_num), "RAID", UnitName("player")) end function EventListener:Reset() @@ -106,17 +106,24 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED() end end if srcUnit then + local unitRace = Gladdy.buttons[srcUnit].race -- cooldown tracker if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then local unitClass 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 - unitClass = Gladdy.buttons[srcUnit].class - else - unitClass = Gladdy.buttons[srcUnit].race + if Gladdy.db.cooldownCooldowns[tostring(spellId)] then + if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then + unitClass = Gladdy.buttons[srcUnit].class + else + unitClass = Gladdy.buttons[srcUnit].race + end + Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName) + Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName]) end - Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName) - Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName]) + 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