Thread Tools Display Modes
11/14/15, 12:37 PM   #1
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
SHARED_INVENTORY_SLOT_RESULT_REMOVED not fired on research

Lua Code:
  1. function ZO_SharedInventoryManager:HandleSlotCreationOrUpdate(bagCache, bagId, slotIndex, isNewItem)
  2.     local existingSlotData = bagCache[slotIndex]
  3.     local slotData, result = self:CreateOrUpdateSlotData(existingSlotData, bagId, slotIndex, isNewItem)
  4.     bagCache[slotIndex] = slotData
  5.     if result == SHARED_INVENTORY_SLOT_RESULT_REMOVED then
  6.         self:FireCallbacks("SlotRemoved", bagId, slotIndex, existingSlotData)
  7. ...

This callback is not fired, if a item is consumed by researching its trait, why? The item is removed...
  Reply With Quote
11/14/15, 01:13 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Maybe research causes a full inventory update? Not that I think it would make sense, I too would expect single slot update.
  Reply With Quote
11/16/15, 04:02 AM   #3
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
It is not hooked on Full- or Single-Update. This is called for both events and i'am don't using the events, i use a callback-function on 'SlotAdded' and 'SlotRemoved'.
  Reply With Quote
11/16/15, 08:34 AM   #4
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Tried starting research on the PTS. "SlotRemoved" was only fired when I used an item from backpack. When I used an item from bank it wasn't fired. I checked SHARED_INVENTORY.bagCache[2] and the item was still there. "SlotRemoved" for that item was eventually fired when I went to the bank and opened it.

edit: I guess your best bet would be hooking ResearchSmithingTrait, it's not even marked as protected in the doc.

Last edited by merlight : 11/16/15 at 10:27 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » SHARED_INVENTORY_SLOT_RESULT_REMOVED not fired on research


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