diff --git a/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs b/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs new file mode 100644 index 0000000000..41da1f3d16 --- /dev/null +++ b/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs @@ -0,0 +1,64 @@ +using Content.Client.Shuttles.UI; +using Content.Shared.Shuttles.BUIStates; +using Content.Shared.Shuttles.Events; +using JetBrains.Annotations; +using Robust.Client.GameObjects; + +namespace Content.Client.Shuttles.BUI; + +[UsedImplicitly] +public sealed class IFFConsoleBoundUserInterface : BoundUserInterface +{ + private IFFConsoleWindow? _window; + + public IFFConsoleBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) + { + + } + + protected override void Open() + { + base.Open(); + _window = new IFFConsoleWindow(); + _window.OnClose += Close; + _window.ShowIFF += SendIFFMessage; + _window.ShowVessel += SendVesselMessage; + _window.OpenCenteredLeft(); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + if (state is not IFFConsoleBoundUserInterfaceState bState) + return; + + _window?.UpdateState(bState); + } + + private void SendIFFMessage(bool obj) + { + SendMessage(new IFFShowIFFMessage() + { + Show = obj, + }); + } + + private void SendVesselMessage(bool obj) + { + SendMessage(new IFFShowVesselMessage() + { + Show = obj, + }); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (disposing) + { + _window?.Close(); + _window = null; + } + } +} diff --git a/Content.Client/Shuttles/UI/EmergencyConsoleWindow.xaml b/Content.Client/Shuttles/UI/EmergencyConsoleWindow.xaml index 97f5e70f17..6aaf07ef35 100644 --- a/Content.Client/Shuttles/UI/EmergencyConsoleWindow.xaml +++ b/Content.Client/Shuttles/UI/EmergencyConsoleWindow.xaml @@ -1,6 +1,6 @@ diff --git a/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml b/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml new file mode 100644 index 0000000000..aa57bc587c --- /dev/null +++ b/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml @@ -0,0 +1,20 @@ + + + +