make crayoncode use the colortype (#7975)

This commit is contained in:
Paul Ritter
2022-05-09 07:16:43 +02:00
committed by GitHub
parent aa61feb85d
commit 005321e484
8 changed files with 21 additions and 55 deletions

View File

@@ -11,13 +11,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.Crayon
{
[RegisterComponent]
public sealed class CrayonComponent : SharedCrayonComponent, ISerializationHooks
public sealed class CrayonComponent : SharedCrayonComponent
{
[DataField("useSound")] public SoundSpecifier? UseSound;
[ViewVariables]
public Color Color { get; private set; }
[ViewVariables(VVAccess.ReadWrite)]
[DataField("selectableColor")]
public bool SelectableColor { get; set; }
@@ -34,10 +31,5 @@ namespace Content.Server.Crayon
public bool DeleteEmpty = true;
[ViewVariables] public BoundUserInterface? UserInterface => Owner.GetUIOrNull(CrayonUiKey.Key);
void ISerializationHooks.AfterDeserialization()
{
Color = Color.FromName(_color);
}
}
}