Thread Tools Display Modes
05-06-13, 09:07 AM   #1
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 124
Adding data to tooltip

Hey chaps / girls.

Just looking for some advice on the best way in which to show collected data on item tooltips.

The data I already collect is: All player listed ("owner") items on the AH, all player owned items in the mail, bags and Bank.

The idea is to show on item tooltips what items have already been posted in the AH (I list over 400 items which are all weapons / armor and this would help a lot by making sure I don't post doublers without having to manually check). It would also show what items are not posted which are in mail, bags, Bank etc. Each time items are posted, it costs 3k in auction fees alone!

Which handler should I use and does anyone have a bit of code that works effectively?

I'm thinking of just hooking GameTooltip:OnShow() for example, but am I right in saying that the AH uses 'shopping' tooltips?

Also, at the moment I'm collecting just (a) full item names and (b) their item levels (as some items have the same name, but different item levels). I'd ideally like to mine data from the tooltip itself, like whether the item has Agi, Int, or Str as I'd be wanting to post 3 belts, one with each stat, if I have them.

Thanks for any pointers / advice you can give.
__________________
__________________
  Reply With Quote
05-06-13, 09:20 AM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
GameTooltip:HookScript("OnShow", funcGoesHere)

But beware if you use GameTooltip, because it's used for everything - so you should use API to make sure this is an item, and perhaps make sure you are on the AH (if you only wish it to show during AH visits), before running your actual code that draws on the tooltip.

The key is conditions, you don't want this to show when inappropriate.
__________________
Profile: Curse | Wowhead
  Reply With Quote
05-06-13, 10:25 AM   #3
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Hooking the onshow is not really optimal, since it will also trigger when anything other then items will be shown (spells, talents, addon tooltips, just to name a few).

Have you looked at any of the AuctionHouse data Addons? For example, tekkubs tekAuc hooks tooltips in this file:

https://github.com/TekNoLogic/tekauc...r/tooltips.lua

So in short, hook the OnTooltipSetItem script.

Last edited by ravagernl : 05-06-13 at 10:30 AM.
  Reply With Quote
05-06-13, 03:16 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Yes, hook OnTooltipSetItem. Then use :AddLine() and :Show()
__________________
"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

WoWInterface » Developer Discussions » Lua/XML Help » Adding data to 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