Files
tbd-station-14/Content.Server/NukeOps/WarDeclaratorComponent.cs
Kot 8c5898b006 Add chat.max_announcement_length cvar (#23571)
* Add announce message length to UI and make a cvar for it

* Update comm console server-side trim to use the cvar

* Rely on the new OnTextChanged event

Because OnKeyBindUp only works for keys that have binds

* Add a similar indicator to nukies' war declaration UI

* Remove message length indicators for now cuz it requires the engine update

* Rename cvar slightly

* Refactor duplicated code to a helper method

* Remove message trimming from *Window class as it's better to live in the BoundUserInterface where the other message handling happens

* Rename to chat.max_announcement_length
2024-01-21 20:14:01 +11:00

45 lines
1.1 KiB
C#

using Robust.Shared.Audio;
namespace Content.Server.NukeOps;
/// <summary>
/// Used with NukeOps game rule to send war declaration announcement
/// </summary>
[RegisterComponent]
public sealed partial class WarDeclaratorComponent : Component
{
/// <summary>
/// Custom war declaration message. If empty, use default.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public string Message;
/// <summary>
/// Permission to customize message text
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool AllowEditingMessage = true;
/// <summary>
/// War declarement text color
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public Color Color = Color.Red;
/// <summary>
/// War declarement sound file path
/// </summary>
[DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Announcements/war.ogg");
/// <summary>
/// Fluent ID for the declarement title
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public LocId Title = "comms-console-announcement-title-nukie";
}