API:GameData.InteractData.GetItemLootList
From RoR Wiki
UI Lua API · Loot functions
Version: WAR 1.4.8
Returns the choices of an opened item container (a "choose one" loot bag opened from the backpack).
items = GameData.InteractData.GetItemLootList()
Arguments
None.
Returns
- items
table– Array of item data tables, indexed from 1. Empty if no container is open.
Details
- Each call builds a new table from the client's stored list. ItemContainerLootItem clears that list.
- The index of an item in this table is the
choiceIndexfor ItemContainerLootItem. - The stock UI reads it when
SystemData.Events.INTERACT_SHOW_ITEM_CONTAINER_LOOTfires. - If the Lua state is not available, the function returns nothing.
Errors
None.
Example
From default/ea_lootwindow/source/chooseonelootwindow.lua:
EA_Window_ChooseOneLoot.lootData = GameData.InteractData.GetItemLootList()
EA_Window_ChooseOneLoot.lootDataDisplayOrder = {}
for lootIndex, itemData in ipairs( EA_Window_ChooseOneLoot.lootData )
...
