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

A specialized ToggleMenuItem prepopulated with Yes and No.

Inheritance diagram for YesNoMenuItem:
ToggleMenuItem MenuItem

Member Functions

YesNoMenuItem(name, currentIndex, help)
 Constructor.
 

Detailed Description

A specialized ToggleMenuItem prepopulated with Yes and No.

To create a YesNoMenuItem from a plugin, use the following syntax:

Constructor Documentation

◆ YesNoMenuItem.new(name, currentIndex, help)

Arg types: name: string, currentIndex: int, help: string  |  returns YesNoMenuItem

Constructor.

Example:

yesnomenuitem = YesNoMenuItem.new(name, currentIndex, help)
...
levelgen:addItem(yesnomenuitem)
A specialized ToggleMenuItem prepopulated with Yes and No.
Definition: UIMenuItems__cpp.h:17
Parameters
nameThe text shown on the menu item.
currentIndexThe index of the item to be selected initially (1 = Yes, 2 = No).
helpA bit of help text.

The YesNoMenuItem will return 1 if the user selected Yes, 2 if No.

For example:

m = YesNoMenuItem.new("Hostile", 1, "Should this turret be hostile?")