View Single Post
11/01/15, 02:33 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
v2.2 Easiest way to react on changed equippment items?

Hey there,

With update 2.2 the function "PlayOnEquippedAnimation" will be removed.
This one helped me a lot to update the marker textures at equipment slots, when the equipment got changed in the past :-(

So what is the easiest way with the next update 2.2 to react on equipped/unequipped items?
I need some event or PreHook callback function to run as any item gets
-equipped
-unequipped

I know there are the functions EquipItem and UnequipItem, but they won't give me all the info I need.
I need either the control name of the character control where the item get's equipped/got unequipped, or I need the slotIndex where it gets equipped/got unequipped.

And I need this to be executed as I use
-drag&drop
-double click
-right-click/context menu -> "Equip/Unequip"


EquipItem will only send the slotIndex of the item from your inventory, which you want to equip.
And then it calls the function to get the according free slot where this item could be equipped.

Example: double click, drag&drop or right-click and choose "Equip" on a helmet in your inventory will try to equip the helm in the helmet slot.
But the function EquipItem will only use the bagId of BAG_BACKPACK and the slotIndex of the helmet in your inventory.

Is there any easier way to get the slotIndex or control name where this helmet will "be equipped", or do I need to "search the possible slot(s)" by help of the itemType I want to equip in a callback function of a PreHook to function "EquipItem"?

And the same the other way around if you unequip an item.
  Reply With Quote