Skip to content

Commit 7178352

Browse files
committed
show interrupt msg in castbar on successful interrupts
1 parent bf86412 commit 7178352

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ClassicCastbars/ClassicCastbars_TBC.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ addon.AnchorManager = namespace.AnchorManager
1818
addon.defaultConfig = namespace.defaultConfig
1919
addon.activeFrames = activeFrames
2020

21+
local GetSchoolString = _G.GetSchoolString
22+
local strformat = _G.string.format
2123
local GetNamePlateForUnit = _G.C_NamePlate.GetNamePlateForUnit
2224
local UnitIsFriend = _G.UnitIsFriend
2325
local UnitCastingInfo = _G.UnitCastingInfo
@@ -545,7 +547,7 @@ local bit_band = _G.bit.band
545547
local playerInterrupts = namespace.playerInterrupts
546548

547549
function addon:COMBAT_LOG_EVENT_UNFILTERED()
548-
local _, eventType, _, _, _, srcFlags, _, dstGUID, _, dstFlags, _, _, spellName, _, missType = CombatLogGetCurrentEventInfo()
550+
local _, eventType, _, _, _, srcFlags, _, dstGUID, _, dstFlags, _, _, spellName, spellSchool, missType = CombatLogGetCurrentEventInfo()
549551
if eventType == "SPELL_MISSED" then
550552
if missType == "IMMUNE" and playerInterrupts[spellName] then
551553
if bit_band(dstFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) <= 0 then -- dest unit is not a player
@@ -588,6 +590,14 @@ function addon:COMBAT_LOG_EVENT_UNFILTERED()
588590
end
589591
end
590592
end
593+
elseif eventType == "SPELL_INTERRUPT" then
594+
for unitID, castbar in pairs(activeFrames) do -- have to scan for it due to race conditions with UNIT_SPELLCAST_*
595+
if castbar:GetAlpha() > 0 then
596+
if UnitGUID(unitID) == dstGUID then
597+
castbar.Text:SetText(strformat(_G.LOSS_OF_CONTROL_DISPLAY_INTERRUPT_SCHOOL, GetSchoolString(spellSchool)))
598+
end
599+
end
600+
end
591601
end
592602
end
593603

0 commit comments

Comments
 (0)