mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
Fixed castbar lag indicator covering the whole bar sometimes
This commit is contained in:
@ -446,7 +446,11 @@ function CastBar.prototype:SpellCastStart(event, unit, castGuid, spellId)
|
|||||||
else
|
else
|
||||||
local now = GetTime()
|
local now = GetTime()
|
||||||
local lag = now - (self.spellCastSent or now)
|
local lag = now - (self.spellCastSent or now)
|
||||||
scale = IceHUD:Clamp(lag / self.actionDuration, 0, 1)
|
if lag >= self.actionDuration then
|
||||||
|
scale = 0
|
||||||
|
else
|
||||||
|
scale = IceHUD:Clamp(lag / self.actionDuration, 0, 1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self:SetBarCoord(self.lagBar, scale, true, true)
|
self:SetBarCoord(self.lagBar, scale, true, true)
|
||||||
@ -472,11 +476,14 @@ function CastBar.prototype:SpellCastChannelStart(event, unit)
|
|||||||
else
|
else
|
||||||
local now = GetTime()
|
local now = GetTime()
|
||||||
local lag = now - (self.spellCastSent or now)
|
local lag = now - (self.spellCastSent or now)
|
||||||
scale = IceHUD:Clamp(lag / self.actionDuration, 0, 1)
|
if lag >= self.actionDuration then
|
||||||
|
scale = 0
|
||||||
|
else
|
||||||
|
scale = IceHUD:Clamp(lag / self.actionDuration, 0, 1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local top = not self.moduleSettings.reverseChannel
|
local top = not self.moduleSettings.reverseChannel
|
||||||
|
|
||||||
self:SetBarCoord(self.lagBar, scale, top, true)
|
self:SetBarCoord(self.lagBar, scale, top, true)
|
||||||
|
|
||||||
self.spellCastSent = nil
|
self.spellCastSent = nil
|
||||||
|
Reference in New Issue
Block a user