- fixed a bug with showing the "spellcast failed" flash on the player's castbar if the player tried to activate a trinket/cast another spell while casting a different one

This commit is contained in:
Parnic
2008-10-29 02:55:51 +00:00
parent 49a590e879
commit eaa7b73b85

View File

@ -38,21 +38,21 @@ function IceCastBar.prototype:Enable(core)
IceCastBar.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_SPELLCAST_SENT", "SpellCastSent") -- "player", spell, rank, target
self:RegisterEvent("UNIT_SPELLCAST_START", "SpellCastStart") -- unit
self:RegisterEvent("UNIT_SPELLCAST_STOP", "SpellCastStop") -- unit
self:RegisterEvent("UNIT_SPELLCAST_START", "SpellCastStart") -- unit, spell, rank
self:RegisterEvent("UNIT_SPELLCAST_STOP", "SpellCastStop") -- unit, spell, rank
self:RegisterEvent("UNIT_SPELLCAST_FAILED", "SpellCastFailed") -- unit
self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED", "SpellCastInterrupted") -- unit
self:RegisterEvent("UNIT_SPELLCAST_FAILED", "SpellCastFailed") -- unit, spell, rank
self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED", "SpellCastInterrupted") -- unit, spell, rank
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_DELAYED", "SpellCastDelayed") -- unit, spell, rank
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", "SpellCastSucceeded") -- "player", spell, rank
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START", "SpellCastChannelStart") -- unit
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE", "SpellCastChannelUpdate") -- unit
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", "SpellCastChannelStop") -- unit
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START", "SpellCastChannelStart") -- unit, spell, rank
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE", "SpellCastChannelUpdate") -- unit, spell, rank
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", "SpellCastChannelStop") -- unit, spell, rank
self:Show(false)
end
@ -245,10 +245,15 @@ function IceCastBar.prototype:SpellCastStop(unit, spell, rank)
end
function IceCastBar.prototype:SpellCastFailed(unit)
function IceCastBar.prototype:SpellCastFailed(unit, spell, rank)
if (unit ~= self.unit) then return end
IceHUD:Debug("SpellCastFailed", unit, self.current)
-- ignore if not coming from current spell
if (self.current and spell and self.current ~= spell) then
return
end
self.current = nil
-- determine if we want to show failed casts
@ -277,10 +282,15 @@ function IceCastBar.prototype:CheckChatInterrupt(msg)
end
end
function IceCastBar.prototype:SpellCastInterrupted(unit)
function IceCastBar.prototype:SpellCastInterrupted(unit, spell, rank)
if (unit ~= self.unit) then return end
IceHUD:Debug("SpellCastInterrupted", unit, self.current)
-- ignore if not coming from current spell
if (self.current and spell and self.current ~= spell) then
return
end
self.current = nil
self:StartBar(IceCastBar.Actions.Failure, "Interrupted")