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 partial class ToggleableClothingComponent : Component
{
public const string DefaultClothingContainerId = "toggleable-clothing";
///
/// Action used to toggle the clothing on or off.
///
[DataField("action", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string Action = "ActionToggleSuitPiece";
[DataField("actionEntity")]
public EntityUid? ActionEntity;
///
/// Default clothing entity prototype to spawn into the clothing container.
///
[DataField("clothingPrototype", required: true, customTypeSerializer:typeof(PrototypeIdSerializer))]
public string ClothingPrototype = default!;
///
/// The inventory slot that the clothing is equipped to.
///
[ViewVariables(VVAccess.ReadWrite)]
[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;
///
/// Time it takes for this clothing to be toggled via the stripping menu verbs. Null prevents the verb from even showing up.
///
[DataField("stripDelay")]
public TimeSpan? StripDelay = TimeSpan.FromSeconds(3);
///
/// Text shown in the toggle-clothing verb. Defaults to using the name of the action.
///
[DataField("verbText")]
public string? VerbText;
}