Table of Contents

Class SliderAttribute

Namespace
Nautilus.Options.Attributes
Assembly
Nautilus.dll
Attribute used to signify the specified float, double or int should be represented in the mod's option menu as a ModSliderOption.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class SliderAttribute : ModOptionAttribute, _Attribute
Inheritance
SliderAttribute
Implements
Inherited Members
Extension Methods

Examples

using Nautilus.Json;
using Nautilus.Options;

[Menu("My Options Menu")]
public class Config : ConfigFile
{
    [Slider("My Slider", 0, 50, DefaultValue = 25, Format = "{0:F2}")]
    public float MySlider;
}

Constructors

SliderAttribute()

Signifies the specified float, double or int should be represented in the mod's options menu as a ModSliderOption.
public SliderAttribute()

SliderAttribute(float, float)

Signifies the specified float, double or int should be represented in the mod's options menu as a ModSliderOption.
public SliderAttribute(float min, float max)

Parameters

min float
The minimum value of the slider.
max float
The maximum value of the slider.

SliderAttribute(string)

Signifies the specified float, double or int should be represented in the mod's options menu as a ModSliderOption.
public SliderAttribute(string label = null)

Parameters

label string
The label for the slider. If none is set, the name of the method will be used.

SliderAttribute(string, float, float)

Signifies the specified float, double or int should be represented in the mod's options menu as a ModSliderOption.
public SliderAttribute(string label, float min, float max)

Parameters

label string
The label for the slider. If none is set, the name of the method will be used.
min float
The minimum value of the slider.
max float
The maximum value of the slider.

Properties

DefaultValue

The default value of the slider.
public float DefaultValue { get; set; }

Property Value

float

Format

The format to use when displaying the value, e.g. "{0:F2}" or "{0:F0} %"
public string Format { get; set; }

Property Value

string

Max

The maximum value of the slider.
public float Max { get; set; }

Property Value

float

Min

The minimum value of the slider.
public float Min { get; set; }

Property Value

float

Step

The step to apply to the slider (ie. round to nearest)
public float Step { get; set; }

Property Value

float

See Also