Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetTrophyData

From RoR Wiki

UI Lua API · Item functions
Version: WAR 1.4.8

Returns the items in the player's five trophy slots.

trophies = GetTrophyData()

Arguments

None.

Returns

trophies
table – Array of 5 item data tables, indexed by trophy position from 1 to 5.

Details

  • The table always has 5 entries. An empty trophy slot gets a blank item table (id 0, empty name).
  • trophyLocation and trophyLocIndex in each table say where the trophy is attached. Compare them with the entries of GetLocationsForTrophies.
  • 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.GetTrophyData() (easystem_utils/source/datautils.lua) and rebuilds it only when GameData.Player.trophyItemsDirty is set.

Errors

None.

Example

From default/easystem_utils/source/datautils.lua:

function DataUtils.GetTrophyData ()
    if (GameData.Player.trophyItemsDirty)
    then
        GameData.Player.trophyItemsDirty = false
        DataUtilsData.trophyItems = GetTrophyData()
    end

    return DataUtilsData.trophyItems
end

See also