From 2c93dbc365bcdd6f21b8f1929192ef330f91a247 Mon Sep 17 00:00:00 2001 From: Parnic Date: Sun, 20 Dec 2015 16:11:23 -0600 Subject: [PATCH] Fixed lag indicator on cast bars set to 'reverse' Apparently setting the castbar to 'reverse' mode has never set the lag indicator in the correct place. Now we instruct SetBarCoord to behave differently for lag indicators. --- IceBarElement.lua | 9 +++++++-- modules/CastBar.lua | 10 +++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/IceBarElement.lua b/IceBarElement.lua index c664b43..235d396 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -1140,7 +1140,7 @@ function IceBarElement.prototype:Flip(side) end -- Rokiyo: bar is the only required argument, scale & top are optional -function IceBarElement.prototype:SetBarCoord(barFrame, scale, top) +function IceBarElement.prototype:SetBarCoord(barFrame, scale, top, overrideReverse) if not scale then scale = 0 end scale = IceHUD:Clamp(scale, 0, 1) @@ -1150,7 +1150,12 @@ function IceBarElement.prototype:SetBarCoord(barFrame, scale, top) local min_y, max_y local offset_y = 0 - if IceHUD:xor(self.moduleSettings.reverse, top) then + local reverse = self.moduleSettings.reverse + if overrideReverse then + reverse = false + end + + if IceHUD:xor(reverse, top) then if self.moduleSettings.inverse == "INVERSE" then min_y = 1 - scale max_y = 1 diff --git a/modules/CastBar.lua b/modules/CastBar.lua index bcd5829..29d8252 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -3,7 +3,6 @@ local CastBar = IceCore_CreateClass(IceCastBar) local IceHUD = _G.IceHUD -CastBar.prototype.lagBar = nil CastBar.prototype.spellCastSent = nil @@ -374,14 +373,13 @@ end function CastBar.prototype:CreateLagBar() self.lagBar = self:BarFactory(self.lagBar, "LOW","BACKGROUND") - self:SetBarCoord(self.lagBar, 0 , true) local r, g, b = self:GetColor("CastLag") if (self.settings.backgroundToggle) then r, g, b = self:GetColor("CastCasting") end - self.lagBar.bar:SetVertexColor(r, g, b, self.moduleSettings.lagAlpha) + self.lagBar.bar:SetVertexColor(r, g, b, self.moduleSettings.lagAlpha) self.lagBar.bar:Hide() end @@ -414,8 +412,7 @@ function CastBar.prototype:SpellCastStart(event, unit, spell, rank) scale = IceHUD:Clamp(lag / self.actionDuration, 0, 1) end - self.lagBar:SetFrameStrata("BACKGROUND") - self:SetBarCoord(self.lagBar, scale, true) + self:SetBarCoord(self.lagBar, scale, true, true) self.spellCastSent = nil end @@ -443,8 +440,7 @@ function CastBar.prototype:SpellCastChannelStart(event, unit) local top = not self.moduleSettings.reverseChannel - self.lagBar:SetFrameStrata("MEDIUM") - self:SetBarCoord(self.lagBar, scale, top) + self:SetBarCoord(self.lagBar, scale, top, true) self.spellCastSent = nil end