Skip to Main Content

BTD_Mod_Helper​.Api​.ModOptions​.ModSetting


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.ModOptions

ModSetting Class

Base class for a ModSetting without the generics

public abstract class ModSetting

Inheritance System.Object  ModSetting

Derived
ModSetting<T>
ModSettingButton

Fields

ModSetting.category Field

The category that this is part of, or null

public ModSettingCategory category;

Field Value

ModSettingCategory

ModSetting.description Field

The description / explanation of this mod setting

public string description;

Field Value

System.String

ModSetting.displayName Field

The exact name displayed for this mod setting. If unset, will use the variable name.

public string displayName;

Field Value

System.String

ModSetting.icon Field

Icon to display alongside the setting

public string icon;

Field Value

System.String

ModSetting.modifyOption Field

Action to modify the ModHelperOption after it's created

public Action<ModHelperOption> modifyOption;

Field Value

System.Action<ModHelperOption>

ModSetting.requiresRestart Field

Indicates to players that the effects of changing this setting will only take place after a restart

public bool requiresRestart;

Field Value

System.Boolean

ModSetting.source Field

The type where this ModSettings was defined

public IModSettings source;

Field Value

IModSettings

Properties

ModSetting.Name Property

The name of this mod setting, gotten from the field name

public string Name { get; set; }

Property Value

System.String

Methods

ModSetting.CreateBaseOption() Method

Creates a base ModHelperOption component based on the name, description and icon of this

protected BTD_Mod_Helper.Api.Components.ModHelperOption CreateBaseOption();

Returns

ModHelperOption

ModSetting.GetDefaultValue() Method

Gets the default value for this ModSetting

public virtual object GetDefaultValue();

Returns

System.Object
The default value

ModSetting.GetLastSavedValue() Method

Gets the last saved value for this ModSetting

public virtual object GetLastSavedValue();

Returns

System.Object
The last saved value

ModSetting.GetValue() Method

Gets the current value that this ModSetting holds

public virtual object GetValue();

Returns

System.Object
The value

ModSetting.SetValue(object) Method

Sets the current value of this ModSetting

public virtual 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 virtual 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