Thread Tools Display Modes
06-27-12, 06:12 PM   #1
Xandrietta
A Deviate Faerie Dragon
 
Xandrietta's Avatar
Join Date: May 2012
Posts: 18
Class Colored Names on Tooltip?

Hello, I was just wondering if anyone knows of an addon, or a way to add class coloring to the names of default tooltip.

I have already gone through tiptac, and some of the others, but I am just looking for changing the names not anything else in the tooltip...

TY in advance
  Reply With Quote
06-27-12, 11:03 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 06-27-12 at 11:11 PM.
  Reply With Quote
06-27-12, 11:30 PM   #3
Xandrietta
A Deviate Faerie Dragon
 
Xandrietta's Avatar
Join Date: May 2012
Posts: 18
Thank you so very much Phanx. I was hoping you would show up

**Works perfectly***
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Class Colored Names on Tooltip?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off