Skip to reading
Panels, Tabs & List Boxes

Give Array rows stable identities

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
Source table from Give Array rows stable identities, page 33
Record fieldPurpose
idStable row ID returned by selection. Give every meaningful row one.
textVisible row sentence.
iconAssetIdOptional leading image asset ID.
disabledtrue prevents selection; false permits it.

An Array of simple Strings also works, but the generated IDs follow positions: item_1, item_2 and so on. Insert or reorder a row and the meaning of a position-based ID can change. Object records avoid that problem.

Code example
[
  {
    "id": "archive",
    "text": "Archive",
    "iconAssetId": "key_icon",
    "disabled": false
  },
  {
    "id": "tower",
    "text": "Clock tower",
    "disabled": true
  }
]

The route dropdown uses this same pattern. Its source is route_rows and its selection output is selected_route. Selecting the Archive sentence returns archive, which you can use in a script that decides where to send the player.

The designer uses authored initial values to preview an Array list. It does not show the current values from a game that happened to be running earlier.

Page 33 of 50Permalink
Go to page