diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 6125e95..8026b5d 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -389,15 +389,8 @@ function CastBar.prototype:CreateLagBar() self.lagBar = CreateFrame("Frame", nil, self.frame) end - self.lagBar:SetFrameStrata("BACKGROUND") self.lagBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) self.lagBar:SetHeight(self.settings.barHeight) - self.lagBar:ClearAllPoints() - if not self.moduleSettings.reverse then - self.lagBar:SetPoint("TOPLEFT", self.frame, "TOPLEFT") - else - self.lagBar:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT") - end if not (self.lagBar.bar) then self.lagBar.bar = self.lagBar:CreateTexture(nil, "BACKGROUND") @@ -438,6 +431,14 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank) if not self:IsVisible() or not self.actionDuration then return end + + self.lagBar:SetFrameStrata("BACKGROUND") + self.lagBar:ClearAllPoints() + if not self.moduleSettings.reverse then + self.lagBar:SetPoint("TOPLEFT", self.frame, "TOPLEFT") + else + self.lagBar:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT") + end local lag = GetTime() - (self.spellCastSent or 0) @@ -479,6 +480,14 @@ function CastBar.prototype:SpellCastChannelStart(unit) return end + self.lagBar:SetFrameStrata("MEDIUM") + self.lagBar:ClearAllPoints() + if self.moduleSettings.reverse then + self.lagBar:SetPoint("TOPLEFT", self.frame, "TOPLEFT") + else + self.lagBar:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT") + end + local lag = GetTime() - (self.spellCastSent or 0) local pos = IceHUD:Clamp(lag / self.actionDuration, 0, 1)