Game.Notifications.IconFlags
Assembly: Assembly-CSharp.dll
Namespace: Game.Notifications
Type: public enum (flags)
Base: System.Byte
Summary: IconFlags is a bitmask enum used by the notification/icon system to describe how an icon should behave or where it should be shown. The [Flags] attribute means multiple values can be combined via bitwise OR to express multiple behaviors at once. The enum uses a byte as the underlying storage and is intended to be lightweight for per-notification usage.
Fields
-
Unique = 1
Indicates the icon/notification is unique. Typically used to prevent stacking or duplicate notifications/icons for the same logical event or entity. -
IgnoreTarget = 2
Specifies the icon should ignore a default target object (for example, not be tied to the usual entity that generated the notification). Useful when you want an icon shown independently of an entity target. -
TargetLocation = 4
Tells the system to place the icon at the main target location (often the position of the related entity or tile). Combine with other flags to control layering/offsets. -
OnTop = 8
Requests that the icon is rendered on top of others (higher visual priority). Useful for important notifications that should not be occluded by other icons. -
SecondaryLocation = 0x10
Indicates the icon should be placed at a secondary location (for example, an alternate spot related to the notification, such as a custom marker or linked building). This is distinct from TargetLocation. -
CustomLocation = 0x20
Means a custom location (likely provided programmatically) will be used for the icon placement instead of standard target/secondary locations.
Properties
- None
This enum has no associated instance properties. It is used as a set of named constants to be combined and tested via bitwise operations or Enum methods.
Constructors
- Enums have no user-defined constructors.
IconFlags has the standard implicit enum constructor and can be cast from/to its underlying byte value when required.
Methods
- None specific to this enum.
Standard System.Enum methods (ToString, HasFlag, Parse, etc.) are available. Typical operations are performed with bitwise operators or Enum.HasFlag for readability.
Usage Example
// Combining flags to create a notification icon that is unique, placed at the target location,
// and rendered on top.
IconFlags flags = IconFlags.Unique | IconFlags.TargetLocation | IconFlags.OnTop;
// Check for a specific flag (bitwise):
bool usesTargetLocation = (flags & IconFlags.TargetLocation) != 0;
// Or using Enum.HasFlag (slower but clearer):
if (flags.HasFlag(IconFlags.OnTop))
{
// Give this icon rendering priority
}
// Example: applying flags to a hypothetical notification object
var notification = new Notification
{
Title = "Power Outage",
Message = "Substation overloaded",
IconFlags = flags // assuming Notification has an IconFlags property
};