API:GetCurrencyItemData
From RoR Wiki
UI Lua API · Item functions
Version: WAR 1.4.8
Returns the items in the player's currency backpack.
items = GetCurrencyItemData()
Arguments
None.
Returns
- items
table– Array of 32 item data tables, indexed by currency backpack slot from 1 to 32.
Details
- The table always has 32 entries, whatever the size of the player's currency backpack. Empty slots have an item table with default values (
id0, emptyname). - If there is no player object, or the Lua state is not available, the function returns nothing.
- A new table is built on every call. The stock UI caches it in
DataUtils.GetCurrencyItems()(easystem_utils/source/datautils.lua) and rebuilds it only whenGameData.Player.currencyItemsDirtyis set.
Errors
None.
Example
From default/easystem_utils/source/datautils.lua:
function DataUtils.GetCurrencyItems()
if (GameData.Player.currencyItemsDirty)
then
GameData.Player.currencyItemsDirty = false
DataUtilsData.currencyItems = GetCurrencyItemData()
end
return DataUtilsData.currencyItems
end
