mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- 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:
@ -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()
|
||||
|
Reference in New Issue
Block a user