Skip to content

Game.Prefabs.ToolErrorFlags

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: enum

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

Summary:
ToolErrorFlags is an enumeration used to describe behavior flags for tool error reporting/handling within the game (likely intended to be used as bit flags). Individual values indicate conditions under which a tool error is only temporary or should be disabled in the in-game or editor contexts. These values are powers of two so they can be combined with bitwise operations.


Fields

  • TemporaryOnly = 1
    Indicates the error/state is temporary only (short-lived) — typically used to signal a transient issue that may not require persistent handling.

  • DisableInGame = 2
    Indicates the tool (or error) should be disabled when running in the in-game context (not the editor).

  • DisableInEditor = 4
    Indicates the tool (or error) should be disabled when running in the editor context.

Properties

  • (None)
    This enum does not declare any properties.

Constructors

  • (None)
    Enums do not have explicit constructors in user code; instances are the defined named values.

Methods

  • (None)
    This enum does not declare methods. Use standard Enum methods (e.g., ToString) or bitwise operations for manipulation.

Usage Example

// Combine flags
ToolErrorFlags flags = ToolErrorFlags.TemporaryOnly | ToolErrorFlags.DisableInGame;

// Check if a specific flag is set (bitwise)
bool isDisabledInGame = (flags & ToolErrorFlags.DisableInGame) != 0;

// Alternatively, using Enum.HasFlag (slower, boxed)
bool hasTemporaryOnly = flags.HasFlag(ToolErrorFlags.TemporaryOnly);

// Example conditional behavior
if ((flags & ToolErrorFlags.DisableInEditor) != 0)
{
    // skip or alter behavior when running in editor
}

Notes: - The enum is defined with explicit bit values (1, 2, 4) so it functions as a bitmask. If you expect code to use combined flag string representations (e.g., "TemporaryOnly, DisableInGame"), consider decorating the enum with the [Flags] attribute when extending or duplicating it in your mod code: csharp [Flags] public enum ToolErrorFlags { ... } - When checking flags in performance-critical code, prefer bitwise operations over Enum.HasFlag to avoid boxing.