2022-05-13 00:59:03 -07:00
|
|
|
|
using System.Text.RegularExpressions;
|
2020-08-19 15:50:06 +02:00
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Shared.Disposal.Components
|
2020-08-19 15:50:06 +02:00
|
|
|
|
{
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class SharedDisposalRouterComponent : Component
|
2020-08-19 15:50:06 +02:00
|
|
|
|
{
|
2020-11-27 11:00:49 +01:00
|
|
|
|
public static readonly Regex TagRegex = new("^[a-zA-Z0-9, ]*$", RegexOptions.Compiled);
|
2020-08-19 20:43:56 +02:00
|
|
|
|
|
2020-08-19 15:50:06 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class DisposalRouterUserInterfaceState : BoundUserInterfaceState
|
2020-08-19 15:50:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
public readonly string Tags;
|
|
|
|
|
|
|
|
|
|
|
|
public DisposalRouterUserInterfaceState(string tags)
|
|
|
|
|
|
{
|
|
|
|
|
|
Tags = tags;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class UiActionMessage : BoundUserInterfaceMessage
|
2020-08-19 15:50:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
public readonly UiAction Action;
|
|
|
|
|
|
public readonly string Tags = "";
|
|
|
|
|
|
|
|
|
|
|
|
public UiActionMessage(UiAction action, string tags)
|
|
|
|
|
|
{
|
|
|
|
|
|
Action = action;
|
|
|
|
|
|
|
|
|
|
|
|
if (Action == UiAction.Ok)
|
|
|
|
|
|
{
|
|
|
|
|
|
Tags = tags.Substring(0, Math.Min(tags.Length, 150));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public enum UiAction
|
|
|
|
|
|
{
|
|
|
|
|
|
Ok
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public enum DisposalRouterUiKey
|
|
|
|
|
|
{
|
|
|
|
|
|
Key
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|