Class ModChoiceOption<T>
A mod option class for handling an option that can select one item from a list of values.
public class ModChoiceOption<T> : ModOption<T, ChoiceChangedEventArgs<T>>
Type Parameters
T
- Inheritance
-
ModOption<T, ChoiceChangedEventArgs<T>>ModChoiceOption<T>
- Inherited Members
- Extension Methods
Properties
AdjusterComponent
The Adjuster for this OptionItem.
public override Type AdjusterComponent { get; }
Property Value
Choice
The actual uGUI_Choice when the menu is open.
public uGUI_Choice Choice { get; }
Property Value
- uGUI_Choice
Index
The currently selected index among the options array.
public int Index { get; }
Property Value
Options
The array of readable string options to choose between in the ModChoiceOption<T>.
public T[] Options { get; }
Property Value
- T[]
Tooltip
The tooltip to show when hovering over the option.
public string Tooltip { get; }
Property Value
Methods
AddToPanel(uGUI_TabbedControlsPanel, int)
The base method for adding an object to the options panel
public override void AddToPanel(uGUI_TabbedControlsPanel panel, int tabIndex)
Parameters
panel
uGUI_TabbedControlsPanel- The panel to add the option to.
tabIndex
int- Where in the panel to add the option.
Create(string, string, T[], int, string)
Adds a new ModChoiceOption<T> to this instance.
public static ModChoiceOption<T> Create(string id, string label, T[] options, int index, string tooltip = null)
Parameters
id
string- The internal ID for the choice option.
label
string- The display text to use in the in-game menu.
options
T[]- The collection of available values.
index
int- The starting value.
tooltip
string- The tooltip to show when hovering over the option.
Returns
Create(string, string, T[], T, string)
Adds a new ModChoiceOption<T> to this instance.
public static ModChoiceOption<T> Create(string id, string label, T[] options, T value, string tooltip = null)
Parameters
id
string- The internal ID for the choice option.
label
string- The display text to use in the in-game menu.
options
T[]- The collection of available values.
value
T- The starting value.
tooltip
string- The tooltip to show when hovering over the option.