Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using System.Linq;
|
||||
using Content.Shared.Preferences;
|
||||
using Robust.Shared.GameObjects.Components.Localization;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Humanoid;
|
||||
|
||||
@@ -31,7 +30,6 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<HumanoidAppearanceComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<HumanoidAppearanceComponent, ComponentGetState>(OnGetState);
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, HumanoidAppearanceComponent humanoid, ComponentInit args)
|
||||
@@ -57,20 +55,6 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
LoadProfile(uid, startingSet.Profile, humanoid);
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, HumanoidAppearanceComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new HumanoidAppearanceState(component.MarkingSet,
|
||||
component.PermanentlyHidden,
|
||||
component.HiddenLayers,
|
||||
component.CustomBaseLayers,
|
||||
component.Sex,
|
||||
component.Gender,
|
||||
component.Age,
|
||||
component.Species,
|
||||
component.SkinColor,
|
||||
component.EyeColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggles a humanoid's sprite layer visibility.
|
||||
/// </summary>
|
||||
@@ -211,7 +195,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (humanoid.CustomBaseLayers.TryGetValue(layer, out var info))
|
||||
humanoid.CustomBaseLayers[layer] = info with { ID = id };
|
||||
humanoid.CustomBaseLayers[layer] = info with { Id = id };
|
||||
else
|
||||
humanoid.CustomBaseLayers[layer] = new(id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user