diff --git a/Content.Client/SS220/CluwneComms/UI/CluwneCommunicationsConsoleBoundUserInterface.cs b/Content.Client/SS220/CluwneComms/UI/CluwneCommunicationsConsoleBoundUserInterface.cs new file mode 100644 index 000000000000..44e75b652330 --- /dev/null +++ b/Content.Client/SS220/CluwneComms/UI/CluwneCommunicationsConsoleBoundUserInterface.cs @@ -0,0 +1,47 @@ +// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt + +using Content.Shared.CCVar; +using Content.Shared.Chat; +using Content.Shared.Communications; +using Robust.Client.UserInterface; +using Robust.Shared.Configuration; +using Robust.Shared.Timing; + +namespace Content.Client.SS220.CluwneComms.UI +{ + public sealed class CluwneCommunicationsConsoleBoundUserInterface : BoundUserInterface + { + [Dependency] private readonly IConfigurationManager _cfg = default!; + + [ViewVariables] + private CluwneCommunicationsConsoleMenu? _menu; + + public CluwneCommunicationsConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + + _menu = this.CreateWindow(); + _menu.OnAnnounce += AnnounceButtonPressed; + } + + public void AnnounceButtonPressed(string message) + { + var maxLength = _cfg.GetCVar(CCVars.ChatMaxAnnouncementLength); + var msg = SharedChatSystem.SanitizeAnnouncement(message, maxLength); + SendMessage(new CommunicationsConsoleAnnounceMessage(msg)); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + if (state is not CommunicationsConsoleInterfaceState commsState) + return; + + } + } +} diff --git a/Content.Client/SS220/CluwneComms/UI/CluwneCommunicationsConsoleMenu.xaml b/Content.Client/SS220/CluwneComms/UI/CluwneCommunicationsConsoleMenu.xaml new file mode 100644 index 000000000000..12ba14c81381 --- /dev/null +++ b/Content.Client/SS220/CluwneComms/UI/CluwneCommunicationsConsoleMenu.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + +