Hair style improvements:
1. made the magic mirror actually reflect your current hair state when you open it. 2. Made magic mirror one window. 3. Use color sliders for magic mirror.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Content.Shared.Preferences.Appearance;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -8,10 +9,12 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
{
|
||||
public abstract class SharedHairComponent : Component
|
||||
{
|
||||
private string _facialHairStyleName;
|
||||
private string _hairStyleName;
|
||||
private Color _hairColor;
|
||||
private Color _facialHairColor;
|
||||
private static readonly Color DefaultHairColor = Color.FromHex("#232323");
|
||||
|
||||
private string _facialHairStyleName = HairStyles.DefaultFacialHairStyle;
|
||||
private string _hairStyleName = HairStyles.DefaultHairStyle;
|
||||
private Color _hairColor = DefaultHairColor;
|
||||
private Color _facialHairColor = DefaultHairColor;
|
||||
|
||||
public sealed override string Name => "Hair";
|
||||
public sealed override uint? NetID => ContentNetIDs.HAIR;
|
||||
@@ -76,6 +79,16 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
FacialHairColor = cast.FacialHairColor;
|
||||
}
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _hairColor, "hairColor", DefaultHairColor);
|
||||
serializer.DataField(ref _facialHairColor, "facialHairColor", DefaultHairColor);
|
||||
serializer.DataField(ref _hairStyleName, "hairStyle", HairStyles.DefaultHairStyle);
|
||||
serializer.DataField(ref _facialHairStyleName, "facialHairStyle", HairStyles.DefaultFacialHairStyle);
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
private sealed class HairComponentState : ComponentState
|
||||
{
|
||||
|
||||
@@ -32,14 +32,31 @@ namespace Content.Shared.GameObjects.Components
|
||||
[Serializable, NetSerializable]
|
||||
public class HairColorSelectedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly Color HairColor;
|
||||
public (byte r, byte g, byte b) HairColor;
|
||||
public readonly bool IsFacialHair;
|
||||
|
||||
public HairColorSelectedMessage(Color color, bool isFacialHair)
|
||||
public HairColorSelectedMessage((byte r, byte g, byte b) color, bool isFacialHair)
|
||||
{
|
||||
HairColor = color;
|
||||
IsFacialHair = isFacialHair;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class MagicMirrorInitialDataMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly Color HairColor;
|
||||
public readonly Color FacialHairColor;
|
||||
public readonly string HairName;
|
||||
public readonly string FacialHairName;
|
||||
|
||||
public MagicMirrorInitialDataMessage(Color hairColor, Color facialHairColor, string hairName, string facialHairName)
|
||||
{
|
||||
HairColor = hairColor;
|
||||
FacialHairColor = facialHairColor;
|
||||
HairName = hairName;
|
||||
FacialHairName = facialHairName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user