Files
tbd-station-14/Content.Shared/CharacterAppearance/Components/HumanoidAppearanceComponent.cs
Kara 2d5ec7f85c Id[entity] 2.0 (real) (#9612)
* starter API

* network ID cards

* Port more stuff from old identity

* Re-implement identity representation + name updating

* move

* proper name returning for `IdentityName`

* move everything important to server, give in to  temptation

* shared / server / client split sadly. move ensure to shared and spawn to server

* identity update queueing + identityblocker

* fixes

* and just like that it's usable for admins

* huge identity pass

* pass dos

* jesus christ

* figs :D

* fuck u

* fix bad merge.

Co-authored-by: Moony <moonheart08@users.noreply.github.com>
2022-07-10 20:36:53 -05:00

78 lines
2.5 KiB
C#

using Content.Shared.CharacterAppearance.Systems;
using Content.Shared.Preferences;
using Content.Shared.Species;
using Robust.Shared.Enums;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.CharacterAppearance.Components
{
[RegisterComponent]
[Access(typeof(SharedHumanoidAppearanceSystem), typeof(SharedMagicMirrorComponent))]
[NetworkedComponent]
public sealed class HumanoidAppearanceComponent : Component
{
[ViewVariables]
public HumanoidCharacterAppearance Appearance { get; set; } = HumanoidCharacterAppearance.Default();
[ViewVariables(VVAccess.ReadWrite)]
public Sex Sex { get; set; } = default!;
[ViewVariables(VVAccess.ReadWrite)]
public Gender Gender { get; set; } = default!;
[ViewVariables]
public string Species { get; set; } = SpeciesManager.DefaultSpecies;
[ViewVariables(VVAccess.ReadWrite)]
public int Age { get; set; } = HumanoidCharacterProfile.MinimumAge;
[DataField("categoriesHair")]
[ViewVariables]
public SpriteAccessoryCategories CategoriesHair { get; set; } = SpriteAccessoryCategories.HumanHair;
[DataField("categoriesFacialHair")]
[ViewVariables]
public SpriteAccessoryCategories CategoriesFacialHair { get; set; } = SpriteAccessoryCategories.HumanFacialHair;
[ViewVariables]
[DataField("canColorHair")]
public bool CanColorHair { get; set; } = true;
[ViewVariables]
[DataField("canColorFacialHair")]
public bool CanColorFacialHair { get; set; } = true;
[ViewVariables]
[DataField("hairMatchesSkin")]
public bool HairMatchesSkin { get; set; } = false;
[ViewVariables]
[DataField("hairAlpha")]
public float HairAlpha { get; set; } = 1.0f;
}
[Serializable, NetSerializable]
public sealed class HumanoidAppearanceComponentState : ComponentState
{
public HumanoidCharacterAppearance Appearance { get; }
public Sex Sex { get; }
public Gender Gender { get; }
public string Species { get; }
public int Age { get; }
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance,
Sex sex,
Gender gender,
string species,
int age)
{
Appearance = appearance;
Sex = sex;
Gender = gender;
Species = species;
Age = age;
}
}
}