Thread Tools Display Modes
09-02-06, 01:01 PM   #1
DrGonzo23
A Defias Bandit
Join Date: Sep 2006
Posts: 2
Modify ItemTooltips / GetItemInfo from Tooltip

hi there,

i'm quite new to addon coding. i'm trying to create a simple addon that adds one line (or modifies one) in an item tooltip. i know already how to modify and read the contents of a tooltip.

my goal is to add the dkp price for an item to the tooltip. the price is calculated from the itemlevel and itemtype. i've found the GetItemInfo method which should help me accomplish this task.

but my problem atm is that i don't know how to determine if the tooltip displays an item. and how to extract the itemstring (itemlink, itemid) for the GetItemInfo method.

i'd be glad if someone could give me a tip how to start doing this.

currently i only add a event handler to the GameTooltip with SetScript and read the contents with getglobal("GameTooltipTextLeft"..n).

thanks for your help =)

Last edited by DrGonzo23 : 09-02-06 at 01:03 PM. Reason: changed title to match content
  Reply With Quote
09-02-06, 02:35 PM   #2
Guillotine
A Cobalt Mageweaver
 
Guillotine's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 206
Sounds to me like you're doing it the hard way...

Check out http://www.wowinterface.com/download...fo.php?id=4635

This may be exactly what you're looking for. If not though, the code is rather simple to pick through and figure out what you need to know ^_^
  Reply With Quote
09-03-06, 03:49 AM   #3
DrGonzo23
A Defias Bandit
Join Date: Sep 2006
Posts: 2
you're right i could use this addon. but that's not really what i want. because everybody needs to sync with my database. in that dkp addon the price must manually be added to the database. but in our dkp system the price is calculated as follows:

DKP = (ItemLevel - CatOffset) * SlotMod

ItemLevel:
every item has such an itemlevel. i mean not the required player level. but e.g. on thottbot you can view this itemlevel. afaik the itemlevel comes from blizzard's implementation.

CatOffset:
weapons = 12
set = 27
everything else = 33

SlotMod:
legs, chest, head = 100%
waist, hands, feet, shoulder = 74%
trinkets = 68%
wrist, neck, ring, back = 54%

that means i could calculate the dkp price on the fly for every item. but for that i need to get this information from the tooltip.

then i could calculate the price on the fly and display it in the tooltip without having such a database.

i will have a closer look at the skp, maybe it will be helpful. but as it seems it does not what i want it to =)

thanks for your tip anyway.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Modify ItemTooltips / GetItemInfo from Tooltip

Thread Tools
Display Modes

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