Table of Contents

Class ConfigEntryExtensions

Namespace
Nautilus.Options
Assembly
Nautilus.dll
public static class ConfigEntryExtensions
Inheritance
ConfigEntryExtensions
Inherited Members

Methods

ToModChoiceOption<T>(ConfigEntry<T>, IEnumerable<T>)

Converts an Enum ConfigEntry into a ModChoiceOption that will update the value when the choice changes.
public static ModChoiceOption<T> ToModChoiceOption<T>(this ConfigEntry<T> configEntry, IEnumerable<T> options = null) where T : Enum

Parameters

configEntry ConfigEntry<T>
A
options IEnumerable<T>
Array of valid options if not using the whole Enum

Returns

ModChoiceOption<T>
ModKeybindOption

Type Parameters

T

ToModChoiceOption<T>(ConfigEntry<T>, T[])

Converts a ConfigEntry into a ModChoiceOption that will update the value when the choice changes.
public static ModChoiceOption<T> ToModChoiceOption<T>(this ConfigEntry<T> configEntry, T[] options = null) where T : IEquatable<T>

Parameters

configEntry ConfigEntry<T>
A
options T[]

Returns

ModChoiceOption<T>
ModKeybindOption

Type Parameters

T

ToModColorOption(ConfigEntry<Color>, bool)

Converts a Bepinex ConfigEntry/ into 4 ModSliderOption that will update the value when the slider changes.
public static ModColorOption ToModColorOption(this ConfigEntry<Color> configEntry, bool basic = false)

Parameters

configEntry ConfigEntry<Color>
A bepinex config entry
basic bool
Whether to use the basic or advanced color picker

Returns

ModColorOption
ModColorOption

Remarks

Does not support use of BepInEx.Configuration.AcceptableValueList<T>.

ToModKeybindOption(ConfigEntry<KeyCode>)

Converts a Bepinex ConfigEntry/ into a ModKeyBindOption that will update the value when the keybind changes.
public static ModKeybindOption ToModKeybindOption(this ConfigEntry<KeyCode> configEntry)

Parameters

configEntry ConfigEntry<KeyCode>
A

Returns

ModKeybindOption
ModKeybindOption

ToModSliderOption(ConfigEntry<int>, int?, int?, int)

Converts a Bepinex ConfigEntry/ into a ModSliderOption that will update the value when the slider changes.
public static ModSliderOption ToModSliderOption(this ConfigEntry<int> configEntry, int? minValue = null, int? maxValue = null, int step = 1)

Parameters

configEntry ConfigEntry<int>
A
minValue int?
Sets the lowest allowed value of the slider. default: 0
maxValue int?
Sets the highest allowed value of the slider. default: 100
step int
The snapping value of the slider. Minimum value: 1, Default value: 1

Returns

ModSliderOption
ModSliderOption

ToModSliderOption(ConfigEntry<float>, float?, float?, float, string)

Converts a Bepinex ConfigEntry/ into a ModSliderOption that will update the value when the slider changes.
public static ModSliderOption ToModSliderOption(this ConfigEntry<float> configEntry, float? minValue = null, float? maxValue = null, float step = 0.01, string floatFormat = "{0:F2}")

Parameters

configEntry ConfigEntry<float>
A
minValue float?
Sets the lowest allowed value of the slider. default: 0f
maxValue float?
Sets the highest allowed value of the slider. default: 1f
step float
The snapping value of the slider. Minimum value: 0.0001f, Default 0.01f
floatFormat string
The formatting string used on the float value. Default value: "{0:F2}" shows 2 decimals

Returns

ModSliderOption
ModSliderOption

ToModSliderOptions(ConfigEntry<Vector2>, float, float, float, string)

Converts a Bepinex ConfigEntry/ into 2 ModSliderOption that will update the value when the slider changes.
public static List<ModSliderOption> ToModSliderOptions(this ConfigEntry<Vector2> configEntry, float minValue, float maxValue, float step, string floatFormat = "{0:F2}")

Parameters

configEntry ConfigEntry<Vector2>
A
minValue float
Sets the lowest allowed value of the slider. default: 0f
maxValue float
Sets the highest allowed value of the slider. default: 1f
step float
The snapping value of the slider. Minimum value: 0.01f
floatFormat string
The formatting string used on the float value. Default value: "{0:F2}" shows 2 decimals

Returns

List<ModSliderOption>
ModSliderOption

ToModSliderOptions(ConfigEntry<Vector3>, float, float, float, string)

Converts a Bepinex ConfigEntry/ into 3 ModSliderOption that will update the value when the slider changes.
public static List<ModSliderOption> ToModSliderOptions(this ConfigEntry<Vector3> configEntry, float minValue, float maxValue, float step, string floatFormat = "{0:F2}")

Parameters

configEntry ConfigEntry<Vector3>
A
minValue float
Sets the lowest allowed value of the slider. default: 0f
maxValue float
Sets the highest allowed value of the slider. default: 1f
step float
The snapping value of the slider. Minimum value: 0.01f
floatFormat string
The formatting string used on the float value. Default value: "{0:F2}" shows 2 decimals

Returns

List<ModSliderOption>
ModSliderOption

ToModSliderOptions(ConfigEntry<Vector4>, float, float, float, string)

Converts a Bepinex ConfigEntry/ into 4 ModSliderOption that will update the value when the slider changes.
public static List<ModSliderOption> ToModSliderOptions(this ConfigEntry<Vector4> configEntry, float minValue, float maxValue, float step, string floatFormat = "{0:F2}")

Parameters

configEntry ConfigEntry<Vector4>
A
minValue float
Sets the lowest allowed value of the slider. default: 0f
maxValue float
Sets the highest allowed value of the slider. default: 1f
step float
The snapping value of the slider. Minimum value: 0.01f
floatFormat string
The formatting string used on the float value. Default value: "{0:F2}" shows 2 decimals

Returns

List<ModSliderOption>
ModSliderOption

ToModToggleOption(ConfigEntry<bool>)

Converts a Bepinex ConfigEntry/ into a ModSliderOption that will update the value when the slider changes.
public static ModToggleOption ToModToggleOption(this ConfigEntry<bool> configEntry)

Parameters

configEntry ConfigEntry<bool>
A

Returns

ModToggleOption
ModToggleOption