
Originally Posted by
Chult
Again, when I type in any of the suggested LUA into Pitbull, the frames simply spits back out {err} in the text field. Not really sure how to fix it.
I'll take a look.
---------- Post added 2012-11-18 at 12:18 PM ----------
They're doing some wonky stuff (VeryShort actually returns a format string and a format argument instead of the formatted text).
This one's tested:
Code:
local r,g,b = ClassColor(unit)
return ("|cff%.02x%.02x%.02x%s|r"):format(r,g,b,string.format(VeryShort(HP(unit))))
---------- Post added 2012-11-18 at 12:21 PM ----------
Figured it out now. The second argument to VeryShort (and Short) indicates whether the returned string should be formatted.
These two work:
Code:
local r,g,b = ClassColor(unit)
return "|cff%.02x%.02x%.02x%s|r",r,g,b,VeryShort(HP(unit),true)
Code:
local t,r,g,b = select(2,UnitPowerType(unit))
if (not r) or (not g) or (not b) then
local c = PowerBarColor[t]
r,g,b = c.r, c.g, c.b
end
return "|cff%.02x%.02x%.02x%s|r", (r*255),(g*255),(b*255),Short(Power(unit),true)