Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetCurrencyItemData

From RoR Wiki
Revision as of 19:43, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 (id 0, empty name).
  • 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 when GameData.Player.currencyItemsDirty is 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

See also