Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SwitchStoreCategories

From RoR Wiki

UI Lua API · Interact functions
Version: WAR 1.4.8

Asks the server to show another item category of the merchant store the player has open.

SwitchStoreCategories(categoryKey)

Arguments

categoryKey
number – A key of the table returned by GetStoreCategories (category id plus 1).

Returns

Nothing.

Details

  • The client subtracts 1 and sends the low byte of the result to the server as an interaction request for the current interaction target. It does not check that the category exists.
  • Nothing is sent if there is no current interaction target or the connection is not ready.
  • The new store contents arrive later; the stock UI reloads them with GetStoreData.
  • Exactly one argument must be passed.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From default/ea_interactionwindow/source/interactionwindowstore.lua, where GetServerCategoryIDFromLocal maps the combo box index back to the key from GetStoreCategories:

local comboBoxSelIndex = ComboBoxGetSelectedMenuItem( "EA_Window_InteractionStoreFilterCategoryBox" )
SwitchStoreCategories( GetServerCategoryIDFromLocal( comboBoxSelIndex ) )

See also