From 73470f7b34802567c2b9be2cd88dddf61a078421 Mon Sep 17 00:00:00 2001 From: iceroth Date: Thu, 13 Dec 2007 17:25:03 +0000 Subject: [PATCH] Fixed a problem with cast bar disappearing when seals activate during cast --- IceCastBar.lua | 26 ++++++++++++++++++++++---- modules/CastBar.lua | 4 ++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/IceCastBar.lua b/IceCastBar.lua index 733f33d..e9ef30d 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -10,6 +10,7 @@ IceCastBar.prototype.actionStartTime = nil IceCastBar.prototype.actionDuration = nil IceCastBar.prototype.actionMessage = nil IceCastBar.prototype.unit = nil +IceCastBar.prototype.current = nil -- Constructor -- @@ -207,22 +208,30 @@ function IceCastBar.prototype:SpellCastSent(unit, spell, rank, target) end -function IceCastBar.prototype:SpellCastStart(unit) +function IceCastBar.prototype:SpellCastStart(unit, spell, rank) if (unit ~= self.unit) then return end - --IceHUD:Debug("SpellCastStart", unit, UnitCastingInfo(unit)) + IceHUD:Debug("SpellCastStart", unit, spell, rank) + --UnitCastingInfo(unit) self:StartBar(IceCastBar.Actions.Cast) + self.current = spell end -function IceCastBar.prototype:SpellCastStop(unit) +function IceCastBar.prototype:SpellCastStop(unit, spell, rank) if (unit ~= self.unit) then return end - --IceHUD:Debug("SpellCastStop", unit) + --IceHUD:Debug("SpellCastStop", unit, spell, self.current) + + -- ignore if not coming from current spell + if (self.current and self.current ~= spell) then + return + end if (self.action ~= IceCastBar.Actions.Success and self.action ~= IceCastBar.Actions.Failure and self.action ~= IceCastBar.Actions.Channel) then self:StopBar() + self.current = nil end end @@ -231,6 +240,8 @@ function IceCastBar.prototype:SpellCastFailed(unit) if (unit ~= self.unit) then return end --IceHUD:Debug("SpellCastFailed", unit) + self.current = nil + -- determine if we want to show failed casts if (self.moduleSettings.flashFailures == "Never") then return @@ -247,6 +258,8 @@ function IceCastBar.prototype:SpellCastInterrupted(unit) if (unit ~= self.unit) then return end --IceHUD:Debug("SpellCastInterrupted", unit) + self.current = nil + self:StartBar(IceCastBar.Actions.Failure, "Interrupted") end @@ -272,6 +285,11 @@ function IceCastBar.prototype:SpellCastSucceeded(unit, spell, rank) if (self.action == IceCastBar.Actions.Channel) then return end + + -- ignore if not coming from current spell + if (self.current and self.current ~= spell) then + return + end -- show after normal successfull cast if (self.action == IceCastBar.Actions.Cast) then diff --git a/modules/CastBar.lua b/modules/CastBar.lua index d625123..50738e4 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -172,8 +172,8 @@ end -- OVERRIDE -function CastBar.prototype:SpellCastStart(unit) - CastBar.super.prototype.SpellCastStart(self, unit) +function CastBar.prototype:SpellCastStart(unit, spell, rank) + CastBar.super.prototype.SpellCastStart(self, unit, spell, rank) if (unit ~= self.unit) then return end local lag = GetTime() - self.spellCastSent