From 076338bfab016235fe5009b79678e80fbe26b41c Mon Sep 17 00:00:00 2001 From: BeatusCrow Date: Wed, 3 Jul 2024 11:38:26 +0300 Subject: [PATCH 1/8] 03.07.24 Add DropPod --- Content.Client/DropPod/UI/DropPodBoundUi.cs | 61 ++++ .../DropPod/UI/DropPodConsoleWindow.xaml | 13 + .../DropPod/UI/DropPodConsoleWindow.xaml.cs | 46 +++ .../DropPod/DropPodConsoleComponent.cs | 28 ++ .../DropPod/DropPodLighthouseComponent.cs | 12 + Content.Server/DropPod/DropPodSystem.cs | 342 ++++++++++++++++++ .../DropPod/LandingPointComponent.cs | 17 + Content.Shared/DropPod/SharedDropPod.cs | 49 +++ .../Entities/Markers/drop_pod_markers.yml | 71 ++++ .../Objects/Devices/droppodconsole.yml | 38 ++ .../droppod.rsi/drop_pod_lighthouse.png | Bin 0 -> 614 bytes .../Markers/droppod.rsi/drop_pod_point.png | Bin 0 -> 572 bytes .../droppod.rsi/drop_pod_point_brig.png | Bin 0 -> 577 bytes .../droppod.rsi/drop_pod_point_cap.png | Bin 0 -> 587 bytes .../droppod.rsi/drop_pod_point_cargo.png | Bin 0 -> 572 bytes .../droppod.rsi/drop_pod_point_eng.png | Bin 0 -> 573 bytes .../droppod.rsi/drop_pod_point_med.png | Bin 0 -> 570 bytes .../Markers/droppod.rsi/drop_pod_point_rd.png | Bin 0 -> 571 bytes .../droppod.rsi/drop_pod_point_sal.png | Bin 0 -> 565 bytes .../Textures/Markers/droppod.rsi/meta.json | 38 ++ .../Syndicate/droppodconsole.rsi/console.png | Bin 0 -> 743 bytes .../Syndicate/droppodconsole.rsi/icon.png | Bin 0 -> 583 bytes .../Syndicate/droppodconsole.rsi/meta.json | 25 ++ 23 files changed, 740 insertions(+) create mode 100644 Content.Client/DropPod/UI/DropPodBoundUi.cs create mode 100644 Content.Client/DropPod/UI/DropPodConsoleWindow.xaml create mode 100644 Content.Client/DropPod/UI/DropPodConsoleWindow.xaml.cs create mode 100644 Content.Server/DropPod/DropPodConsoleComponent.cs create mode 100644 Content.Server/DropPod/DropPodLighthouseComponent.cs create mode 100644 Content.Server/DropPod/DropPodSystem.cs create mode 100644 Content.Server/DropPod/LandingPointComponent.cs create mode 100644 Content.Shared/DropPod/SharedDropPod.cs create mode 100644 Resources/Prototypes/Entities/Markers/drop_pod_markers.yml create mode 100644 Resources/Prototypes/Entities/Objects/Devices/droppodconsole.yml create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_lighthouse.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point_brig.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point_cap.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point_cargo.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point_eng.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point_med.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point_rd.png create mode 100644 Resources/Textures/Markers/droppod.rsi/drop_pod_point_sal.png create mode 100644 Resources/Textures/Markers/droppod.rsi/meta.json create mode 100644 Resources/Textures/Objects/Specific/Syndicate/droppodconsole.rsi/console.png create mode 100644 Resources/Textures/Objects/Specific/Syndicate/droppodconsole.rsi/icon.png create mode 100644 Resources/Textures/Objects/Specific/Syndicate/droppodconsole.rsi/meta.json diff --git a/Content.Client/DropPod/UI/DropPodBoundUi.cs b/Content.Client/DropPod/UI/DropPodBoundUi.cs new file mode 100644 index 000000000000..df18835b93f5 --- /dev/null +++ b/Content.Client/DropPod/UI/DropPodBoundUi.cs @@ -0,0 +1,61 @@ +using Content.Shared.DropPod; +using JetBrains.Annotations; +using Robust.Client.GameObjects; + +namespace Content.Client.DropPod.UI; + +[UsedImplicitly] +public sealed class DropPodBoundUi : BoundUserInterface +{ + [ViewVariables] + private DropPodConsoleWindow? _window; + + public DropPodBoundUi(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + + _window = new DropPodConsoleWindow(); + _window.OpenCentered(); + + _window.PointsRefreshButtonPressed += OnPointsRefreshButtonPressed; + _window.StartLandingButtonPressed += OnStartLandingButtonPressed; + _window.PointSelected += OnPointSelected; + _window.OnClose += Close; + } + + private void OnPointsRefreshButtonPressed() + { + SendMessage(new DropPodRefreshMessage()); + } + + private void OnStartLandingButtonPressed() + { + SendMessage(new DropPodStartMessage()); + } + + private void OnPointSelected(int point) + { + SendMessage(new DropPodPointSelectedMessage(point)); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + if (_window == null || state is not DropPodUiState cast) + return; + + _window.UpdateState(cast); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (disposing) + _window?.Dispose(); + } +} diff --git a/Content.Client/DropPod/UI/DropPodConsoleWindow.xaml b/Content.Client/DropPod/UI/DropPodConsoleWindow.xaml new file mode 100644 index 000000000000..d817d6bed071 --- /dev/null +++ b/Content.Client/DropPod/UI/DropPodConsoleWindow.xaml @@ -0,0 +1,13 @@ + + + +