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

@@ -8,7 +8,6 @@ namespace Content.Client.Crayon
public sealed class CrayonComponent : SharedCrayonComponent
{
[ViewVariables(VVAccess.ReadWrite)] public bool UIUpdateNeeded;
[ViewVariables(VVAccess.ReadWrite)] public string Color => _color;
[ViewVariables] public int Charges { get; set; }
[ViewVariables] public int Capacity { get; set; }
}

View File

@@ -11,7 +11,7 @@ using Robust.Shared.Timing;
namespace Content.Client.Crayon;
public sealed class CrayonSystem : EntitySystem
public sealed class CrayonSystem : SharedCrayonSystem
{
// Didn't do in shared because I don't think most of the server stuff can be predicted.
public override void Initialize()
@@ -25,7 +25,7 @@ public sealed class CrayonSystem : EntitySystem
{
if (args.Current is not CrayonComponentState state) return;
component._color = state.Color;
component.Color = state.Color;
component.SelectedState = state.State;
component.Charges = state.Charges;
component.Capacity = state.Capacity;

View File

@@ -40,7 +40,7 @@ namespace Content.Client.Crayon.UI
SendMessage(new CrayonSelectMessage(state));
}
public void SelectColor(string color)
public void SelectColor(Color color)
{
SendMessage(new CrayonColorMessage(color));
}

View File

@@ -37,7 +37,7 @@ namespace Content.Client.Crayon.UI
{
_color = color;
Owner.SelectColor(color.ToHex());
Owner.SelectColor(color);
RefreshList();
}