From 8051d0314b4e27b8898ad56fb3fd0c01b5c6d9f5 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 23 Dec 2017 21:30:48 +0100 Subject: [PATCH] unitframes: update pets healthcolor text --- api/unitframes.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index cc4c29a6..043f2242 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1493,10 +1493,18 @@ function pfUI.uf.GetColor(self, preset) if RAID_CLASS_COLORS[class] then r, g, b = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b end - else - if UnitReactionColor[UnitReaction(unitstr, "player")] then - r, g, b = UnitReactionColor[UnitReaction(unitstr, "player")].r, UnitReactionColor[UnitReaction(unitstr, "player")].g, UnitReactionColor[UnitReaction(unitstr, "player")].b + elseif self.label == "pet" then + local happiness = GetPetHappiness() + if happiness == 1 then + r, g, b = 1, 0, 0 + elseif happiness == 2 then + r, g, b = 1, 1, 0 + else + r, g, b = 0, 1, 0 end + else + local color = UnitReactionColor[UnitReaction(unitstr, "player")] + r, g, b = color.r, color.g, color.b end elseif preset == "class" and config["classcolor"] == "1" then