Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ListBoxSetDisplayOrder

From RoR Wiki

UI Lua API · ListBox functions
Version: WAR 1.4.8

Sets which data entries a ListBox shows, and in which order.

ListBoxSetDisplayOrder(listBoxName, displayOrder)

Arguments

listBoxName
string – Name of the ListBox.
displayOrder
number-table – Array of data indices, one per list entry, in the order they should appear. Use {} to show nothing.

Returns

Nothing.

Details

  • The values are converted to whole numbers and replace the previous display order.
  • The list can scroll until the last entry is in the bottom row. If the list was scrolled further than the new order allows, it is scrolled back.
  • The visible rows are refreshed straight away: rows without an entry are hidden, the others are shown and filled from the data.
  • ListBoxGetDataIndex returns these values for the visible rows.
  • The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.

Errors

The messages use the name ListBoxSetRowFilters:

  • Error in function call 'ListBoxSetRowFilters': Incorrect parameters – when the arguments are not a string and a table of numbers.
  • Error in function call 'ListBoxSetRowFilters': Window %s does not exist
  • Error in function call 'ListBoxSetRowFilters': Window %s is not a ListBox

Example

From default/ea_auctionhousewindow/source/auctionwindow.lua, clearing the list and later showing sorted results:

ListBoxSetDisplayOrder( RESULTS_LIST, {} )
...
ListBoxSetDisplayOrder( RESULTS_LIST, windowData.displayOrder )

See also