Both of these work, but I'd like to combine them all into one.
First one changes class colour text:
local r,g,b = ClassColor(unit)
return '|cff%02x%02x%02x%s|r %s%s%s',r,g,b,Name(unit),Angle(AFK(unit) or DND(unit))
Second one shortens long names into an abbreviated form on healthbars:
local abbr = Name(unit)
if abbr:len() > 20 and abbr:find(" ") then
abbr = abbr:gsub("([^ ]+) +",
function(text)
return text:sub(1,1) .. ". "
end)
end
return "%s", abbr;
How can I combine these, so that both functions work as one entry? If it helps, I'm using pitbull.