- forgot to fix channeling's lag bar to behave properly with all the new combinations of inverting/reversing

This commit is contained in:
Parnic
2010-07-20 02:12:37 +00:00
parent 9d174f453c
commit c6dbacc5fa

View File

@ -483,25 +483,30 @@ function CastBar.prototype:SpellCastChannelStart(unit)
return return
end end
local lagTop = not xor(self.moduleSettings.reverse, self.moduleSettings.inverse)
if self.moduleSettings.reverseChannel then
lagTop = not lagTop
end
self.lagBar:SetFrameStrata("MEDIUM") self.lagBar:SetFrameStrata("MEDIUM")
self.lagBar:ClearAllPoints() self.lagBar:ClearAllPoints()
if self.moduleSettings.reverse then if lagTop then
self.lagBar:SetPoint("TOPLEFT", self.frame, "TOPLEFT") self.lagBar:SetPoint("TOPLEFT", self.frame, "TOPLEFT")
else else
self.lagBar:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT") self.lagBar:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT")
end end
local lag = GetTime() - (self.spellCastSent or 0) local lag = GetTime() - (self.spellCastSent or 0)
local pos = IceHUD:Clamp(lag / self.actionDuration, 0, 1) local pos = IceHUD:Clamp(lag / self.actionDuration, 0, 1)
if self.unit == "vehicle" then if self.unit == "vehicle" then
pos = 0 pos = 0
end end
local y = self.settings.barHeight - (pos * self.settings.barHeight) local y = self.settings.barHeight - (pos * self.settings.barHeight)
local min_y = 1-pos local min_y = 1-pos
local max_y = 1 local max_y = 1
if self.moduleSettings.reverse then if lagTop then
min_y = 0 min_y = 0
max_y = pos max_y = pos
end end
@ -511,7 +516,7 @@ function CastBar.prototype:SpellCastChannelStart(unit)
else else
self.lagBar.bar:SetTexCoord(0, 1, min_y, max_y) self.lagBar.bar:SetTexCoord(0, 1, min_y, max_y)
end end
if pos == 0 then if pos == 0 then
self.lagBar.bar:Hide() self.lagBar.bar:Hide()
else else