GearBlocks
The GearBlocks Lua scripting API
Public Member Functions | Properties | List of all members
SmashHammer.UI.Dropdown Class Reference

A dropdown UI element. More...

Inheritance diagram for SmashHammer.UI.Dropdown:
SmashHammer.UI.Element SmashHammer.UI.IDropdown SmashHammer.UI.IElement SmashHammer.UI.ISizeable SmashHammer.UI.IRotatable

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.
 
void SetAlignment (Align align, float paramA, float paramB)
 Set the element's alignment.
 
void SetRotation (float angle)
 Set the element's rotation.
 
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

ValueChangedHandler OnChanged
 Event that is raised when the dropdown value is changed.
 
int Value [get, set]
 The dropdown value.
 
string SelectedOption [get]
 The selected dropdown option.
 
int NumOptions [get]
 The number of dropdown options.
 
- Properties inherited from SmashHammer.UI.Element
virtual bool IsVisible [get, set]
 Is the element visible?
 
- Properties inherited from SmashHammer.UI.IElement
bool IsVisible [get, set]
 Is the element visible?
 
bool IsInteractable [get, set]
 Is the element interactable?
 
bool IsTargetable [get, set]
 Is the element targetable?
 
- Properties inherited from SmashHammer.UI.IDropdown
int Value [get, set]
 The dropdown value.
 
string SelectedOption [get]
 The selected dropdown option.
 
int NumOptions [get]
 The number of dropdown options.
 

Additional Inherited Members

- Public Types inherited from SmashHammer.UI.ISizeable
enum  Align : byte {
  LeftEdge , RightEdge , TopEdge , BottomEdge ,
  HorizEdges , VertEdges , HorizCentre , VertCentre
}
 UI element alignment mode. More...
 
- Events inherited from SmashHammer.UI.IDropdown
ValueChangedHandler OnChanged
 Event that is raised when the dropdown value is changed.
 

Detailed Description

A dropdown UI element.

Member Function Documentation

◆ AddOption() [1/2]

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

Add an option to the dropdown menu.

Parameters
nameThe name of the option to add.

Implements SmashHammer.UI.IDropdown.

◆ AddOption() [2/2]

void SmashHammer.UI.Dropdown.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.

Implements SmashHammer.UI.IDropdown.

◆ AddOptions() [1/2]

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

Add options to the dropdown menu.

Parameters
namesA list of option names to add.

Implements SmashHammer.UI.IDropdown.

◆ AddOptions() [2/2]

void SmashHammer.UI.Dropdown.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.

Implements SmashHammer.UI.IDropdown.

Property Documentation

◆ Value

int SmashHammer.UI.Dropdown.Value
getset

The dropdown value.

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

Implements SmashHammer.UI.IDropdown.

◆ SelectedOption

string SmashHammer.UI.Dropdown.SelectedOption
get

The selected dropdown option.

The currently selected option in this dropdown menu.

Implements SmashHammer.UI.IDropdown.

◆ NumOptions

int SmashHammer.UI.Dropdown.NumOptions
get

The number of dropdown options.

The number of options in this dropdown menu.

Implements SmashHammer.UI.IDropdown.