using Content.Shared.DisplacementMap; using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Prototypes; using Content.Shared.Inventory; using Robust.Shared.Enums; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Utility; namespace Content.Shared.Humanoid; [NetworkedComponent, RegisterComponent, AutoGenerateComponentState(true)] public sealed partial class HumanoidAppearanceComponent : Component { public MarkingSet ClientOldMarkings = new(); [DataField, AutoNetworkedField] public MarkingSet MarkingSet = new(); [DataField] public Dictionary BaseLayers = new(); [DataField, AutoNetworkedField] public HashSet PermanentlyHidden = new(); // Couldn't these be somewhere else? [DataField, AutoNetworkedField] public Gender Gender; [DataField, AutoNetworkedField] public int Age = 18; /// /// Any custom base layers this humanoid might have. See: /// limb transplants (potentially), robotic arms, etc. /// Stored on the server, this is merged in the client into /// all layer settings. /// [DataField, AutoNetworkedField] public Dictionary CustomBaseLayers = new(); /// /// Current species. Dictates things like base body sprites, /// base humanoid to spawn, etc. /// [DataField(required: true), AutoNetworkedField] public ProtoId Species { get; set; } /// /// The initial profile and base layers to apply to this humanoid. /// [DataField] public ProtoId? Initial { get; private set; } /// /// Skin color of this humanoid. /// [DataField, AutoNetworkedField] public Color SkinColor { get; set; } = Color.FromHex("#C0967F"); /// /// A map of the visual layers currently hidden to the equipment /// slots that are currently hiding them. This will affect the base /// sprite on this humanoid layer, and any markings that sit above it. /// [DataField, AutoNetworkedField] public Dictionary HiddenLayers = new(); [DataField, AutoNetworkedField] public Sex Sex = Sex.Male; [DataField, AutoNetworkedField] public Color EyeColor = Color.Brown; /// /// Hair color of this humanoid. Used to avoid looping through all markings /// [ViewVariables(VVAccess.ReadOnly)] public Color? CachedHairColor; /// /// Facial Hair color of this humanoid. Used to avoid looping through all markings /// [ViewVariables(VVAccess.ReadOnly)] public Color? CachedFacialHairColor; /// /// Which layers of this humanoid that should be hidden on equipping a corresponding item.. /// [DataField] public HashSet HideLayersOnEquip = [HumanoidVisualLayers.Hair]; /// /// Which markings the humanoid defaults to when nudity is toggled off. /// [DataField] public ProtoId? UndergarmentTop = new ProtoId("UndergarmentTopTanktop"); [DataField] public ProtoId? UndergarmentBottom = new ProtoId("UndergarmentBottomBoxers"); /// /// The displacement maps that will be applied to specific layers of the humanoid. /// [DataField] public Dictionary MarkingsDisplacement = new(); } [DataDefinition] [Serializable, NetSerializable] public readonly partial struct CustomBaseLayerInfo { public CustomBaseLayerInfo(string? id, Color? color = null) { DebugTools.Assert(id == null || IoCManager.Resolve().HasIndex(id)); Id = id; Color = color; } /// /// ID of this custom base layer. Must be a . /// [DataField] public ProtoId? Id { get; init; } /// /// Color of this custom base layer. Null implies skin colour if the corresponding is set to match skin. /// [DataField] public Color? Color { get; init; } }