IValueModSetting<T>
A setting that holds a value of type T: the default, the applied value and the selected value.
public interface IValueModSetting<T> : IValueModSettingBaseA setting that holds a value of type T: the default, the applied value and the value currently selected in the UI. Implemented by every Selector, Slider, Switch and Color setting.
Type parameters: T — the value type; int, float, string, bool, UnityEngine.Color or an enum.
Implements: IValueModSettingBase · IModSetting
Derived: IGlobalValueSetting<T> · ISelectorWorldSetting<T> · ISliderWorldSetting<T> · ISwitchWorldSetting<T>
Properties
SettingValue
T SettingValue { get; set; }Gets or sets the applied value: what is saved to disk, returned by modsetting(), and what a mod should act on.
DefaultValue
T DefaultValue { get; set; }Gets or sets the value ResetToDefault() returns to.
SelectedValue
T SelectedValue { get; set; }Gets or sets the value currently selected in the UI, possibly not yet applied.
Events
OnSelectedChanged
event OnSelectedChangedEvent<T> OnSelectedChanged;Occurs when SelectedValue changes to a different value. Type OnSelectedChangedEvent<T>.
Methods
GetPreview(T)
string GetPreview(T value);Returns the preview image path registered for value, or null.
AddPreview(T, String)
void AddPreview(T value, string path);Registers an image to show while value is selected. The first image registered for a value wins.