Skip to Main Content

BTD_Mod_Helper​.Api​.ModOptions​.ModSetting_T_


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.ModOptions

ModSetting Class

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

Type parameters

T

The type that this ModSetting holds

Inheritance System.ObjectModSetting  ModSetting

Derived
ModSettingBool
ModSettingEnum<T>
ModSettingFile
ModSettingFolder
ModSettingHotkey
ModSettingNumber<T>
ModSettingString

Constructors

ModSetting(T) Constructor

Constructs a new ModSetting for the given value

protected ModSetting(T value);

Parameters

value T

Fields

ModSetting.customValidation Field

Will only save the result and run onSave if this custom function validates the value

public Func<T,bool> customValidation;

Field Value

System.Func<T,System.Boolean>

ModSetting.onSave Field

Action to call when the value is saved, i.e. once they actually close the menu

public Action<T> onSave;

Field Value

System.Action<T>

ModSetting.onValueChanged Field

Action to call when the value changes within the menu

public Action<T> onValueChanged;

Field Value

System.Action<T>

Properties

ModSetting.OnValueChanged Property

Old onValueChanged.

public System.Collections.Generic.List<System.Action<T>> OnValueChanged { get; set; }

Property Value

System.Collections.Generic.List<System.Action<T>>

Methods

ModSetting.GetDefaultValue() Method

Gets the default value for this ModSetting

public override object GetDefaultValue();

Returns

System.Object
The default value

ModSetting.GetLastSavedValue() Method

Gets the last saved value for this ModSetting

public override object GetLastSavedValue();

Returns

System.Object
The last saved value

ModSetting.GetValue() Method

Gets the current value that this ModSetting holds

public override object GetValue();

Returns

System.Object
The value

ModSetting.SetValue(object) Method

Sets the current value of this ModSetting

public override void SetValue(object val);

Parameters

val System.Object

The new value

ModSetting.SetValueAndSave(object, bool) Method

Sets the current value of this ModSetting, and immediately saves the settings for the mod

public override void SetValueAndSave(object val, bool logSuccess=false);

Parameters

val System.Object

The new value

logSuccess System.Boolean

Whether to log the message success for when mod settings are saved

To learn how to download BTD Mod Helper and install mods, click here