Skip to content

Game.UI.InGame.VoltageLocaleKey

Assembly:
Game

Namespace: Game.UI.InGame

Type:
enum

Base:
System.Enum

Summary:
VoltageLocaleKey is a small enum used by the in-game UI to represent which voltage-related localization key should be used or displayed. Typical uses include selecting the correct localized label or tooltip for low-voltage networks, high-voltage networks, or when both categories are relevant.


Fields

  • Low
    Represents the "low" voltage localization key (e.g., labels or tooltips for low-voltage lines/networks).

  • High
    Represents the "high" voltage localization key (e.g., labels or tooltips for high-voltage lines/networks).

  • Both
    Represents a combined or both-voltage localization key (used when UI needs to refer to both low and high voltage together).

Properties

  • None.
    This enum exposes no properties.

Constructors

  • None (default enum behavior).
    As an enum, no custom constructors are defined; values are the named constants above backed by an integral type.

Methods

  • None.
    No instance or static methods are defined on this enum.

Usage Example

// Example: choose a localization key based on the enum value
VoltageLocaleKey key = VoltageLocaleKey.Low;

string localeKey = key switch
{
    VoltageLocaleKey.Low => "VOLTAGE_LOW",
    VoltageLocaleKey.High => "VOLTAGE_HIGH",
    VoltageLocaleKey.Both => "VOLTAGE_BOTH",
    _ => "VOLTAGE_UNKNOWN"
};

// Replace Localize(...) with the project's localization API
string localizedText = Localize(localeKey);
myLabel.text = localizedText;

// Or use in UI logic to control visibility or filters:
if (key == VoltageLocaleKey.Both)
{
    ShowLowVoltageControls(true);
    ShowHighVoltageControls(true);
}
else if (key == VoltageLocaleKey.Low)
{
    ShowLowVoltageControls(true);
    ShowHighVoltageControls(false);
}
else // High
{
    ShowLowVoltageControls(false);
    ShowHighVoltageControls(true);
}

Notes: - The exact localization key strings ("VOLTAGE_LOW", etc.) are examples — match them to the game's actual localization keys. - This enum is intended for UI decision-making and localization selection only; it does not contain any runtime behavior by itself.