So I've just wasted the last few hours scouring the internet to find the LUA code so that I can color the text of my hunter pet based on its happiness using Pitbull. I used to have it as I stumbled across it somewhere but now I am unable to locate the information again. Is there a helpful person here who might be able to help work out the best way to do this?
https://vanilla-wow.fandom.com/wiki/API_GetPetHappiness says that "GetPetHappiness()" is probably what I want to use, with the values of 1, 2, and 3 correlating to unhappy, content, and happy.
This is the code that I use for my raid frame health text, and I'm hoping that my pet text will look the same, but colored based on happiness instead of class.Outline()
local r,g,b = ClassColor(unit)
return '|cff%02x%02x%02x%s%%',r,g,b,Percent(HP(unit),MaxH P(unit))
Would be very appreciative of help from a knowledgeable person (I am not skilled in this area).