mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-15 14:20:13 -05:00
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:
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user