Thread Tools Display Modes
10-23-12, 09:23 PM   #1
Surrael
A Kobold Labourer
Join Date: Oct 2012
Posts: 1
GameToolTip Help

I have been working on developing my own addon and have it nearly finished, as far as the basic elements and functionality that I want it to have. My question has to do with the GameToolTip.

As of now I am using the GetItem(), GetItemInfo(), and GetItemStats() functions in order to update my tooltip with a new line (AddLine) that adds information based off pulling the item stats. The issue I am having is that it only works with actual tooltips on direct items, such as equipped or in my inventory. The new line does not appear on anything else. For example, I do not get anything added to the tooltip of a link in chat, hovering over an auction item, or looking at an item link through the Dungeon Journal.

Are there different types of tooltips other than the widget GameToolTip for links that are not direct items?

Any thoughts or advise is well appreciated.
  Reply With Quote
10-23-12, 09:29 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
GameTooltip is the actual widget.

The object using that widget that we see most of the time is also named GameTooltip.

The other objects using that widget are ItemRefTooltip (the one that you get when clicking a link in chat, that has the close button), ShoppingTooltip1, ShoppingTooltip2, ShoppingTooltip3 (the compare tooltips), and WorldMapTooltip.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
10-23-12, 09:34 PM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
What Seerah said and depending what's the scope of your project you might want to check out LibTipHooker-1.1
  Reply With Quote
10-24-12, 10:41 AM   #4
Philburt63
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 7
another bit of help

Don't forget that some functions such as GetItemInfo() won't always return information. Sometimes it is nil if the item hasn't been seen recently. So things in your bags should work ok (but not guaranteed to), but items at the AH - or even in your bank - wont always give usable data.
  Reply With Quote
10-24-12, 11:26 AM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Philburt63 View Post
Don't forget that some functions such as GetItemInfo() won't always return information. Sometimes it is nil if the item hasn't been seen recently. So things in your bags should work ok (but not guaranteed to), but items at the AH - or even in your bank - wont always give usable data.
Something I've done in the past is call GetItemInfo() as early as possible on an item to force the game to cache the item's data before I need to use it with a second GetItemInfo() call.

For example, I have an Inscription addon that deals with herbs, pigments, and inks. To display data on them, it forces the game to cache item data on load so it can do the necessary processing and display upon user request.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-24-12 at 11:29 AM.
  Reply With Quote
10-24-12, 11:46 AM   #6
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
I usually prefer to solve the GetItemInfo() problem same way Blizzard does.
Display placeholder values if it doesn't return info on first call and listen to GET_ITEM_INFO_RECEIVED event to fill them in when the server returns it.
  Reply With Quote
10-24-12, 01:58 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Dridzt View Post
I usually prefer to solve the GetItemInfo() problem same way Blizzard does.
Display placeholder values if it doesn't return info on first call and listen to GET_ITEM_INFO_RECEIVED event to fill them in when the server returns it.
It depends on what you need done. Different situations call for different methods.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-24-12, 02:01 PM   #8
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Indeed.
I was presenting an alternative not a 'better' solution
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » GameToolTip Help


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