using Robust.Shared.Serialization; namespace Content.Shared.Administration; /// /// A networked event raised when the server wants to open a quick dialog. /// [Serializable, NetSerializable] public sealed class QuickDialogOpenEvent : EntityEventArgs { /// /// The title of the dialog. /// public string Title; /// /// The internal dialog ID. /// public int DialogId; /// /// The prompts to show the user. /// public List Prompts; /// /// The buttons presented for the user. /// public QuickDialogButtonFlag Buttons = QuickDialogButtonFlag.OkButton | QuickDialogButtonFlag.CancelButton; public QuickDialogOpenEvent(string title, List prompts, int dialogId, QuickDialogButtonFlag buttons) { Title = title; Prompts = prompts; Buttons = buttons; DialogId = dialogId; } } /// /// A networked event raised when the client replies to a quick dialog. /// [Serializable, NetSerializable] public sealed class QuickDialogResponseEvent : EntityEventArgs { /// /// The internal dialog ID. /// public int DialogId; /// /// The responses to the prompts. /// public Dictionary Responses; /// /// The button pressed when responding. /// public QuickDialogButtonFlag ButtonPressed; public QuickDialogResponseEvent(int dialogId, Dictionary responses, QuickDialogButtonFlag buttonPressed) { DialogId = dialogId; Responses = responses; ButtonPressed = buttonPressed; } } /// /// An entry in a quick dialog. /// [Serializable, NetSerializable] public sealed class QuickDialogEntry { /// /// ID of the dialog field. /// public string FieldId; /// /// Type of the field, for checks. /// public QuickDialogEntryType Type; /// /// The prompt to show the user. /// public string Prompt; /// /// String to replace the type-specific placeholder with. /// public string? Placeholder; public QuickDialogEntry(string fieldId, QuickDialogEntryType type, string prompt, string? placeholder = null) { FieldId = fieldId; Type = type; Prompt = prompt; Placeholder = placeholder; } } /// /// The buttons available in a quick dialog. /// [Flags] public enum QuickDialogButtonFlag { OkButton = 1, CancelButton = 2, } /// /// The entry types for a quick dialog. /// public enum QuickDialogEntryType { /// /// Any integer. /// Integer, /// /// Any floating point value. /// Float, /// /// Maximum of 100 characters string. /// ShortText, /// /// Maximum of 2,000 characters string. /// LongText, }