mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- 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:
@ -392,15 +392,19 @@ function CastBar.prototype:CreateLagBar()
|
||||
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")
|
||||
end
|
||||
|
||||
self.lagBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
|
||||
self.lagBar.bar:SetPoint("BOTTOMLEFT",self.lagBar,"BOTTOMLEFT")
|
||||
self.lagBar.bar:SetPoint("BOTTOMRIGHT",self.lagBar,"BOTTOMRIGHT")
|
||||
self.lagBar.bar:SetAllPoints(self.lagBar)
|
||||
|
||||
local r, g, b = self:GetColor("CastLag")
|
||||
if (self.settings.backgroundToggle) then
|
||||
@ -408,17 +412,12 @@ function CastBar.prototype:CreateLagBar()
|
||||
end
|
||||
self.lagBar.bar:SetVertexColor(r, g, b, self.moduleSettings.lagAlpha)
|
||||
|
||||
|
||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||
self.lagBar.bar:SetTexCoord(1, 0, 0, 0)
|
||||
else
|
||||
self.lagBar.bar:SetTexCoord(0, 1, 0, 0)
|
||||
end
|
||||
self.lagBar.bar:SetHeight(0)
|
||||
self.lagBar.bar:Hide()
|
||||
|
||||
self.lagBar:ClearAllPoints()
|
||||
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
|
||||
end
|
||||
|
||||
|
||||
@ -448,12 +447,18 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank)
|
||||
end
|
||||
local y = self.settings.barHeight - (pos * self.settings.barHeight)
|
||||
|
||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||
self.lagBar.bar:SetTexCoord(1, 0, 0, pos)
|
||||
else
|
||||
self.lagBar.bar:SetTexCoord(0, 1, 0, pos)
|
||||
local min_y = 0
|
||||
local max_y = pos
|
||||
if self.moduleSettings.reverse then
|
||||
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
|
||||
self.lagBar.bar:SetHeight(self.settings.barHeight * pos)
|
||||
|
||||
if pos == 0 then
|
||||
self.lagBar.bar:Hide()
|
||||
@ -461,8 +466,7 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank)
|
||||
self.lagBar.bar:Show()
|
||||
end
|
||||
|
||||
self.lagBar:ClearAllPoints()
|
||||
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y)
|
||||
self.lagBar:SetHeight(self.settings.barHeight * pos)
|
||||
end
|
||||
|
||||
|
||||
@ -483,12 +487,18 @@ function CastBar.prototype:SpellCastChannelStart(unit)
|
||||
end
|
||||
local y = self.settings.barHeight - (pos * self.settings.barHeight)
|
||||
|
||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||
self.lagBar.bar:SetTexCoord(1, 0, 1-pos, 1)
|
||||
else
|
||||
self.lagBar.bar:SetTexCoord(0, 1, 1-pos, 1)
|
||||
local min_y = 1-pos
|
||||
local max_y = 1
|
||||
if self.moduleSettings.reverse then
|
||||
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
|
||||
self.lagBar.bar:SetHeight(self.settings.barHeight * pos)
|
||||
|
||||
if pos == 0 then
|
||||
self.lagBar.bar:Hide()
|
||||
@ -496,7 +506,7 @@ function CastBar.prototype:SpellCastChannelStart(unit)
|
||||
self.lagBar.bar:Show()
|
||||
end
|
||||
|
||||
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
|
||||
self.lagBar:SetHeight(self.settings.barHeight * pos)
|
||||
end
|
||||
|
||||
|
||||
|
@ -758,26 +758,27 @@ function PlayerHealth.prototype:CreateHealBar()
|
||||
self.healFrame:SetFrameStrata("LOW")
|
||||
self.healFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
|
||||
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
|
||||
self.healFrame.bar = self.healFrame:CreateTexture(nil, "BACKGROUND")
|
||||
end
|
||||
|
||||
self.healFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
|
||||
self.healFrame.bar:SetPoint("BOTTOMLEFT",self.frame,"BOTTOMLEFT")
|
||||
self.healFrame.bar:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT")
|
||||
self.healFrame.bar:SetAllPoints(self.healFrame)
|
||||
|
||||
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
|
||||
self.healFrame.bar:SetTexCoord(1, 0, 0, 1)
|
||||
else
|
||||
self.healFrame.bar:SetTexCoord(0, 1, 0, 1)
|
||||
end
|
||||
self.healFrame.bar:SetHeight(0)
|
||||
|
||||
self:UpdateBar(1, "undef")
|
||||
|
||||
@ -993,12 +994,19 @@ function PlayerHealth.prototype:Update(unit)
|
||||
barValue = IceHUD:Clamp(barValue, 0, 1)
|
||||
percent = IceHUD:Clamp(percent, 0, 1)
|
||||
|
||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||
self.healFrame.bar:SetTexCoord(1, 0, barValue, 1)
|
||||
else
|
||||
self.healFrame.bar:SetTexCoord(0, 1, barValue, 1)
|
||||
local min_y = barValue
|
||||
local max_y = 1
|
||||
if self.moduleSettings.reverse then
|
||||
min_y = 0
|
||||
max_y = 1-barValue
|
||||
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
|
||||
self.healFrame.bar:Hide()
|
||||
|
@ -161,14 +161,19 @@ function IceThreat.prototype:CreateAggroBar()
|
||||
self.aggroBar:SetFrameStrata("BACKGROUND")
|
||||
self.aggroBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
|
||||
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
|
||||
self.aggroBar.bar = self.aggroBar:CreateTexture(nil, "LOW")
|
||||
end
|
||||
|
||||
self.aggroBar.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
|
||||
self.aggroBar.bar:SetPoint("BOTTOMLEFT",self.aggroBar,"BOTTOMLEFT")
|
||||
self.aggroBar.bar:SetPoint("BOTTOMRIGHT",self.aggroBar,"BOTTOMRIGHT")
|
||||
self.aggroBar.bar:SetAllPoints(self.aggroBar)
|
||||
|
||||
local r, g, b = self:GetColor("ThreatPullAggro")
|
||||
if (self.settings.backgroundToggle) then
|
||||
@ -181,10 +186,6 @@ function IceThreat.prototype:CreateAggroBar()
|
||||
else
|
||||
self.aggroBar.bar:SetTexCoord(0, 1, 0, 0)
|
||||
end
|
||||
self.aggroBar.bar:SetHeight(0)
|
||||
|
||||
self.aggroBar:ClearAllPoints()
|
||||
self.aggroBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
|
||||
end
|
||||
|
||||
-- bar stuff
|
||||
@ -296,12 +297,18 @@ function IceThreat.prototype:Update(unit)
|
||||
local pos = IceHUD:Clamp(1 - (1 / rangeMulti), 0, 1)
|
||||
local y = self.settings.barHeight - ( pos * self.settings.barHeight )
|
||||
|
||||
if ( self.moduleSettings.side == IceCore.Side.Left ) then
|
||||
self.aggroBar.bar:SetTexCoord(1, 0, 0, pos)
|
||||
else
|
||||
self.aggroBar.bar:SetTexCoord(0, 1, 0, pos)
|
||||
local min_y = 0
|
||||
local max_y = pos
|
||||
if self.moduleSettings.reverse then
|
||||
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
|
||||
self.aggroBar.bar:SetHeight(self.settings.barHeight * pos)
|
||||
|
||||
if pos == 0 then
|
||||
self.aggroBar.bar:Hide()
|
||||
@ -309,7 +316,7 @@ function IceThreat.prototype:Update(unit)
|
||||
self.aggroBar.bar:Show()
|
||||
end
|
||||
|
||||
self.aggroBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y)
|
||||
self.aggroBar:SetHeight(self.settings.barHeight * pos)
|
||||
end
|
||||
|
||||
self:UpdateAlpha()
|
||||
|
Reference in New Issue
Block a user