- fixed the cast lag indicator, the incoming heal indicator, and aggro pull indicator to draw on the proper area of the bar when the bar is set to reverse direction

This commit is contained in:
Parnic
2010-04-17 22:22:42 +00:00
parent d6e3ae3cd9
commit aa930dc3a2
3 changed files with 70 additions and 45 deletions

View File

@ -392,15 +392,19 @@ function CastBar.prototype:CreateLagBar()
self.lagBar:SetFrameStrata("BACKGROUND") self.lagBar:SetFrameStrata("BACKGROUND")
self.lagBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) self.lagBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
self.lagBar:SetHeight(self.settings.barHeight) 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 if not (self.lagBar.bar) then
self.lagBar.bar = self.lagBar:CreateTexture(nil, "BACKGROUND") self.lagBar.bar = self.lagBar:CreateTexture(nil, "BACKGROUND")
end end
self.lagBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) self.lagBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
self.lagBar.bar:SetPoint("BOTTOMLEFT",self.lagBar,"BOTTOMLEFT") self.lagBar.bar:SetAllPoints(self.lagBar)
self.lagBar.bar:SetPoint("BOTTOMRIGHT",self.lagBar,"BOTTOMRIGHT")
local r, g, b = self:GetColor("CastLag") local r, g, b = self:GetColor("CastLag")
if (self.settings.backgroundToggle) then if (self.settings.backgroundToggle) then
@ -408,17 +412,12 @@ function CastBar.prototype:CreateLagBar()
end end
self.lagBar.bar:SetVertexColor(r, g, b, self.moduleSettings.lagAlpha) self.lagBar.bar:SetVertexColor(r, g, b, self.moduleSettings.lagAlpha)
if (self.moduleSettings.side == IceCore.Side.Left) then if (self.moduleSettings.side == IceCore.Side.Left) then
self.lagBar.bar:SetTexCoord(1, 0, 0, 0) self.lagBar.bar:SetTexCoord(1, 0, 0, 0)
else else
self.lagBar.bar:SetTexCoord(0, 1, 0, 0) self.lagBar.bar:SetTexCoord(0, 1, 0, 0)
end end
self.lagBar.bar:SetHeight(0)
self.lagBar.bar:Hide() self.lagBar.bar:Hide()
self.lagBar:ClearAllPoints()
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
end end
@ -448,12 +447,18 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank)
end end
local y = self.settings.barHeight - (pos * self.settings.barHeight) local y = self.settings.barHeight - (pos * self.settings.barHeight)
if (self.moduleSettings.side == IceCore.Side.Left) then local min_y = 0
self.lagBar.bar:SetTexCoord(1, 0, 0, pos) local max_y = pos
else if self.moduleSettings.reverse then
self.lagBar.bar:SetTexCoord(0, 1, 0, pos) min_y = 1-pos
max_y = 1
end
if (self.moduleSettings.side == IceCore.Side.Left) then
self.lagBar.bar:SetTexCoord(1, 0, min_y, max_y)
else
self.lagBar.bar:SetTexCoord(0, 1, min_y, max_y)
end end
self.lagBar.bar:SetHeight(self.settings.barHeight * pos)
if pos == 0 then if pos == 0 then
self.lagBar.bar:Hide() self.lagBar.bar:Hide()
@ -461,8 +466,7 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank)
self.lagBar.bar:Show() self.lagBar.bar:Show()
end end
self.lagBar:ClearAllPoints() self.lagBar:SetHeight(self.settings.barHeight * pos)
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y)
end end
@ -483,12 +487,18 @@ function CastBar.prototype:SpellCastChannelStart(unit)
end end
local y = self.settings.barHeight - (pos * self.settings.barHeight) local y = self.settings.barHeight - (pos * self.settings.barHeight)
if (self.moduleSettings.side == IceCore.Side.Left) then local min_y = 1-pos
self.lagBar.bar:SetTexCoord(1, 0, 1-pos, 1) local max_y = 1
else if self.moduleSettings.reverse then
self.lagBar.bar:SetTexCoord(0, 1, 1-pos, 1) min_y = 0
max_y = pos
end
if (self.moduleSettings.side == IceCore.Side.Left) then
self.lagBar.bar:SetTexCoord(1, 0, min_y, max_y)
else
self.lagBar.bar:SetTexCoord(0, 1, min_y, max_y)
end end
self.lagBar.bar:SetHeight(self.settings.barHeight * pos)
if pos == 0 then if pos == 0 then
self.lagBar.bar:Hide() self.lagBar.bar:Hide()
@ -496,7 +506,7 @@ function CastBar.prototype:SpellCastChannelStart(unit)
self.lagBar.bar:Show() self.lagBar.bar:Show()
end end
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0) self.lagBar:SetHeight(self.settings.barHeight * pos)
end end

View File

@ -758,26 +758,27 @@ function PlayerHealth.prototype:CreateHealBar()
self.healFrame:SetFrameStrata("LOW") self.healFrame:SetFrameStrata("LOW")
self.healFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) self.healFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
self.healFrame:SetHeight(self.settings.barHeight) self.healFrame:SetHeight(self.settings.barHeight)
self.healFrame:ClearAllPoints()
if self.moduleSettings.reverse then
self.healFrame:SetPoint("TOPLEFT", self.frame, "TOPLEFT")
else
self.healFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT")
end
if not self.healFrame.bar then if not self.healFrame.bar then
self.healFrame.bar = self.healFrame:CreateTexture(nil, "BACKGROUND") self.healFrame.bar = self.healFrame:CreateTexture(nil, "BACKGROUND")
end end
self.healFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) self.healFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
self.healFrame.bar:SetPoint("BOTTOMLEFT",self.frame,"BOTTOMLEFT") self.healFrame.bar:SetAllPoints(self.healFrame)
self.healFrame.bar:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT")
self.healFrame.bar:SetVertexColor(self:GetColor("PlayerHealthHealAmount", self.alpha * self.moduleSettings.healAlpha)) self.healFrame.bar:SetVertexColor(self:GetColor("PlayerHealthHealAmount", self.alpha * self.moduleSettings.healAlpha))
self.healFrame:ClearAllPoints()
self.healFrame:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
if (self.moduleSettings.side == IceCore.Side.Left) then if (self.moduleSettings.side == IceCore.Side.Left) then
self.healFrame.bar:SetTexCoord(1, 0, 0, 1) self.healFrame.bar:SetTexCoord(1, 0, 0, 1)
else else
self.healFrame.bar:SetTexCoord(0, 1, 0, 1) self.healFrame.bar:SetTexCoord(0, 1, 0, 1)
end end
self.healFrame.bar:SetHeight(0)
self:UpdateBar(1, "undef") self:UpdateBar(1, "undef")
@ -993,12 +994,19 @@ function PlayerHealth.prototype:Update(unit)
barValue = IceHUD:Clamp(barValue, 0, 1) barValue = IceHUD:Clamp(barValue, 0, 1)
percent = IceHUD:Clamp(percent, 0, 1) percent = IceHUD:Clamp(percent, 0, 1)
if (self.moduleSettings.side == IceCore.Side.Left) then local min_y = barValue
self.healFrame.bar:SetTexCoord(1, 0, barValue, 1) local max_y = 1
else if self.moduleSettings.reverse then
self.healFrame.bar:SetTexCoord(0, 1, barValue, 1) min_y = 0
max_y = 1-barValue
end end
self.healFrame.bar:SetHeight(self.settings.barHeight * percent)
if (self.moduleSettings.side == IceCore.Side.Left) then
self.healFrame.bar:SetTexCoord(1, 0, min_y, max_y)
else
self.healFrame.bar:SetTexCoord(0, 1, min_y, max_y)
end
self.healFrame:SetHeight(self.settings.barHeight * percent)
if percent == 0 then if percent == 0 then
self.healFrame.bar:Hide() self.healFrame.bar:Hide()

View File

@ -161,14 +161,19 @@ function IceThreat.prototype:CreateAggroBar()
self.aggroBar:SetFrameStrata("BACKGROUND") self.aggroBar:SetFrameStrata("BACKGROUND")
self.aggroBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) self.aggroBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
self.aggroBar:SetHeight(self.settings.barHeight) self.aggroBar:SetHeight(self.settings.barHeight)
self.aggroBar:ClearAllPoints()
if not self.moduleSettings.reverse then
self.aggroBar:SetPoint("TOPLEFT", self.frame, "TOPLEFT")
else
self.aggroBar:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT")
end
if not (self.aggroBar.bar) then if not (self.aggroBar.bar) then
self.aggroBar.bar = self.aggroBar:CreateTexture(nil, "LOW") self.aggroBar.bar = self.aggroBar:CreateTexture(nil, "LOW")
end end
self.aggroBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) self.aggroBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
self.aggroBar.bar:SetPoint("BOTTOMLEFT",self.aggroBar,"BOTTOMLEFT") self.aggroBar.bar:SetAllPoints(self.aggroBar)
self.aggroBar.bar:SetPoint("BOTTOMRIGHT",self.aggroBar,"BOTTOMRIGHT")
local r, g, b = self:GetColor("ThreatPullAggro") local r, g, b = self:GetColor("ThreatPullAggro")
if (self.settings.backgroundToggle) then if (self.settings.backgroundToggle) then
@ -181,10 +186,6 @@ function IceThreat.prototype:CreateAggroBar()
else else
self.aggroBar.bar:SetTexCoord(0, 1, 0, 0) self.aggroBar.bar:SetTexCoord(0, 1, 0, 0)
end end
self.aggroBar.bar:SetHeight(0)
self.aggroBar:ClearAllPoints()
self.aggroBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
end end
-- bar stuff -- bar stuff
@ -296,12 +297,18 @@ function IceThreat.prototype:Update(unit)
local pos = IceHUD:Clamp(1 - (1 / rangeMulti), 0, 1) local pos = IceHUD:Clamp(1 - (1 / rangeMulti), 0, 1)
local y = self.settings.barHeight - ( pos * self.settings.barHeight ) local y = self.settings.barHeight - ( pos * self.settings.barHeight )
if ( self.moduleSettings.side == IceCore.Side.Left ) then local min_y = 0
self.aggroBar.bar:SetTexCoord(1, 0, 0, pos) local max_y = pos
else if self.moduleSettings.reverse then
self.aggroBar.bar:SetTexCoord(0, 1, 0, pos) min_y = 1-pos
max_y = 1
end
if ( self.moduleSettings.side == IceCore.Side.Left ) then
self.aggroBar.bar:SetTexCoord(1, 0, min_y, max_y)
else
self.aggroBar.bar:SetTexCoord(0, 1, min_y, max_y)
end end
self.aggroBar.bar:SetHeight(self.settings.barHeight * pos)
if pos == 0 then if pos == 0 then
self.aggroBar.bar:Hide() self.aggroBar.bar:Hide()
@ -309,7 +316,7 @@ function IceThreat.prototype:Update(unit)
self.aggroBar.bar:Show() self.aggroBar.bar:Show()
end end
self.aggroBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y) self.aggroBar:SetHeight(self.settings.barHeight * pos)
end end
self:UpdateAlpha() self:UpdateAlpha()