Skip to content

Game.UI.Tooltip.TooltipColor

Assembly:
Assembly-CSharp

Namespace:
Game.UI.Tooltip

Type:
public enum

Base:
System.Enum

Summary:
Defines the set of semantic colors that a tooltip can use in the game's UI. Each value represents a common message category (informational, success, warning, error) and is intended to be mapped to a visual color/style when rendering tooltips in the UI. Underlying integer values are the default enum ordinals (Info = 0, Success = 1, Warning = 2, Error = 3).


Fields

  • Info
    Represents a neutral or informational tooltip color (default/primary informational state).

  • Success
    Represents a positive state (e.g., confirmation, completed action).

  • Warning
    Represents a cautionary state that requires attention but is not an error.

  • Error
    Represents an error or critical state that needs immediate attention.

Properties

  • None
    This enum does not define properties.

Constructors

  • None (implicit)
    Enums do not declare constructors in C#. Values are the predefined enum members listed above.

Methods

  • None
    No methods are defined on this enum type.

Usage Example

using Game.UI.Tooltip;
using UnityEngine;

// Example: map tooltip enum to a Unity color for rendering
Color GetTooltipColor(TooltipColor tooltipColor)
{
    switch (tooltipColor)
    {
        case TooltipColor.Success:
            return new Color(0.2f, 0.8f, 0.2f); // green
        case TooltipColor.Warning:
            return new Color(1.0f, 0.7f, 0.0f); // orange
        case TooltipColor.Error:
            return new Color(1.0f, 0.2f, 0.2f); // red
        case TooltipColor.Info:
        default:
            return new Color(0.2f, 0.6f, 1.0f); // blue
    }
}

// Example usage when creating a tooltip
void ShowTooltip(string text, TooltipColor color)
{
    var uiColor = GetTooltipColor(color);
    // Pass uiColor to your UI tooltip component/renderer
}

Additional notes: - When modding, ensure your tooltip rendering code maps these enum values to the color/style used by your UI framework so that tooltips remain consistent with the game's visual language. - The enum is simple and stable; you can extend behavior by adding mappings or helper methods in your mod code but avoid changing the enum values themselves to preserve compatibility.