Thread Tools Display Modes
10-07-06, 02:31 PM   #1
paulharman
A Kobold Labourer
Join Date: Oct 2006
Posts: 1
Hook item pickup function

Hi,

I am trying to find out how to hook the Blizzard UI item pickup functions to my own. I need to get the ID of an item as it is picked up with the mouse, in order to use the ID in my addon. Does anyone know how this can be achieved?

Thanks,
Paul
  Reply With Quote
10-16-06, 01:53 AM   #2
Zeksie
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 24
Originally Posted by paulharman
Hi,

I am trying to find out how to hook the Blizzard UI item pickup functions to my own. I need to get the ID of an item as it is picked up with the mouse, in order to use the ID in my addon. Does anyone know how this can be achieved?

Thanks,
Paul
A quote from my code:

Code:
-- XPerl_PickupContainerItem
local oldPickup, local PickupBag, PickupSlot
local function XPerl_PickupContainerItem(bagID, slot)
	PickupBag, PickupSlot = bagID, slot
	return oldPickup(bagID, slot)
end

if (not oldPickup) then
	oldPickup = PickupContainerItem
	PickupContainerItem = XPerl_PickupContainerItem
end
This will simply store the bag and slot for you to use. In my case, I have a screen area the user can click onto to drop an item into it. Then we can read the bag/slot for the item.

Works for bags and bank container items, but you'd need a seperate hook for worn items.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Hook item pickup function


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