View Single Post
12-19-10, 04:09 PM   #2
Taryble
A Molten Giant
 
Taryble's Avatar
Join Date: Jan 2009
Posts: 811
Try this - it's based on portions of the "Target Name" text I use in my StUF uf's. This leaves the level uncolored, but colors the name by class.

Code:
function(unit)
  local name, level = UnitName(unit), UnitLevel(unit)
  local clcolor = RAID_CLASS_COLORS[select(2, UnitClass(unit))]
  if (name and string.len(name) > 10) then 
    name = string.gsub(name, "([^%s]+) ", function(s) return string.sub(s,1,1) .. "." end)
  end
  return "%s |cff%02x%02x%02x%s|r", level, clcolor.r*255, clcolor.g*255, clcolor.b*255, name
end
__________________
-- Taryble

Last edited by Taryble : 12-20-10 at 12:24 AM.
  Reply With Quote