targettarget: fix nil color error

This commit is contained in:
shagu
2016-07-24 17:24:10 +02:00
parent 433c18d7e9
commit b70545d03a
+5 -4
View File
@@ -53,10 +53,11 @@ pfUI:RegisterModule("targettarget", function ()
pfUI.uf.targettarget.hp.bar:SetMinMaxValues(0, UnitHealthMax("targettarget"))
local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5
pfUI.uf.targettarget.hp.bar:SetStatusBarColor(r, g, b, UnitHealth("targettarget") / UnitHealthMax("targettarget") / 4 + .75)
pfUI.uf.targettarget.hp.text:SetTextColor(r+.3,g+.3,b+.3, 1)
if color then
local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5
pfUI.uf.targettarget.hp.bar:SetStatusBarColor(r, g, b, UnitHealth("targettarget") / UnitHealthMax("targettarget") / 4 + .75)
pfUI.uf.targettarget.hp.text:SetTextColor(r+.3,g+.3,b+.3, 1)
end
pfUI.uf.targettarget.hp.text:SetText( UnitName("targettarget"))
local display, real