From 92322a4d9bf921cd5e78ba2b22bf2d45966a5168 Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Mon, 10 Jan 2022 23:59:20 +0100 Subject: [PATCH] spell interrupt announce --- Modules/Announcements.lua | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Modules/Announcements.lua b/Modules/Announcements.lua index aeb5fd5..4b63595 100644 --- a/Modules/Announcements.lua +++ b/Modules/Announcements.lua @@ -26,6 +26,7 @@ local Announcements = Gladdy:NewModule("Announcements", nil, { healthThreshold = 20, trinketUsed = true, trinketReady = false, + spellInterrupt = true, dest = "party", }, }) @@ -48,6 +49,7 @@ function Announcements:Initialize() self:RegisterMessage("TRINKET_USED") self:RegisterMessage("TRINKET_READY") self:RegisterMessage("SHADOWSIGHT") + self:RegisterMessage("SPELL_INTERRUPT") end function Announcements:Reset() @@ -138,6 +140,14 @@ function Announcements:TRINKET_READY(unit) self:Send(L["TRINKET READY: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class]) end +function Announcements:SPELL_INTERRUPT(destUnit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool) + local button = Gladdy.buttons[destUnit] + if (not button or not Gladdy.db.announcements.spellInterrupt) then + return + end + self:Send(L["INTERRUPTED: %s (%s)"]:format(extraSpellName, button.name or ""), 3, RAID_CLASS_COLORS[button.class]) +end + function Announcements:CheckDrink(unit, aura) local button = Gladdy.buttons[unit] if (not button or not Gladdy.db.announcements.drinks) then @@ -237,41 +247,47 @@ function Announcements:GetOptions() desc = L["Announce when an enemy's trinket is ready again"], order = 4, }), + spellInterrupt = option({ + type = "toggle", + name = L["Interrupts"], + desc = L["Announces when enemies' spells are interrupted"], + order = 5, + }), drinks = option({ type = "toggle", name = L["Drinking"], desc = L["Announces when enemies sit down to drink"], - order = 5, + order = 6, }), resurrections = option({ type = "toggle", name = L["Resurrection"], desc = L["Announces when an enemy tries to resurrect a teammate"], - order = 6, + order = 7, }), enemy = option({ type = "toggle", name = L["New enemies"], desc = L["Announces when new enemies are discovered"], - order = 7, + order = 8, }), spec = option({ type = "toggle", name = L["Spec Detection"], desc = L["Announces when the spec of an enemy was detected"], - order = 8, + order = 9, }), health = option({ type = "toggle", name = L["Low health"], desc = L["Announces when an enemy drops below a certain health threshold"], - order = 9, + order = 10, }), healthThreshold = option({ type = "range", name = L["Low health threshold"], desc = L["Choose how low an enemy must be before low health is announced"], - order = 10, + order = 11, min = 1, max = 100, step = 1, @@ -283,7 +299,7 @@ function Announcements:GetOptions() type = "select", name = L["Destination"], desc = L["Choose how your announcements are displayed"], - order = 11, + order = 12, values = destValues, }), }