unitframes: hide invisible healthbars

This commit is contained in:
shagu
2017-07-29 16:00:23 +02:00
parent a68cff7150
commit 3da42e971c
+4
View File
@@ -65,6 +65,8 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.hp:SetPoint("TOP", 0, 0)
f.hp:SetWidth(f.config.width)
f.hp:SetHeight(f.config.height)
if tonumber(f.config.height) < 0 then f.hp:Hide() end
pfUI.api.CreateBackdrop(f.hp, default_border)
f.hp.bar = CreateFrame("StatusBar", nil, f.hp)
@@ -84,6 +86,8 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.power:SetPoint("TOP", f.hp, "BOTTOM", 0, -2*default_border - f.config.pspace)
f.power:SetWidth(f.config.width)
f.power:SetHeight(f.config.pheight)
if tonumber(f.config.pheight) < 0 then f.power:Hide() end
pfUI.api.CreateBackdrop(f.power, default_border)
f.power.bar = CreateFrame("StatusBar", nil, f.power)