Class ModSliderOption
A mod option class for handling an option that can have any floating point value between a minimum and maximum.
public class ModSliderOption : ModOption<float, SliderChangedEventArgs>
- Inheritance
-
ModSliderOption
- Inherited Members
- Extension Methods
Properties
AdjusterComponent
The Adjuster for this OptionItem.
public override Type AdjusterComponent { get; }
Property Value
DefaultValue
The default value of the ModSliderOption.
Showed on the slider by small gray circle. Slider's handle will snap to the default value near it.
public float DefaultValue { get; }
Property Value
MaxValue
The maximum value of the ModSliderOption.
public float MaxValue { get; }
Property Value
MinValue
The minimum value of the ModSliderOption.
public float MinValue { get; }
Property Value
Step
The step value of the ModSliderOption defaults to 1.
public float Step { get; }
Property Value
Tooltip
The tooltip to show when hovering over the option.
public string Tooltip { get; }
Property Value
ValueFormat
Float Format for value field (Create(string, string, float, float, float, float?, string, float, string))
public string ValueFormat { 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, float, float, float, float?, string, float, string)
Creates a new ModSliderOption to this instance.
public static ModSliderOption Create(string id, string label, float minValue, float maxValue, float value, float? defaultValue = null, string valueFormat = "{0:F0}", float step = 1, string tooltip = null)
Parameters
id
string- The internal ID for the slider option.
label
string- The display text to use in the in-game menu.
minValue
float- The minimum value for the range.
maxValue
float- The maximum value for the range.
value
float- The starting value.
defaultValue
float?- The default value for the slider. If this is null then 'value' used as default. uses value
valueFormat
string- format for values when labelMode is set to SliderLabelMode.Float, e.g. "{0:F2}" for 2 decimals or "{0:F0} for no decimals %" (more on this here)
step
float- Step for the slider, ie. round to nearest X. defaults to 1
tooltip
string- The tooltip to show when hovering over the option. defaults to no tooltip.