Skip to content

Game.Input.BuiltInUsages

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

Type: enum (flags)

Base: System.Enum (underlying type: System.Int32)

Summary: A bitmask enum that defines named input "usage" categories for the game's built-in input handling. Marked with [Flags], each value represents a distinct input context (menus, tools, overlays, debug, etc.). These are used to classify, enable/disable or query sets of input consumers in the game’s input system. {{ This enum is used by the game's input code to decide which input contexts are active or should receive input. The values are powers-of-two so they can be combined with bitwise operations. } }


Fields

  • Menu = 1 {{ Input context used by in-game menus and UI screens. When this bit is set, input is being consumed by menu UI. }}

  • DefaultTool = 2 {{ The "default" gameplay tool context (main gameplay tool). Represents standard tool input handling that is active when no other higher-priority tool is in use. }}

  • Overlay = 4 {{ Input used by overlays (map overlays, information layers, HUD overlays). Typically overlays that react to or display input. }}

  • Tool = 8 {{ General tool input context (separate from DefaultTool). Used for tools registered as tools but not as the default. }}

  • CancelableTool = 0x10 {{ Tools that can be canceled (for example via Esc or cancel button). This distinguishes tools with cancel semantics from others. }}

  • Debug = 0x20 {{ Debug-mode input hooks (console, dev tools, hotkeys used only in debug builds or with debug UI). }}

  • Editor = 0x40 {{ Editor-specific input contexts (map/editor UIs available in an editor mode). }}

  • PhotoMode = 0x80 {{ Input context for photo mode (camera controls, UI for taking screenshots). }}

  • Options = 0x100 {{ Input context for options/settings UI. }}

  • Tutorial = 0x200 {{ Input context for in-game tutorial overlays and guided interactions. }}

  • DiscardableTool = 0x400 {{ Tools that are discardable — a distinct classification used by the game to treat certain transient tools differently. }}

  • All = 0x7FF {{ Convenience mask with all defined built-in usage bits set (bits 0..10). Equivalent to combining every built-in usage value. }}

  • DefaultSet = 0x41E {{ Predefined combination mask (0x41E = DiscardableTool | CancelableTool | Tool | Overlay | DefaultTool). Represents the engine's default set of tool/overlay-related usages (note: this mask intentionally excludes Menu). }}

Properties

  • None (enum has no explicit properties) {{ Use the enum values directly; standard System.Enum static methods (e.g., Enum.GetValues, Enum.HasFlag via instance) are available. }}

Constructors

  • None (enumeration values are constants) {{ Enums are value types and values are assigned as constants. There is no public constructor to create new named enum members at runtime. }}

Methods

  • None defined on this type (in addition to System.Enum / System.ValueType members) {{ The enum doesn’t define instance methods. Use bitwise operators (&, |, ~) or Enum.HasFlag to test and combine usage values. }}

Usage Example

// Combine usages
BuiltInUsages active = BuiltInUsages.DefaultTool | BuiltInUsages.Overlay;

// Check if a specific usage is present
bool hasOverlay = (active & BuiltInUsages.Overlay) != 0;
// or
bool hasDefaultTool = active.HasFlag(BuiltInUsages.DefaultTool);

// Toggle a usage on
active |= BuiltInUsages.CancelableTool;

// Remove a usage
active &= ~BuiltInUsages.Overlay;

// Check if active matches the engine's DefaultSet (any overlap)
bool hasDefaultSetOverlap = (active & BuiltInUsages.DefaultSet) != 0;

// Check for full "All"
bool isAll = active == BuiltInUsages.All;

{{ Notes for modders: - The [Flags] attribute means values are meant to be combined. Use bitwise ops or HasFlag. - Avoid creating conflicting values unless you control both producer and consumer code. The built-in enum covers bits 0..10; if you must define custom usages in mods, prefer using higher, unused bits and coordinate with other mods to avoid collisions. - DefaultSet is a convenience mask used by the game to represent a typical set of active tool-related usages; it intentionally excludes Menu so menu input can be handled separately. - When serializing or persisting flags, store as integers or strings carefully (prefer integers for exact bitmask preservation). }}