diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 91ee14a..6125e95 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -392,33 +392,32 @@ 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 r, g, b = self:GetColor("CastCasting") 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 @@ -447,22 +446,27 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank) pos = 0 end local y = self.settings.barHeight - (pos * self.settings.barHeight) + + 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, 0, pos) + self.lagBar.bar:SetTexCoord(1, 0, min_y, max_y) else - self.lagBar.bar:SetTexCoord(0, 1, 0, pos) + 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() else 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 @@ -482,13 +486,19 @@ function CastBar.prototype:SpellCastChannelStart(unit) pos = 0 end local y = self.settings.barHeight - (pos * self.settings.barHeight) + + 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, 1-pos, 1) + self.lagBar.bar:SetTexCoord(1, 0, min_y, max_y) else - self.lagBar.bar:SetTexCoord(0, 1, 1-pos, 1) + 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 diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua index 483c7e2..7c8c81d 100644 --- a/modules/PlayerHealth.lua +++ b/modules/PlayerHealth.lua @@ -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") @@ -992,13 +993,20 @@ function PlayerHealth.prototype:Update(unit) barValue = IceHUD:Clamp(barValue, 0, 1) percent = IceHUD:Clamp(percent, 0, 1) + + local min_y = barValue + local max_y = 1 + if self.moduleSettings.reverse then + min_y = 0 + max_y = 1-barValue + end if (self.moduleSettings.side == IceCore.Side.Left) then - self.healFrame.bar:SetTexCoord(1, 0, barValue, 1) + self.healFrame.bar:SetTexCoord(1, 0, min_y, max_y) else - self.healFrame.bar:SetTexCoord(0, 1, barValue, 1) + self.healFrame.bar:SetTexCoord(0, 1, min_y, max_y) end - self.healFrame.bar:SetHeight(self.settings.barHeight * percent) + self.healFrame:SetHeight(self.settings.barHeight * percent) if percent == 0 then self.healFrame.bar:Hide() diff --git a/modules/Threat.lua b/modules/Threat.lua index 4851757..71793cb 100644 --- a/modules/Threat.lua +++ b/modules/Threat.lua @@ -161,30 +161,31 @@ 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 r, g, b = self:GetColor("CastCasting") end self.aggroBar.bar:SetVertexColor(r, g, b, self.moduleSettings.aggroAlpha) - + if (self.moduleSettings.side == IceCore.Side.Left) then self.aggroBar.bar:SetTexCoord(1, 0, 0, 0) 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 @@ -295,13 +296,19 @@ function IceThreat.prototype:Update(unit) local pos = IceHUD:Clamp(1 - (1 / rangeMulti), 0, 1) local y = self.settings.barHeight - ( pos * self.settings.barHeight ) + + 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, 0, pos) + self.aggroBar.bar:SetTexCoord(1, 0, min_y, max_y) else - self.aggroBar.bar:SetTexCoord(0, 1, 0, pos) + 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()