Skip to content

Game.Settings.SettingsUITabWarningAttribute

Assembly:
Assembly-CSharp (in-game)

Namespace:
Game.Settings

Type:
public class

Base:
System.Attribute

Summary:
Attribute used to associate a settings UI tab (by name) with a runtime check that can trigger a warning related to that tab. The attribute stores the tab identifier and a reference (Type + method name) to a check routine. Multiple instances of the attribute can be applied to the same class (AllowMultiple = true). The game will invoke the specified method on the provided type to determine whether a warning should be shown for the tab.


Fields

  • public readonly string tab
    Name or identifier of the settings UI tab this warning applies to. This is typically the tab label or internal tab key used by the settings UI.

  • public readonly Type checkType
    The Type that contains the method to be called to determine if the warning should be shown. Usually a class that implements the relevant checking logic.

  • public readonly string checkMethod
    Name of the method (on checkType) to invoke for the warning check. The expected signature of the method depends on how the game calls it (commonly a static method); see usage notes below.

Properties

  • None (the class exposes only readonly fields and no properties)

Constructors

  • public SettingsUITabWarningAttribute(string tab, Type checkType, string checkMethod)
    Creates a new attribute instance.

Parameters: - tab: The settings tab name or key the warning targets. - checkType: The Type that contains the check method. - checkMethod: The name of the method on checkType to call to evaluate whether a warning should be shown.

Methods

  • None declared (only the constructor; inherits standard System.Attribute members)

Usage Example

// Example checker class. The exact required signature depends on the game.
// Commonly this will be a static method returning bool (true = show warning).
public static class MySettingsChecks
{
    public static bool IsNetworkModeIncompatible()
    {
        // implement check logic...
        return true; // example: condition met => show warning
    }
}

// Apply the attribute to a settings UI tab class.
// Multiple attributes can be applied to the same class if needed.
[SettingsUITabWarning("Network", typeof(MySettingsChecks), nameof(MySettingsChecks.IsNetworkModeIncompatible))]
public class NetworkSettingsTab
{
    // Settings tab implementation...
}

Notes: - AttributeUsage: targets classes and allows multiple attributes on the same class. - The game code is responsible for invoking the check method; ensure the method on checkType has the signature expected by the game (commonly a parameterless static bool, but it may vary). If unsure, inspect the game's usage or other mods for examples.