Quantcast WoWInterface - View Single Post - Stuf Unit LUA help
View Single Post
Unread 12-19-10, 04:09 PM   #2
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.

  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)
  return "%s |cff%02x%02x%02x%s|r", level, clcolor.r*255, clcolor.g*255, clcolor.b*255, name
-- Taryble

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