Files
tbd-station-14/Content.Shared/Configurable/ConfigurationComponent.cs
metalgearsloth 63dfd21b14 Predict dumping (#32394)
* Predict dumping

- This got soaped really fucking hard.
- Dumping is predicted, this required disposals to be predicte.d
- Disposals required mailing (because it's tightly coupled), and a smidge of other content systems.
- I also had to fix a compnetworkgenerator issue at the same time so it wouldn't mispredict.

* Fix a bunch of stuff

* nasty merge

* Some reviews

* Some more reviews while I stash

* Fix merge

* Fix merge

* Half of review

* Review

* re(h)f

* lizards

* feexes

* feex
2025-04-19 16:20:40 +10:00

69 lines
2.1 KiB
C#

using System.Text.RegularExpressions;
using Content.Shared.Tools;
using Content.Shared.Tools.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Configurable
{
/// <summary>
/// Configuration for mailing units.
/// </summary>
/// <remarks>
/// If you want a more detailed description ask the original coder.
/// </remarks>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ConfigurationComponent : Component
{
/// <summary>
/// Tags for mail unit routing.
/// </summary>
[DataField, AutoNetworkedField]
public Dictionary<string, string?> Config = new();
/// <summary>
/// Quality to open up the configuration UI.
/// </summary>
[DataField]
public ProtoId<ToolQualityPrototype> QualityNeeded = SharedToolSystem.PulseQuality;
/// <summary>
/// Validate tags in <see cref="Config"/>.
/// </summary>
[DataField]
public Regex Validation = new("^[a-zA-Z0-9 ]*$", RegexOptions.Compiled);
/// <summary>
/// Message data sent from client to server when the device configuration is updated.
/// </summary>
[Serializable, NetSerializable]
public sealed class ConfigurationUpdatedMessage : BoundUserInterfaceMessage
{
public Dictionary<string, string> Config { get; }
public ConfigurationUpdatedMessage(Dictionary<string, string> config)
{
Config = config;
}
}
[Serializable, NetSerializable]
public sealed class ValidationUpdateMessage : BoundUserInterfaceMessage
{
public string ValidationString { get; }
public ValidationUpdateMessage(string validationString)
{
ValidationString = validationString;
}
}
[Serializable, NetSerializable]
public enum ConfigurationUiKey
{
Key
}
}
}