From c3474db1fafc217a28435b7e3f17fa7fb8d2e1c9 Mon Sep 17 00:00:00 2001 From: Parnic Date: Thu, 28 Oct 2010 00:32:34 +0000 Subject: [PATCH] - fixed the target cast bar to not freeze up and reset itself whenever a UNIT_SPELLCAST_INTERRUPTIBLE / UNIT_SPELLCAST_NOT_INTERRUPTIBLE event fires --- modules/TargetCast.lua | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/modules/TargetCast.lua b/modules/TargetCast.lua index ff1d31a..0d904ba 100644 --- a/modules/TargetCast.lua +++ b/modules/TargetCast.lua @@ -20,21 +20,36 @@ function TargetCast.prototype:Enable(core) end -function TargetCast.prototype:SpellCastInterruptible() +function TargetCast.prototype:SpellCastInterruptible(event, unit) + if unit and unit ~= self.unit then + return + end + self.notInterruptible = false - self:Redraw() + self:UpdateInterruptibleColor() end -function TargetCast.prototype:SpellCastNotInterruptible() +function TargetCast.prototype:SpellCastNotInterruptible(event, unit) + if unit and unit ~= self.unit then + return + end + self.notInterruptible = true - self:Redraw() + self:UpdateInterruptibleColor() end function TargetCast.prototype:UpdateBar(scale, color, alpha) TargetCast.super.prototype.UpdateBar(self, scale, color, alpha) + self:UpdateInterruptibleColor() +end - if self.moduleSettings.displayNonInterruptible and self.notInterruptible then - self.barFrame.bar:SetVertexColor(self:GetColor("CastNotInterruptible")) +function TargetCast.prototype:UpdateInterruptibleColor() + if self.moduleSettings.displayNonInterruptible then + if self.notInterruptible then + self.barFrame.bar:SetVertexColor(self:GetColor("CastNotInterruptible")) + else + self.barFrame.bar:SetVertexColor(self:GetColor(self:GetCurrentCastingColor())) + end end end