When resting, PlayerHealth absolute value goes white

This commit is contained in:
iceroth
2006-12-21 14:39:06 +00:00
parent 9e8f57c666
commit b3faefe12a
2 changed files with 19 additions and 5 deletions

View File

@ -3,9 +3,9 @@
## Name: IceHUD
## Title: IceHUD |cff7fff7f -Ace2-|r
## Notes: Another HUD addon
## Version: 0.8.4 ($Revision$)
## Version: 0.8.5 ($Revision$)
## SavedVariables: IceCoreDB
## OptionalDeps: Ace2, DewdropLib, DruidBar, SoleManax, MobHealth
## OptionalDeps: Ace2, DewdropLib, DruidBar, MobHealth
## X-Embeds: Ace2, DewdropLib
## X-Category: UnitFrame
## X-Date: $Date$

View File

@ -2,6 +2,8 @@ local AceOO = AceLibrary("AceOO-2.0")
local PlayerHealth = AceOO.Class(IceUnitBar)
PlayerHealth.prototype.resting = nil
-- Constructor --
function PlayerHealth.prototype:init()
PlayerHealth.super.prototype.init(self, "PlayerHealth", "player")
@ -24,12 +26,14 @@ function PlayerHealth.prototype:Enable(core)
self:RegisterEvent("UNIT_HEALTH", "Update")
self:RegisterEvent("UNIT_MAXHEALTH", "Update")
self:RegisterEvent("PLAYER_UPDATE_RESTING", "Resting")
if (self.moduleSettings.hideBlizz) then
self:HideBlizz()
end
self:Update(self.unit)
self:Resting()
--self:Update(self.unit)
end
@ -79,6 +83,12 @@ function PlayerHealth.prototype:GetOptions()
end
function PlayerHealth.prototype:Resting()
self.resting = IsResting()
self:Update(self.unit)
end
function PlayerHealth.prototype:Update(unit)
PlayerHealth.super.prototype.Update(self)
if (unit and (unit ~= self.unit)) then
@ -95,10 +105,14 @@ function PlayerHealth.prototype:Update(unit)
color = "Dead"
end
local textColor = color
if (self.resting) then
textColor = "Text"
end
self:UpdateBar(self.health/self.maxHealth, color)
self:SetBottomText1(self.healthPercentage)
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), color)
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), textColor)
end