From b4248482c5502a2ebc6f15780b37b3ad888889e1 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 12 Aug 2022 02:58:44 +1000 Subject: [PATCH] IFF console (#10504) * IFF console * Silly * Color * a * Const bool default * Full stealth as well coz dork. * Infiltrator update --- .../BUI/IFFConsoleBoundUserInterface.cs | 64 +++++++ .../Shuttles/UI/EmergencyConsoleWindow.xaml | 2 +- .../Shuttles/UI/IFFConsoleWindow.xaml | 20 +++ .../Shuttles/UI/IFFConsoleWindow.xaml.cs | 86 ++++++++++ Content.Client/Shuttles/UI/RadarControl.cs | 19 +- .../Components/IFFConsoleComponent.cs | 14 ++ .../Shuttles/Systems/ShuttleSystem.IFF.cs | 91 ++++++++++ .../Shuttles/Systems/ShuttleSystem.cs | 1 + .../IFFConsoleBoundUserInterfaceState.cs | 17 ++ .../Shuttles/Components/IFFComponent.cs | 49 ++++++ .../Shuttles/Events/IFFShowIFFMessage.cs | 12 ++ .../Shuttles/Events/IFFShowVesselMessage.cs | 9 + .../Systems/SharedShuttleSystem.IFF.cs | 89 ++++++++++ .../Shuttles/Systems/SharedShuttleSystem.cs | 6 +- Resources/Locale/en-US/shuttles/emergency.ftl | 1 + Resources/Locale/en-US/shuttles/iff.ftl | 5 + Resources/Maps/infiltrator.yml | 135 ++++++++------- .../Machines/Computers/computers.yml | 162 ++++++++++++------ .../Structures/Shuttles/iff.rsi/helm.png | Bin 0 -> 1267 bytes .../Structures/Shuttles/iff.rsi/meta.json | 33 ++++ 20 files changed, 702 insertions(+), 113 deletions(-) create mode 100644 Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs create mode 100644 Content.Client/Shuttles/UI/IFFConsoleWindow.xaml create mode 100644 Content.Client/Shuttles/UI/IFFConsoleWindow.xaml.cs create mode 100644 Content.Server/Shuttles/Components/IFFConsoleComponent.cs create mode 100644 Content.Server/Shuttles/Systems/ShuttleSystem.IFF.cs create mode 100644 Content.Shared/Shuttles/BUIStates/IFFConsoleBoundUserInterfaceState.cs create mode 100644 Content.Shared/Shuttles/Components/IFFComponent.cs create mode 100644 Content.Shared/Shuttles/Events/IFFShowIFFMessage.cs create mode 100644 Content.Shared/Shuttles/Events/IFFShowVesselMessage.cs create mode 100644 Content.Shared/Shuttles/Systems/SharedShuttleSystem.IFF.cs create mode 100644 Resources/Locale/en-US/shuttles/iff.ftl create mode 100644 Resources/Textures/Structures/Shuttles/iff.rsi/helm.png create mode 100644 Resources/Textures/Structures/Shuttles/iff.rsi/meta.json 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 @@ + + + +