Skip to content

Commit 1c1d6e1

Browse files
committed
give interrupt announce a function to handle the event toggle
1 parent 6b654b6 commit 1c1d6e1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

ElvUI/Core/Modules/Misc/Misc.lua

+10-4
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,15 @@ function M:BossBanner_ConfigureLootFrame(lootFrame)
346346
lootFrame.IconHitBox.IconOverlay2:Hide()
347347
end
348348

349+
function M:ToggleInterrupt()
350+
local announce = E.db.general.interruptAnnounce
351+
if announce and announce ~= 'NONE' then
352+
M:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
353+
else
354+
M:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
355+
end
356+
end
357+
349358
function M:Initialize()
350359
M.Initialized = true
351360

@@ -356,6 +365,7 @@ function M:Initialize()
356365
M:ToggleItemLevelInfo(true)
357366
M:LoadQueueStatus()
358367
M:ZoneTextToggle()
368+
M:ToggleInterrupt()
359369

360370
M:RegisterEvent('MERCHANT_SHOW')
361371
M:RegisterEvent('RESURRECT_REQUEST')
@@ -395,10 +405,6 @@ function M:Initialize()
395405
end)
396406
end
397407

398-
if E.db.general.interruptAnnounce ~= 'NONE' then
399-
M:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
400-
end
401-
402408
if E.Retail then
403409
M:Hook('BossBanner_ConfigureLootFrame', nil, true) -- fix blizz thing x.x
404410
end

ElvUI_Options/Core/General.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ GenGen.gameMenuGroup.args.gameMenuScale = ACH:Range(L["Scale"], L["Change the sc
8181
GenGen.automation = ACH:Group(L["Automation"], nil, 80)
8282
GenGen.automation.inline = true
8383

84-
GenGen.automation.args.interruptAnnounce = ACH:Select(L["Announce Interrupts"], L["Announce when you interrupt a spell to the specified chat channel."], 1, { NONE = L["None"], SAY = L["Say"], YELL = L["Yell"], PARTY = L["Party Only"], RAID = L["Party / Raid"], RAID_ONLY = L["Raid Only"], EMOTE = L["CHAT_MSG_EMOTE"] }, nil, nil, nil, function(info, value) E.db.general[info[#info]] = value if value == 'NONE' then M:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED') else M:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') end end)
84+
GenGen.automation.args.interruptAnnounce = ACH:Select(L["Announce Interrupts"], L["Announce when you interrupt a spell to the specified chat channel."], 1, { NONE = L["None"], SAY = L["Say"], YELL = L["Yell"], PARTY = L["Party Only"], RAID = L["Party / Raid"], RAID_ONLY = L["Raid Only"], EMOTE = L["CHAT_MSG_EMOTE"] }, nil, nil, nil, function(info, value) E.db.general[info[#info]] = value M:ToggleInterrupt() end)
8585
GenGen.automation.args.autoAcceptInvite = ACH:Toggle(L["Accept Invites"], L["Automatically accept invites from guild/friends."], 2)
8686
GenGen.automation.args.autoTrackReputation = ACH:Toggle(L["Auto Track Reputation"], nil, 4)
8787
GenGen.automation.args.autoRepair = ACH:Select(L["Auto Repair"], L["Automatically repair using the following method when visiting a merchant."], 5, { NONE = L["None"], GUILD = not E.Classic and L["Guild"] or nil, PLAYER = L["Player"] })

0 commit comments

Comments
 (0)