Skip to content

Game.Settings.ModdingToolchainUIButtonAttribute

Assembly:
Namespace: Game.Settings

Type: class

Base: System.Attribute

Summary:
ModdingToolchainUIButtonAttribute is a simple marker attribute intended to mark a property as representing a UI button in the modding toolchain/settings UI. It does not implement any behavior by itself; the game's settings/tooling UI or modding framework inspects properties decorated with this attribute (typically via reflection) and renders or wires up a button accordingly. The attribute is declared with AttributeUsage(AttributeTargets.Property, Inherited = true), so it may only be applied to properties and is inherited by derived types.


Fields

  • None
    This attribute class defines no instance or static fields.

Properties

  • None
    There are no additional properties declared on the attribute.

Constructors

  • public ModdingToolchainUIButtonAttribute()
    Default parameterless constructor. The attribute is used as a marker and requires no configuration or arguments.

Methods

  • None
    No methods are defined beyond those inherited from System.Attribute / System.Object.

Usage Example

using Game.Settings;

// Example: mark a property so the modding toolchain/settings UI will display a button for it.
public class MyModSettings
{
    // The UI/framework which reads settings classes should detect this attribute
    // and render this property as a button (e.g., invoking the setter or an associated action).
    [ModdingToolchainUIButton]
    public bool RebuildToolchainButton { get; set; }
}

// Example of detecting the attribute via reflection:
var prop = typeof(MyModSettings).GetProperty(nameof(MyModSettings.RebuildToolchainButton));
bool isButton = prop.IsDefined(typeof(ModdingToolchainUIButtonAttribute), inherit: true);

Notes: - The attribute is only a marker; the UI/plugin code must interpret it and provide the button behavior. - Because AttributeUsage allows inheritance, derived types inheriting a decorated property will also be treated as having the attribute.