diff --git a/IceCastBar.lua b/IceCastBar.lua index e9ef30d..8f36f1d 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -1,4 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") +local deformat = AceLibrary("Deformat-2.0") + +local SPELLINTERRUPTOTHERSELF = SPELLINTERRUPTOTHERSELF IceCastBar = AceOO.Class(IceBarElement) @@ -39,6 +42,10 @@ function IceCastBar.prototype:Enable(core) self:RegisterEvent("UNIT_SPELLCAST_FAILED", "SpellCastFailed") -- unit self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED", "SpellCastInterrupted") -- unit + + self:RegisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE", "CheckChatInterrupt") + self:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE", "CheckChatInterrupt") + self:RegisterEvent("UNIT_SPELLCAST_DELAYED", "SpellCastDelayed") -- unit self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", "SpellCastSucceeded") -- "player", spell, rank @@ -254,6 +261,16 @@ function IceCastBar.prototype:SpellCastFailed(unit) self:StartBar(IceCastBar.Actions.Failure, "Failed") end +function IceCastBar.prototype:CheckChatInterrupt(msg) + local player, spell = deformat(msg, SPELLINTERRUPTOTHERSELF) + --IceHUD:Debug("CheckChatInterrupt", msg) + + if player then + self.current = nil + self:StartBar(IceCastBar.Actions.Failure, "Interrupted") + end +end + function IceCastBar.prototype:SpellCastInterrupted(unit) if (unit ~= self.unit) then return end --IceHUD:Debug("SpellCastInterrupted", unit) diff --git a/IceHUD.toc b/IceHUD.toc index 5ef33a6..b4de5b5 100644 --- a/IceHUD.toc +++ b/IceHUD.toc @@ -1,12 +1,12 @@ ## Interface: 20300 -## Author: Iceroth +## Author: Iceroth, continued by Parnic ## Name: IceHUD ## Title: IceHUD |cff7fff7f -Ace2-|r ## Notes: Another HUD addon -## Version: 1.0 ($Revision$) +## Version: 1.1 ($Revision$) ## SavedVariables: IceCoreDB -## OptionalDeps: Ace2, GratuityLib, LibSharedMedia, WaterfallLib, MobHealth -## X-Embeds: Ace2, GratuityLib, LibSharedMedia, WaterfallLib +## OptionalDeps: Ace2, GratuityLib, LibSharedMedia, WaterfallLib, MobHealth, Deformat +## X-Embeds: Ace2, GratuityLib, LibSharedMedia, WaterfallLib, Deformat ## X-Category: UnitFrame ## X-Date: $Date$ ## X-Website: http://www.wowace.com/forums/index.php/topic,1705.0.html