Bitfighter  021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
ToggleMenuItem Class Reference

Menu item that lets users choose one of several options.

Inheritance diagram for ToggleMenuItem:
MenuItem YesNoMenuItem

Member Functions

ToggleMenuItem(name, options, currentIndex, wrap, help)
 Constructor.
 

Detailed Description

Menu item that lets users choose one of several options.

Constructor Documentation

◆ ToggleMenuItem.new(name, options, currentIndex, wrap, help)

Arg types: name: string, options: table, currentIndex: int, wrap: bool, help: string  |  returns ToggleMenuItem

Constructor.

Example:

togglemenuitem = ToggleMenuItem.new(name, options, currentIndex, wrap, help)
...
levelgen:addItem(togglemenuitem)
Menu item that lets users choose one of several options.
Definition: UIMenuItems__cpp.h:11
Parameters
nameThe text shown on the menu item.
optionsThe options to be displayed.
currentIndexThe index of the item to be selected initially (1 = first item).
wraptrueif the items should wrap around when you reach the last index.
helpA bit of help text.

The MenuItem will return the text of the item the user selected.

For example:

m = ToggleMenuItem.new("Type", { "BarrierMaker", "LoadoutZone", "GoalZone" }, 1, `true`, "Type of item to insert")