Files
tbd-station-14/Content.Shared/Clothing/Components/SharedClothingComponent.cs
Alex Evgrashin 9ce3a18e3f Chameleon clothing (#8444)
Co-authored-by: Moony <moonheart08@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2022-09-14 18:42:14 +10:00

68 lines
2.0 KiB
C#

using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Inventory;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Clothing.Components;
/// <summary>
/// This handles entities which can be equipped.
/// </summary>
[NetworkedComponent]
[Access(typeof(ClothingSystem), typeof(InventorySystem))]
public abstract class SharedClothingComponent : Component
{
[DataField("clothingVisuals")]
[Access(typeof(ClothingSystem), typeof(InventorySystem), Other = AccessPermissions.ReadExecute)] // TODO remove execute permissions.
public Dictionary<string, List<SharedSpriteComponent.PrototypeLayerData>> ClothingVisuals = new();
[ViewVariables(VVAccess.ReadWrite)]
[DataField("quickEquip")]
public bool QuickEquip = true;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("slots", required: true)]
[Access(typeof(ClothingSystem), typeof(InventorySystem), Other = AccessPermissions.ReadExecute)]
public SlotFlags Slots = SlotFlags.NONE;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("equipSound")]
public SoundSpecifier? EquipSound;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("unequipSound")]
public SoundSpecifier? UnequipSound;
[Access(typeof(ClothingSystem))]
[ViewVariables(VVAccess.ReadWrite)]
[DataField("equippedPrefix")]
public string? EquippedPrefix;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("sprite")]
public string? RsiPath;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("femaleMask")]
public FemaleClothingMask FemaleMask = FemaleClothingMask.UniformFull;
}
[Serializable, NetSerializable]
public sealed class ClothingComponentState : ComponentState
{
public string? EquippedPrefix;
public ClothingComponentState(string? equippedPrefix)
{
EquippedPrefix = equippedPrefix;
}
}
public enum FemaleClothingMask : byte
{
NoMask = 0,
UniformFull,
UniformTop
}