As for your first question, Garkin took care of that. I personally use
Lua Code:
PLAYER_INVENTORY.inventories[inventoryType].slots[slotIndex].dataEntry
Originally Posted by Baertram
Thank you very much Garkin.
One more thing I recognized:
If you enable a filter in the inventory the items won't be in the list of
PLAYER_INVENTORY.inventories[bagId].slots[slotIndex]
anymore. They are gone until you disable the filter again.
Is there any list of the inventory items containing ALL items, including the filtered ones?
|
I've not used the
Lua Code:
SHARED_INVENTORY:GenerateSingleSlotData(bagId, slotIndex)
that they talked about, but I do know a little about the filters & slot tables you were discussing.
The filters are a small list of information (button textures, description, the button control, ect..) including a filterType which is really just a number. Its all stored in the tabFilters table of an inventory (found in):
Lua Code:
PLAYER_INVENTORY.inventories[inventoryType].tabFilters
Each slot also has one or more filterType numbers assigned to it, which can be found in the slots filterData table:
Lua Code:
-- With the exception of the Quest Inventory, it does not have a filterData table --
PLAYER_INVENTORY.inventories[inventoryType].slots[slotIndex].filterData
When you enable a filter it clears the inventories
"listView" (list of all visible items in the Inventory), and rebuilds it only
(showing) adding slots
(items) to the listView that have the current filterType Number in their filterData table. But the listView and the slots are two separate tables in different locations:
Lua Code:
PLAYER_INVENTORY.inventories[inventoryType].slots[slotIndex]
PLAYER_INVENTORY.inventories[inventoryType].listView
The point is that enabling a filter changes the listView table, it does not change the items listed in the slots table:
Lua Code:
PLAYER_INVENTORY.inventories[inventoryType].slots[slotIndex]
The items are all there regardless of any applied filters.
It sounds like you were looking at:
Lua Code:
PLAYER_INVENTORY.inventories[inventoryType].listView.data
Those are the "visible" items in the inventory. The ones that have a filterType number in their filterData table that matches the current filter. Those do change when filters are applied as it only lists (contains) items that are currently visible.