more component ref removal + combining server/client comps (#13178)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Humanoid;
|
||||
|
||||
public abstract class SharedHumanoidComponent : Component
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class HumanoidComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Current species. Dictates things like base body sprites,
|
||||
@@ -32,6 +36,40 @@ public abstract class SharedHumanoidComponent : Component
|
||||
[ViewVariables] public readonly HashSet<HumanoidVisualLayers> HiddenLayers = new();
|
||||
|
||||
[DataField("sex")] public Sex Sex = Sex.Male;
|
||||
|
||||
public MarkingSet CurrentMarkings = new();
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public Dictionary<HumanoidVisualLayers, CustomBaseLayerInfo> CustomBaseLayers = new();
|
||||
|
||||
public HashSet<HumanoidVisualLayers> PermanentlyHidden = new();
|
||||
|
||||
public HashSet<HumanoidVisualLayers> AllHiddenLayers
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new HashSet<HumanoidVisualLayers>(HiddenLayers);
|
||||
result.UnionWith(PermanentlyHidden);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// Couldn't these be somewhere else?
|
||||
[ViewVariables] public Gender Gender = default!;
|
||||
[ViewVariables] public int Age = 18;
|
||||
|
||||
[ViewVariables] public List<Marking> CurrentClientMarkings = new();
|
||||
|
||||
public Dictionary<HumanoidVisualLayers, HumanoidSpeciesSpriteLayer> BaseLayers = new();
|
||||
|
||||
public string LastSpecies = default!;
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
Reference in New Issue
Block a user