- added some code to hide a bar if its height would have been set to 0. not sure why, but GlowArc and HiBar are having issues with zero-height bars, so this seems to fix it without needing to figure out what's up with the texture

This commit is contained in:
Parnic
2010-03-25 19:55:29 +00:00
parent fbdfbcd77f
commit aeb3ed2026
5 changed files with 37 additions and 0 deletions

View File

@ -786,6 +786,12 @@ function IceBarElement.prototype:SetScale(texture, scale)
texture:SetTexCoord(0, 1, min_y, max_y)
end
self.barFrame.bar:SetHeight(self.settings.barHeight * self.CurrScale)
if self.CurrScale == 0 then
self.barFrame.bar:Hide()
else
self.barFrame.bar:Show()
end
end
end

View File

@ -415,6 +415,7 @@ function CastBar.prototype:CreateLagBar()
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)
@ -453,6 +454,12 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank)
self.lagBar.bar:SetTexCoord(0, 1, 0, pos)
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)
@ -483,6 +490,12 @@ function CastBar.prototype:SpellCastChannelStart(unit)
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:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
end

View File

@ -991,6 +991,12 @@ function PlayerHealth.prototype:Update(unit)
self.healFrame.bar:SetTexCoord(0, 1, barValue, 1)
end
self.healFrame.bar:SetHeight(self.settings.barHeight * percent)
if percent == 0 then
self.healFrame.bar:Hide()
else
self.healFrame.bar:Show()
end
end
if not IceHUD.IceCore:ShouldUseDogTags() then

View File

@ -289,6 +289,12 @@ function SliceAndDice.prototype:UpdateDurationBar(unit)
self.durationFrame.bar:SetTexCoord(0, 1, 1-scale, 1)
end
self.durationFrame.bar:SetHeight(self.settings.barHeight * scale)
if scale == 0 then
self.durationFrame.bar:Hide()
else
self.durationFrame.bar:Show()
end
if sndEndTime < GetTime() then
self:SetBottomText1(self.moduleSettings.upperText .. "0 (" .. PotentialSnDDuration .. ")")

View File

@ -302,6 +302,12 @@ function IceThreat.prototype:Update(unit)
self.aggroBar.bar:SetTexCoord(0, 1, 0, pos)
end
self.aggroBar.bar:SetHeight(self.settings.barHeight * pos)
if pos == 0 then
self.aggroBar.bar:Hide()
else
self.aggroBar.bar:Show()
end
self.aggroBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, y)
end