Thread Tools Display Modes
12-12-15, 06:09 PM   #1
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
How to augment GameTooltip for world objects

I already augment the GameTooltip for NPCs using:
Code:
GameTooltip:HookScript("OnTooltipSetUnit", blah blah blah)
However, when the GameTooltip is being shown for a world object, it does not seem to be using OnTooltipSetUnit. Does anyone know what it is doing, or what I can do to call AddLine() appropriately?
  Reply With Quote
12-12-15, 06:19 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
I'm pretty sure the only way to identify an object's tooltip is by matching its contents to its localized name.
  Reply With Quote
12-12-15, 11:30 PM   #3
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
Even that would be acceptable to a point as I have its localized name. What I need to know is when it is going to be shown. I do not know the mechanism that causes that to happen.
  Reply With Quote
12-13-15, 02:17 AM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Nimhfree View Post
Even that would be acceptable to a point as I have its localized name. What I need to know is when it is going to be shown. I do not know the mechanism that causes that to happen.
You can just hook its OnShow script.
  Reply With Quote
12-13-15, 07:19 PM   #5
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Not sure if this applies in 100% of cases, but checking if the tooltip's owner is UIParent works for NPCs and all world objects that display the tooltip.
Lua Code:
  1. if GameTooltip:GetOwner() == UIParent then
  2.     -- rabble, rabble, rabble
  3. end
__________________
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » How to augment GameTooltip for world objects


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