Thread Tools Display Modes
05-26-10, 09:00 AM   #1
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Tooltips and units

So I'm making a tooltip addon and I wanted to color the name of the unit but I'm not sure what function is firing after OnTooltipSetUnit & SetUnit to color it white when you hover a unit frame.

Mousing over a unit in the world (not unit frame) doesn't do this.


Basically goes like this on the world

1. SetTextColor
2. OnTooltipSetUnit (my hook)
3. SetTextColor (mine)

and on a unit frame

1. OnTooltipSetUnit (my hook)
2. SetTextColor (mine)
3. SetUnit
4. SetTextColor


I've tried hooking SetUnit but to no avail.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 05-26-10 at 09:12 AM.
  Reply With Quote
05-26-10, 09:03 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by v6o View Post
So I'm making a tooltip addon and I wanted to color the name on the character but I'm not sure what function is firing after OnTooltipSetUnit & SetUnit to color it white when you hover a unit frame.

Mousing over a unit in the world (not unit frame) doesn't do this.
Code:
GameTooltip:HookScript('OnTooltipSetUnit', yourFunc)
  Reply With Quote
05-26-10, 09:05 AM   #3
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Well that doesn't work p3lim because that's what I am doing at the moment

(I edited my above post to include firing order before I even saw your reply)
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
05-26-10, 09:11 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
I don't really see what you are trying to do.
Coloring the unit name in the tooltip?
  Reply With Quote
05-26-10, 09:12 AM   #5
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Originally Posted by p3lim View Post
I don't really see what you are trying to do.
Coloring the unit name in the tooltip?
Yes sir

(10 char limit)
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
05-26-10, 10:01 AM   #6
Guardix
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 42
I've had the same problem, so I chose to use escape sequences to color the text.
There is a Blizzard created function that colors already, but it'll will taint if you hook it, and the OnTooltipSetUnit happens too early as you said.
But if you still hook OnTooltipSetUnit and change the unit's name with a surrounding color escape sequence, you can get your wanted behavior.
  Reply With Quote
05-26-10, 10:17 AM   #7
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Ah. Smart idea.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 05-29-10 at 09:14 AM.
  Reply With Quote
05-29-10, 09:14 AM   #8
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Another question, how would one clear or delete a line in the tooltip without it leaving a small space where it was. It's not a full line shown but still noticeable.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
05-29-10, 09:51 AM   #9
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by v6o View Post
Another question, how would one clear or delete a line in the tooltip without it leaving a small space where it was. It's not a full line shown but still noticeable.
Use :Show(), that'll redraw the tooltip frame, if you want to take a look at tooltip hooking maybe check out QueTip.
  Reply With Quote
05-29-10, 12:32 PM   #10
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Originally Posted by Slakah View Post
Use :Show(), that'll redraw the tooltip frame, if you want to take a look at tooltip hooking maybe check out QueTip.
Errr.. Does that work when the tooltip is shown..?

Maybe more helpful. I am trying to remove the PVP text in a tooltip whenever someone is PVP enabled

Edit: This was solved.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 06-05-10 at 05:51 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Tooltips and units


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