Fixed a problem with cast bar disappearing when seals activate during cast

This commit is contained in:
iceroth
2007-12-13 17:25:03 +00:00
parent 18d6b63a4a
commit 73470f7b34
2 changed files with 24 additions and 6 deletions

View File

@ -10,6 +10,7 @@ IceCastBar.prototype.actionStartTime = nil
IceCastBar.prototype.actionDuration = nil IceCastBar.prototype.actionDuration = nil
IceCastBar.prototype.actionMessage = nil IceCastBar.prototype.actionMessage = nil
IceCastBar.prototype.unit = nil IceCastBar.prototype.unit = nil
IceCastBar.prototype.current = nil
-- Constructor -- -- Constructor --
@ -207,22 +208,30 @@ function IceCastBar.prototype:SpellCastSent(unit, spell, rank, target)
end end
function IceCastBar.prototype:SpellCastStart(unit) function IceCastBar.prototype:SpellCastStart(unit, spell, rank)
if (unit ~= self.unit) then return end 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:StartBar(IceCastBar.Actions.Cast)
self.current = spell
end end
function IceCastBar.prototype:SpellCastStop(unit) function IceCastBar.prototype:SpellCastStop(unit, spell, rank)
if (unit ~= self.unit) then return end 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 if (self.action ~= IceCastBar.Actions.Success and
self.action ~= IceCastBar.Actions.Failure and self.action ~= IceCastBar.Actions.Failure and
self.action ~= IceCastBar.Actions.Channel) self.action ~= IceCastBar.Actions.Channel)
then then
self:StopBar() self:StopBar()
self.current = nil
end end
end end
@ -231,6 +240,8 @@ function IceCastBar.prototype:SpellCastFailed(unit)
if (unit ~= self.unit) then return end if (unit ~= self.unit) then return end
--IceHUD:Debug("SpellCastFailed", unit) --IceHUD:Debug("SpellCastFailed", unit)
self.current = nil
-- determine if we want to show failed casts -- determine if we want to show failed casts
if (self.moduleSettings.flashFailures == "Never") then if (self.moduleSettings.flashFailures == "Never") then
return return
@ -247,6 +258,8 @@ function IceCastBar.prototype:SpellCastInterrupted(unit)
if (unit ~= self.unit) then return end if (unit ~= self.unit) then return end
--IceHUD:Debug("SpellCastInterrupted", unit) --IceHUD:Debug("SpellCastInterrupted", unit)
self.current = nil
self:StartBar(IceCastBar.Actions.Failure, "Interrupted") self:StartBar(IceCastBar.Actions.Failure, "Interrupted")
end end
@ -273,6 +286,11 @@ function IceCastBar.prototype:SpellCastSucceeded(unit, spell, rank)
return return
end end
-- ignore if not coming from current spell
if (self.current and self.current ~= spell) then
return
end
-- show after normal successfull cast -- show after normal successfull cast
if (self.action == IceCastBar.Actions.Cast) then if (self.action == IceCastBar.Actions.Cast) then
self:StartBar(IceCastBar.Actions.Success, spell.. self:GetShortRank(rank)) self:StartBar(IceCastBar.Actions.Success, spell.. self:GetShortRank(rank))

View File

@ -172,8 +172,8 @@ end
-- OVERRIDE -- OVERRIDE
function CastBar.prototype:SpellCastStart(unit) function CastBar.prototype:SpellCastStart(unit, spell, rank)
CastBar.super.prototype.SpellCastStart(self, unit) CastBar.super.prototype.SpellCastStart(self, unit, spell, rank)
if (unit ~= self.unit) then return end if (unit ~= self.unit) then return end
local lag = GetTime() - self.spellCastSent local lag = GetTime() - self.spellCastSent