Skip to content

Game.UI.Widgets.WidgetChanges

Assembly:
Namespace: Game.UI.Widgets

Type: enum

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

Summary:
Represents a set of change flags for UI widgets. Marked with [Flags], the values can be combined to indicate multiple aspects of a widget that changed (for example: layout path, properties, children, visibility, activity). The enum uses a byte-sized underlying type to keep the flag storage compact.


Fields

  • None = 0
    Represents no changes.

  • Path = 1
    Indicates the widget's path (layout/positioning) has changed.

  • Properties = 2
    Indicates one or more widget properties have changed.

  • Children = 4
    Indicates the widget's children collection has changed (child added/removed/reordered).

  • Visibility = 8
    Indicates the widget's visibility state has changed.

  • Activity = 0x10
    Indicates the widget's activity/enabled state has changed (value 16 decimal).

  • TotalProperties = 0x1A
    Predefined mask combining property-related flags. 0x1A = 26 decimal which equals Properties (2) | Visibility (8) | Activity (16). Use this mask when you need to check or act on the full set of property-related changes.

Properties

  • This enum type has no properties. Use the flag values directly and standard Enum APIs when needed.

Constructors

  • Enum types are value types with compiler-generated behavior; there are no user-defined constructors for this enum. Values are the named constants listed above.

Methods

  • This enum inherits the standard System.Enum and System.ValueType methods such as ToString(), HasFlag(Enum), CompareTo(object), GetHashCode(), etc. Typical flag checks are done either with Enum.HasFlag or bitwise operations.

Usage Example

// Combine flags
WidgetChanges changes = WidgetChanges.Path | WidgetChanges.Properties;

// Check a flag (recommended: bitwise check is faster and null-safe)
bool hasPathChanged = (changes & WidgetChanges.Path) == WidgetChanges.Path;

// Using the predefined mask for property-related changes
bool hasAnyPropertyChange = (changes & WidgetChanges.TotalProperties) != WidgetChanges.None;

// Set a flag
changes |= WidgetChanges.Visibility;

// Clear a flag
changes &= ~WidgetChanges.Path;