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 @@ + + + + + +