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; namespace Content.Shared.Clothing.Components; /// /// Allow players to change clothing sprite to any other clothing prototype. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause] [Access(typeof(SharedChameleonClothingSystem))] public sealed partial class ChameleonClothingComponent : Component { /// /// Filter possible chameleon options by their slot flag. /// [DataField(required: true)] public SlotFlags Slot; /// /// EntityPrototype id that chameleon item is trying to mimic. /// [DataField(required: true), AutoNetworkedField] public EntProtoId? Default; /// /// Current user that wears chameleon clothing. /// [ViewVariables] public EntityUid? User; /// /// Filter possible chameleon options by a tag in addition to WhitelistChameleon. /// [DataField] public string? RequireTag; /// /// Will component owner be affected by EMP pulses? /// [DataField] public bool AffectedByEmp = true; /// /// Intensity of clothes change on EMP. /// Can be interpreted as "How many times clothes will change every second?". /// Useless without set to true. /// [DataField] public int EmpChangeIntensity = 7; /// /// Should the EMP-change happen continuously, or only once? /// (False = once, True = continuously) /// Useless without /// [DataField] public bool EmpContinuous = true; /// /// When should next EMP-caused appearance change happen? /// [AutoPausedField, DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextEmpChange = TimeSpan.Zero; } [Serializable, NetSerializable] public sealed class ChameleonBoundUserInterfaceState : BoundUserInterfaceState { public readonly SlotFlags Slot; public readonly string? SelectedId; public readonly string? RequiredTag; public ChameleonBoundUserInterfaceState(SlotFlags slot, string? selectedId, string? requiredTag) { Slot = slot; SelectedId = selectedId; RequiredTag = requiredTag; } } [Serializable, NetSerializable] public sealed class ChameleonPrototypeSelectedMessage : BoundUserInterfaceMessage { public readonly string SelectedId; public ChameleonPrototypeSelectedMessage(string selectedId) { SelectedId = selectedId; } } [Serializable, NetSerializable] public enum ChameleonUiKey : byte { Key }