Skip to content

Game.Settings.SettingsUIShowGroupNameAttribute

Assembly: Assembly-CSharp.dll
Namespace: Game.Settings

Type: class

Base: System.Attribute

Summary:
Attribute used to control whether the in-game settings UI displays group names for a settings class or struct. Can be applied to classes or structs (inherited). When constructed with no arguments it signals "show all group names"; when constructed with string arguments it restricts display to the supplied group names.

Attribute usage: [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)]


Fields

  • public readonly System.Boolean showAll
    Indicates that the UI should show group names for all groups. Set to true by the parameterless constructor; left false by the constructor that accepts specific group names.

  • public readonly System.Collections.ObjectModel.ReadOnlyCollection<System.String> groups
    When specified via the constructor that takes params string[], this collection contains the names of groups that should be shown in the UI. If null (as with the parameterless constructor) the attribute is indicating "show all" via showAll.

Properties

  • None.

Constructors

  • public SettingsUIShowGroupNameAttribute()
    Creates the attribute and sets showAll = true. Use this to indicate the settings UI should display all group names.

  • public SettingsUIShowGroupNameAttribute(params string[] groups)
    Creates the attribute and initializes the groups collection with the provided group name strings. Use this to indicate the settings UI should display only the specified group names. Note: this constructor does not set showAll to true.

Methods

  • None.

Usage Example

// Show all group names in the settings UI
[SettingsUIShowGroupName]
public class MySettings
{
    // ...
}

// Show only the "Audio" and "Graphics" groups in the settings UI
[SettingsUIShowGroupName("Audio", "Graphics")]
public class MyOtherSettings
{
    // ...
}