GearBlocks
The GearBlocks Lua scripting API
Public Member Functions | Properties | Events | List of all members
SmashHammer.UI.IDropdown Interface Reference

Provides access to a UI dropdown menu's properties and methods. More...

Inheritance diagram for SmashHammer.UI.IDropdown:
SmashHammer.UI.Dropdown SmashHammer.UI.LabelledDropdown

Public Member Functions

void AddOption (string name)
 Add an option to the dropdown menu.
 
void AddOption (string name, bool selectable)
 Add an option to the dropdown menu.
 
void AddOptions (IList< string > names)
 Add options to the dropdown menu.
 
void AddOptions (IList<(string, bool)> options)
 Add options to the dropdown menu.
 
void ClearOptions ()
 Clear all options from the dropdown menu.
 

Properties

int Value [get, set]
 The dropdown value.
 
string SelectedOption [get]
 The selected dropdown option.
 
int NumOptions [get]
 The number of dropdown options.
 

Events

ValueChangedHandler OnChanged
 Event that is raised when the dropdown value is changed.
 

Detailed Description

Provides access to a UI dropdown menu's properties and methods.

Member Function Documentation

◆ AddOption() [1/2]

void SmashHammer.UI.IDropdown.AddOption ( string  name)

Add an option to the dropdown menu.

Parameters
nameThe name of the option to add.

Implemented in SmashHammer.UI.Dropdown.

◆ AddOption() [2/2]

void SmashHammer.UI.IDropdown.AddOption ( string  name,
bool  selectable 
)

Add an option to the dropdown menu.

Parameters
nameThe name of the option to add.
selectableSet to true to make the option selectable; false to make it non-selectable.

Implemented in SmashHammer.UI.Dropdown.

◆ AddOptions() [1/2]

void SmashHammer.UI.IDropdown.AddOptions ( IList< string >  names)

Add options to the dropdown menu.

Parameters
namesA list of option names to add.

Implemented in SmashHammer.UI.Dropdown.

◆ AddOptions() [2/2]

void SmashHammer.UI.IDropdown.AddOptions ( IList<(string, bool)>  options)

Add options to the dropdown menu.

Parameters
optionsA list of options (each specifying name and "is selectable" flag) to add.

Implemented in SmashHammer.UI.Dropdown.

Property Documentation

◆ Value

int SmashHammer.UI.IDropdown.Value
getset

The dropdown value.

The index of the currently selected option in this dropdown menu.

Implemented in SmashHammer.UI.Dropdown.

◆ SelectedOption

string SmashHammer.UI.IDropdown.SelectedOption
get

The selected dropdown option.

The currently selected option in this dropdown menu.

Implemented in SmashHammer.UI.Dropdown.

◆ NumOptions

int SmashHammer.UI.IDropdown.NumOptions
get

The number of dropdown options.

The number of options in this dropdown menu.

Implemented in SmashHammer.UI.Dropdown.