Gears
API ReferenceAttributes

SettingOnEnabledAttribute

Binds a static method to OnEnabled. Works on every setting.

Sealed classNamespace GearsAPI.AttributesAssembly GearsAPI.dllSource
public sealed class SettingOnEnabledAttribute : SettingListenerAttribute

Binds a static method to the named setting's OnEnabled event (IModSetting), which fires when Enabled changes to a different value. Declared on IModSetting, so it is the one listener that works on every setting, global and world. Required method signature: static void M(IModSetting setting, bool isEnabled).

Inheritance: Object → Attribute → SettingPathAttribute → SettingListenerAttribute → SettingOnEnabledAttribute

Constructors

SettingOnEnabledAttribute(String)

public SettingOnEnabledAttribute(string settingPath)

Initializes the attribute with the setting path.

On this page