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.
This commit is contained in:
Parnic
2015-12-20 16:11:23 -06:00
parent e7717731cb
commit 2c93dbc365
2 changed files with 10 additions and 9 deletions

View File

@ -1140,7 +1140,7 @@ function IceBarElement.prototype:Flip(side)
end end
-- Rokiyo: bar is the only required argument, scale & top are optional -- 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 if not scale then scale = 0 end
scale = IceHUD:Clamp(scale, 0, 1) scale = IceHUD:Clamp(scale, 0, 1)
@ -1150,7 +1150,12 @@ function IceBarElement.prototype:SetBarCoord(barFrame, scale, top)
local min_y, max_y local min_y, max_y
local offset_y = 0 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 if self.moduleSettings.inverse == "INVERSE" then
min_y = 1 - scale min_y = 1 - scale
max_y = 1 max_y = 1

View File

@ -3,7 +3,6 @@ local CastBar = IceCore_CreateClass(IceCastBar)
local IceHUD = _G.IceHUD local IceHUD = _G.IceHUD
CastBar.prototype.lagBar = nil
CastBar.prototype.spellCastSent = nil CastBar.prototype.spellCastSent = nil
@ -374,14 +373,13 @@ end
function CastBar.prototype:CreateLagBar() function CastBar.prototype:CreateLagBar()
self.lagBar = self:BarFactory(self.lagBar, "LOW","BACKGROUND") self.lagBar = self:BarFactory(self.lagBar, "LOW","BACKGROUND")
self:SetBarCoord(self.lagBar, 0 , true)
local r, g, b = self:GetColor("CastLag") local r, g, b = self:GetColor("CastLag")
if (self.settings.backgroundToggle) then if (self.settings.backgroundToggle) then
r, g, b = self:GetColor("CastCasting") r, g, b = self:GetColor("CastCasting")
end 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() self.lagBar.bar:Hide()
end end
@ -414,8 +412,7 @@ function CastBar.prototype:SpellCastStart(event, unit, spell, rank)
scale = IceHUD:Clamp(lag / self.actionDuration, 0, 1) scale = IceHUD:Clamp(lag / self.actionDuration, 0, 1)
end end
self.lagBar:SetFrameStrata("BACKGROUND") self:SetBarCoord(self.lagBar, scale, true, true)
self:SetBarCoord(self.lagBar, scale, true)
self.spellCastSent = nil self.spellCastSent = nil
end end
@ -443,8 +440,7 @@ function CastBar.prototype:SpellCastChannelStart(event, unit)
local top = not self.moduleSettings.reverseChannel local top = not self.moduleSettings.reverseChannel
self.lagBar:SetFrameStrata("MEDIUM") self:SetBarCoord(self.lagBar, scale, top, true)
self:SetBarCoord(self.lagBar, scale, top)
self.spellCastSent = nil self.spellCastSent = nil
end end