- bump toc

- added the ability to scale most health/power bars by the amount they're filled up with a customizable max/min color (health can go green to red, for example)
- updated from SharedMedia-1.0 to LibSharedMedia-2.0
This commit is contained in:
Parnic
2008-01-19 01:26:18 +00:00
parent 73470f7b34
commit ced858b06a
9 changed files with 193 additions and 8 deletions

View File

@ -93,6 +93,10 @@ function PetHealth.prototype:Update(unit)
elseif(self.happiness == 1) then
color = "PetHealthUnhappy"
end
if (self.moduleSettings.scaleColor) then
color = "ScaledHealthColor"
end
if not (self.alive) then
color = "Dead"
@ -104,6 +108,31 @@ function PetHealth.prototype:Update(unit)
end
-- OVERRIDE
function PetHealth.prototype:GetOptions()
local opts = PetHealth.super.prototype.GetOptions(self)
opts["scaleHealthColor"] = {
type = "toggle",
name = "Color bar by health %",
desc = "Colors the health bar from MaxHealthColor to MinHealthColor based on current health %",
get = function()
return self.moduleSettings.scaleHealthColor
end,
set = function(value)
self.moduleSettings.scaleHealthColor = value
self:Redraw()
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 41
}
return opts
end
-- Load us up
IceHUD.PetHealth = PetHealth:new()