using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Inventory;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Clothing.Components;
///
/// Allow players to change clothing sprite to any other clothing prototype.
///
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedChameleonClothingSystem))]
public sealed class ChameleonClothingComponent : Component
{
///
/// Filter possible chameleon options by their slot flag.
///
[ViewVariables(VVAccess.ReadOnly)]
[DataField("slot", required: true)]
public SlotFlags Slot;
///
/// EntityPrototype id that chameleon item is trying to mimic.
///
[ViewVariables(VVAccess.ReadOnly)]
[DataField("default", required: true, customTypeSerializer: typeof(PrototypeIdSerializer))]
public string? SelectedId;
///
/// Current user that wears chameleon clothing.
///
[ViewVariables]
public EntityUid? User;
}
[Serializable, NetSerializable]
public sealed class ChameleonClothingComponentState : ComponentState
{
public string? SelectedId;
}
[Serializable, NetSerializable]
public sealed class ChameleonBoundUserInterfaceState : BoundUserInterfaceState
{
public readonly SlotFlags Slot;
public readonly string? SelectedId;
public ChameleonBoundUserInterfaceState(SlotFlags slot, string? selectedId)
{
Slot = slot;
SelectedId = selectedId;
}
}
[Serializable, NetSerializable]
public sealed class ChameleonPrototypeSelectedMessage : BoundUserInterfaceMessage
{
public readonly string SelectedId;
public ChameleonPrototypeSelectedMessage(string selectedId)
{
SelectedId = selectedId;
}
}
[Serializable, NetSerializable]
public enum ChameleonUiKey : byte
{
Key
}