using Content.Shared.Actions.ActionTypes; using Content.Shared.Clothing.EntitySystems; using Content.Shared.Inventory; using Robust.Shared.Containers; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Shared.Clothing.Components; /// /// This component gives an item an action that will equip or un-equip some clothing. Intended for use with /// hardsuits and hardsuit helmets. /// [Access(typeof(ToggleableClothingSystem))] [RegisterComponent] public sealed class ToggleableClothingComponent : Component { public const string DefaultClothingContainerId = "toggleable-clothing"; /// /// Action used to toggle the clothing on or off. /// [DataField("actionId", customTypeSerializer: typeof(PrototypeIdSerializer))] public string ActionId = "ToggleSuitHelmet"; public InstantAction? ToggleAction = null; /// /// Default clothing entity prototype to spawn into the clothing container. /// [DataField("clothingPrototype", required: true, customTypeSerializer:typeof(PrototypeIdSerializer))] public readonly string ClothingPrototype = default!; /// /// The inventory slot that the clothing is equipped to. /// [DataField("slot")] public string Slot = "head"; /// /// The inventory slot flags required for this component to function. /// [DataField("requiredSlot")] public SlotFlags RequiredFlags = SlotFlags.OUTERCLOTHING; /// /// The container that the clothing is stored in when not equipped. /// [DataField("containerId")] public string ContainerId = DefaultClothingContainerId; [ViewVariables] public ContainerSlot? Container; /// /// The Id of the piece of clothing that belongs to this component. Required for map-saving if the clothing is /// currently not inside of the container. /// [DataField("clothingUid")] public EntityUid? ClothingUid; }