Files
tbd-station-14/Content.Shared/GameObjects/Components/SharedMagicMirrorComponent.cs
RemberBL 343f183b32 Character eye customization, scroll bar in appearance tab character setup. Fixes #2946 (#3403)
* A lot of unfinished work, trying to figure stuff out but it ain't really working

* The eye colors finally work on the sprite!

* Big refactor for HumanoidProfileEditor, crashes upon making a lobby

* Fixed Lobby crashing

* Moves the eye selection box to a new tab, which fixes selection the box from going off-screen and not expanding the bars

* uncommented something I shouldn't have commented out

* Moved eye colors back to the appearance tab, still some ui glitches

* Made it possible to scroll in the appearance tab

* Added "Eye color:" label

* Migrating some deprecated functions into their replacements

* Merged two private sealed classes into one public class, removing duplication
2021-03-07 20:48:24 +01:00

76 lines
2.3 KiB
C#

#nullable enable
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components
{
public class SharedMagicMirrorComponent : Component
{
public override string Name => "MagicMirror";
[Serializable, NetSerializable]
public enum MagicMirrorUiKey
{
Key
}
[Serializable, NetSerializable]
public class HairSelectedMessage : BoundUserInterfaceMessage
{
public readonly string HairName;
public readonly bool IsFacialHair;
public HairSelectedMessage(string name, bool isFacialHair)
{
HairName = name;
IsFacialHair = isFacialHair;
}
}
[Serializable, NetSerializable]
public class HairColorSelectedMessage : BoundUserInterfaceMessage
{
public (byte r, byte g, byte b) HairColor;
public readonly bool IsFacialHair;
public HairColorSelectedMessage((byte r, byte g, byte b) color, bool isFacialHair)
{
HairColor = color;
IsFacialHair = isFacialHair;
}
}
[Serializable, NetSerializable]
public class EyeColorSelectedMessage : BoundUserInterfaceMessage
{
public (byte r, byte g, byte b) EyeColor;
public EyeColorSelectedMessage((byte r, byte g, byte b) color)
{
EyeColor = color;
}
}
[Serializable, NetSerializable]
public class MagicMirrorInitialDataMessage : BoundUserInterfaceMessage
{
public readonly Color HairColor;
public readonly Color FacialHairColor;
public readonly string HairName;
public readonly string FacialHairName;
public readonly Color EyeColor;
public MagicMirrorInitialDataMessage(Color hairColor, Color facialHairColor, string hairName, string facialHairName, Color eyeColor)
{
HairColor = hairColor;
FacialHairColor = facialHairColor;
HairName = hairName;
FacialHairName = facialHairName;
EyeColor = eyeColor;
}
}
}
}