unitframes: fix invert healthbar values

This commit is contained in:
shagu
2017-09-19 22:08:25 +02:00
parent 86b6581201
commit a270bd4be1
+5
View File
@@ -304,6 +304,11 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
-- instant refresh on unit change (e.g. target)
this.cache.hp = UnitHealth(this.label .. this.id)
this.cache.hpmax = UnitHealthMax(this.label .. this.id)
if this.config.invert_healthbar == "1" then
this.cache.hp = this.cache.hpmax - this.cache.hp
end
this.cache.hpdisplay = this.cache.hp
this.hp.bar:SetMinMaxValues(0, this.cache.hpmax)
this.hp.bar:SetValue(this.cache.hp)