Skip to content

Game.Settings.SettingsUISectionAttribute

Assembly: Assembly-CSharp
Namespace: Game.Settings

Type: public class

Base: System.Attribute

Summary:
Attribute used to mark settings-related classes or properties with UI section metadata for the in-game settings UI. It specifies which tab the setting belongs to and groups for "simple" and "advanced" UI presentations. The attribute can be applied to classes or properties, supports inheritance, and multiple instances per target. If a null tab is provided, the tab defaults to "General". If group parameters are null they default to empty strings.


Fields

  • public const string kGeneral = "General"
    Provides the fallback/default tab name ("General") used when a null tab value is supplied.

  • public readonly string tab
    The tab name in the settings UI where the marked class/property should appear. If constructed with null, this becomes "General".

  • public readonly string simpleGroup
    The name of the "simple" group for the settings UI (intended for basic/commonly used controls). Defaults to an empty string if null is supplied.

  • public readonly string advancedGroup
    The name of the "advanced" group for the settings UI (intended for advanced/less common controls). Defaults to an empty string if null is supplied.

Properties

  • None. This attribute exposes its data via readonly fields.

Constructors

  • public SettingsUISectionAttribute(string tab, string simpleGroup, string advancedGroup)
    Creates the attribute specifying an explicit tab and distinct simple and advanced group names. Null tab is treated as "General"; null group strings are treated as empty strings.

  • public SettingsUISectionAttribute(string tab, string group)
    Creates the attribute specifying a tab and a single group name used for both simple and advanced groups (calls the three-parameter constructor with group used for both).

  • public SettingsUISectionAttribute(string group)
    Creates the attribute specifying only a group (used for both simple and advanced) and uses the default tab ("General") when applied (calls the two-parameter constructor with null tab).

Methods

  • None beyond the constructors. This attribute contains no instance methods or properties.

Usage Example

// Apply to a class: specify tab + distinct simple/advanced groups
[SettingsUISection("Graphics", "Quality", "AdvancedQuality")]
public class GraphicsSettings
{
    // ...
}

// Apply to a property: single group used for both simple and advanced, default tab ("General")
[SettingsUISection("Display")]
public int Resolution { get; set; }

// Apply with explicit tab and same group for both simple and advanced
[SettingsUISection("Audio", "Volume")]
public class AudioSettings
{
    // ...
}