Code:
GameTooltip:HookScript("OnTooltipSetUnit", function(GameTooltip)
--print("OnTooltipSetUnit")
local _, unit = GameTooltip:GetUnit()
--print(unit)
if UnitIsPlayer(unit) then
--print("UnitIsPlayer")
local _, class = UnitClass(unit)
--print(class)
local color = class and (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
if color then
local text = GameTooltipTextLeft1:GetText()
--print(text)
GameTooltipTextLeft1:SetFormattedText("|cff%02x%02x%02x%s|r", color.r * 255, color.g * 255, color.b * 255, text:match("|cff\x\x\x\x\x\x(.+)|r") or text)
end
end
end)
If you don't know what to do with that, go here:
http://addon.ziuo.net/
If you notice it not working on someone, un-comment the print lines (change all instances of "--print" to "print"), reload your UI, and report what appears in the chat frame when you mouse over the unit it doesn't work on.