mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
Fixed the MobHealth3 support I broke
This commit is contained in:
@ -98,7 +98,10 @@ function TargetHealth.prototype:Update(unit)
|
|||||||
self:SetBottomText1(self.healthPercentage)
|
self:SetBottomText1(self.healthPercentage)
|
||||||
|
|
||||||
|
|
||||||
if (self.moduleSettings.mobhealth and MobHealth3) then
|
-- assumption that if a unit's max health is 100, it's not actual amount
|
||||||
|
-- but rather a percentage - this obviously has one caveat though
|
||||||
|
|
||||||
|
if (self.maxHealth == 100 and self.moduleSettings.mobhealth and MobHealth3) then
|
||||||
self.health, self.maxHealth, _ = MobHealth3:GetUnitHealth(self.unit, self.health, self.maxHealth)
|
self.health, self.maxHealth, _ = MobHealth3:GetUnitHealth(self.unit, self.health, self.maxHealth)
|
||||||
|
|
||||||
self.health = self:Round(self.health)
|
self.health = self:Round(self.health)
|
||||||
@ -106,9 +109,6 @@ function TargetHealth.prototype:Update(unit)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- assumption that if a unit's max health is 100, it's not actual amount
|
|
||||||
-- but rather a percentage - this obviously has one caveat though
|
|
||||||
|
|
||||||
if (self.maxHealth ~= 100) then
|
if (self.maxHealth ~= 100) then
|
||||||
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
|
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
|
||||||
else
|
else
|
||||||
@ -124,6 +124,7 @@ function TargetHealth.prototype:Round(health)
|
|||||||
if (health > 1000) then
|
if (health > 1000) then
|
||||||
return self:MathRound(health/1000, 1) .. "k"
|
return self:MathRound(health/1000, 1) .. "k"
|
||||||
end
|
end
|
||||||
|
return health
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user