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!
///
[Prototype("statusIcon")]
public sealed partial class StatusIconPrototype : StatusIconData, IPrototype, IInheritingPrototype
{
///
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer))]
public string[]? Parents { get; }
///
[NeverPushInheritance]
[AbstractDataField]
public bool Abstract { get; }
///
[IdDataField]
public string ID { get; private set; } = default!;
}
[Serializable, NetSerializable]
public enum StatusIconLocationPreference : byte
{
None,
Left,
Right,
}
public enum StatusIconLayer : byte
{
Base,
Mod,
}