using Content.Shared.Stealth.Components; using Content.Shared.Whitelist; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array; using Robust.Shared.Utility; namespace Content.Shared.StatusIcon; /// /// A data structure that holds relevant /// information for status icons. /// [Virtual, DataDefinition] public partial class StatusIconData : IComparable { /// /// The icon that's displayed on the entity. /// [DataField(required: true)] public SpriteSpecifier Icon = default!; /// /// A priority for the order in which the icons will be displayed. /// [DataField] public int Priority = 10; /// /// Whether or not to hide the icon to ghosts /// [DataField] public bool VisibleToGhosts = true; /// /// Whether or not to hide the icon when we are inside a container like a locker or a crate. /// [DataField] public bool HideInContainer = true; /// /// Whether or not to hide the icon when the entity has an active /// [DataField] public bool HideOnStealth = true; /// /// Specifies what entities and components/tags this icon can be shown to. /// [DataField] public EntityWhitelist? ShowTo; /// /// A preference for where the icon will be displayed. None | Left | Right /// [DataField] public StatusIconLocationPreference LocationPreference = StatusIconLocationPreference.None; /// /// The layer the icon is displayed on. Mod is drawn above Base. Base | Mod /// [DataField] public StatusIconLayer Layer = StatusIconLayer.Base; /// /// Offset of the status icon, up and down only. /// [DataField] public int Offset = 0; /// /// Sets if the icon should be rendered with or without the effect of lighting. /// [DataField] public bool IsShaded = false; public int CompareTo(StatusIconData? other) { return Priority.CompareTo(other?.Priority ?? int.MaxValue); } } /// /// but in new convenient prototype form! /// public abstract partial class StatusIconPrototype : StatusIconData, IPrototype { /// [IdDataField] public string ID { get; private set; } = default!; } /// /// StatusIcons for showing jobs on the sec HUD /// [Prototype] public sealed partial class JobIconPrototype : StatusIconPrototype, IInheritingPrototype { /// [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; } /// [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; } /// /// Name of the icon used for menu tooltips. /// [DataField] public string JobName { get; private set; } = string.Empty; [ViewVariables(VVAccess.ReadOnly)] public string LocalizedJobName => Loc.GetString(JobName); /// /// Should the agent ID or ID card console be able to use this job icon? /// [DataField] public bool AllowSelection = true; } /// /// StatusIcons for the med HUD /// [Prototype] public sealed partial class HealthIconPrototype : StatusIconPrototype, IInheritingPrototype { /// [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; } /// [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; } } /// /// StatusIcons for the beer goggles and fried onion goggles /// [Prototype] public sealed partial class SatiationIconPrototype : StatusIconPrototype, IInheritingPrototype { /// [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; } /// [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; } } /// /// StatusIcons for showing the wanted status on the sec HUD /// [Prototype] public sealed partial class SecurityIconPrototype : StatusIconPrototype, IInheritingPrototype { /// [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; } /// [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; } } /// /// StatusIcons for faction membership /// [Prototype] public sealed partial class FactionIconPrototype : StatusIconPrototype, IInheritingPrototype { /// [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; } /// [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; } } /// /// StatusIcons for debugging purposes /// [Prototype] public sealed partial class DebugIconPrototype : StatusIconPrototype, IInheritingPrototype { /// [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; } /// [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; } } /// /// StatusIcons for the SSD indicator /// [Prototype] public sealed partial class SsdIconPrototype : StatusIconPrototype, IInheritingPrototype { /// [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; } /// [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; } } [Serializable, NetSerializable] public enum StatusIconLocationPreference : byte { None, Left, Right, } public enum StatusIconLayer : byte { Base, Mod, }