Table of Contents
Class for keeping track of a variable for a Mod that can be changed in game via the Mod Settings menu
public abstract class ModSetting<T> : BTD_Mod_Helper.Api.ModOptions.ModSetting
T
The type that this ModSetting holds
Inheritance System.Object ModSetting ModSetting
Derived
↳ ModSettingBool
↳ ModSettingEnum<T>
↳ ModSettingFile
↳ ModSettingFolder
↳ ModSettingHotkey
↳ ModSettingNumber<T>
↳ ModSettingString
Constructs a new ModSetting for the given value
protected ModSetting(T value);
value
T
Will only save the result and run onSave if this custom function validates the value
public Func<T,bool> customValidation;
Action to call when the value is saved, i.e. once they actually close the menu
public Action<T> onSave;
Action to call when the value changes within the menu
public Action<T> onValueChanged;
Old onValueChanged.
public System.Collections.Generic.List<System.Action<T>> OnValueChanged { get; set; }
System.Collections.Generic.List<System.Action<T>>
Gets the default value for this ModSetting
public override object GetDefaultValue();
System.Object
The default value
Gets the last saved value for this ModSetting
public override object GetLastSavedValue();
System.Object
The last saved value
Gets the current value that this ModSetting holds
public override object GetValue();
System.Object
The value
Sets the current value of this ModSetting
public override void SetValue(object val);
val
System.Object
The new value