Class ConfigEntryExtensions
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
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
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
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
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
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
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
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
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
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