2021-07-12 01:32:10 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2020-10-13 13:40:05 +02:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Crayon
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
2022-06-07 15:26:28 +02:00
|
|
|
[NetworkedComponent, ComponentProtoName("Crayon"), Access(typeof(SharedCrayonSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public abstract partial class SharedCrayonComponent : Component
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
2021-02-27 04:12:09 +01:00
|
|
|
public string SelectedState { get; set; } = string.Empty;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
2022-11-16 20:22:11 +01:00
|
|
|
[DataField("color")] public Color Color;
|
2020-10-13 13:40:05 +02:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-06 23:32:32 +11:00
|
|
|
public enum CrayonUiKey : byte
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
|
|
|
|
Key,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class CrayonSelectMessage : BoundUserInterfaceMessage
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
|
|
|
|
public readonly string State;
|
|
|
|
|
public CrayonSelectMessage(string selected)
|
|
|
|
|
{
|
|
|
|
|
State = selected;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-28 05:23:45 -07:00
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public sealed class CrayonColorMessage : BoundUserInterfaceMessage
|
|
|
|
|
{
|
2022-05-09 07:16:43 +02:00
|
|
|
public readonly Color Color;
|
|
|
|
|
public CrayonColorMessage(Color color)
|
2022-04-28 05:23:45 -07:00
|
|
|
{
|
|
|
|
|
Color = color;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-13 13:40:05 +02:00
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum CrayonVisuals
|
|
|
|
|
{
|
|
|
|
|
State,
|
2021-10-13 02:56:35 -04:00
|
|
|
Color
|
2020-10-13 13:40:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class CrayonComponentState : ComponentState
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
2022-05-09 07:16:43 +02:00
|
|
|
public readonly Color Color;
|
2020-10-13 13:40:05 +02:00
|
|
|
public readonly string State;
|
|
|
|
|
public readonly int Charges;
|
|
|
|
|
public readonly int Capacity;
|
|
|
|
|
|
2022-05-09 07:16:43 +02:00
|
|
|
public CrayonComponentState(Color color, string state, int charges, int capacity)
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
|
|
|
|
Color = color;
|
|
|
|
|
State = state;
|
|
|
|
|
Charges = charges;
|
|
|
|
|
Capacity = capacity;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class CrayonBoundUserInterfaceState : BoundUserInterfaceState
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
|
|
|
|
public string Selected;
|
2022-04-28 05:23:45 -07:00
|
|
|
public bool SelectableColor;
|
2020-10-13 13:40:05 +02:00
|
|
|
public Color Color;
|
|
|
|
|
|
2022-04-28 05:23:45 -07:00
|
|
|
public CrayonBoundUserInterfaceState(string selected, bool selectableColor, Color color)
|
2020-10-13 13:40:05 +02:00
|
|
|
{
|
|
|
|
|
Selected = selected;
|
2022-04-28 05:23:45 -07:00
|
|
|
SelectableColor = selectableColor;
|
2020-10-13 13:40:05 +02:00
|
|
|
Color = color;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|