From 041663e3fc3758891ceea01ff8b6857e4047b218 Mon Sep 17 00:00:00 2001 From: Vigers Ray <60344369+VigersRay@users.noreply.github.com> Date: Tue, 11 Jun 2024 04:02:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B0=D1=86=D0=B8=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=82=D0=BE=D1=80=20(#58)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Пацификатор * перевод --- .../PacificatorBoundUserInterface.cs | 54 +++ .../Pacificator/PacificatorWindow.xaml | 35 ++ .../Pacificator/PacificatorWindow.xaml.cs | 73 ++++ .../Pacificator/PacificatorComponent.cs | 56 +++ .../Pacificator/PacificatorSystems.cs | 320 ++++++++++++++++++ .../Pacificator/SharedPacificatorSystem.cs | 81 +++++ .../gravity/gravity-generator-component.ftl | 2 +- .../_Sunrise/Pacificator/pacificator.yml | 99 ++++++ 8 files changed, 719 insertions(+), 1 deletion(-) create mode 100644 Content.Client/_Sunrise/Pacificator/PacificatorBoundUserInterface.cs create mode 100644 Content.Client/_Sunrise/Pacificator/PacificatorWindow.xaml create mode 100644 Content.Client/_Sunrise/Pacificator/PacificatorWindow.xaml.cs create mode 100644 Content.Server/_Sunrise/Pacificator/PacificatorComponent.cs create mode 100644 Content.Server/_Sunrise/Pacificator/PacificatorSystems.cs create mode 100644 Content.Shared/_Sunrise/Pacificator/SharedPacificatorSystem.cs create mode 100644 Resources/Prototypes/_Sunrise/Pacificator/pacificator.yml diff --git a/Content.Client/_Sunrise/Pacificator/PacificatorBoundUserInterface.cs b/Content.Client/_Sunrise/Pacificator/PacificatorBoundUserInterface.cs new file mode 100644 index 0000000000..38bd6dad43 --- /dev/null +++ b/Content.Client/_Sunrise/Pacificator/PacificatorBoundUserInterface.cs @@ -0,0 +1,54 @@ +using Content.Shared._Sunrise.Pacificator; +using JetBrains.Annotations; + +namespace Content.Client._Sunrise.Pacificator +{ + [UsedImplicitly] + public sealed class PacificatorBoundUserInterface : BoundUserInterface + { + [ViewVariables] + private PacificatorWindow? _window; + + public PacificatorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + + _window = new PacificatorWindow(this); + + /* + _window.Switch.OnPressed += _ => + { + SendMessage(new SharedPacificatorComponent.SwitchGeneratorMessage(!IsOn)); + }; + */ + + _window.OpenCentered(); + _window.OnClose += Close; + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + var castState = (GeneratorState) state; + _window?.UpdateState(castState); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) return; + + _window?.Dispose(); + } + + public void SetPowerSwitch(bool on) + { + SendMessage(new SwitchGeneratorMessage(on)); + } + } +} diff --git a/Content.Client/_Sunrise/Pacificator/PacificatorWindow.xaml b/Content.Client/_Sunrise/Pacificator/PacificatorWindow.xaml new file mode 100644 index 0000000000..e6ba9a0023 --- /dev/null +++ b/Content.Client/_Sunrise/Pacificator/PacificatorWindow.xaml @@ -0,0 +1,35 @@ + + + + + +