diff --git a/Content.Client/_Goobstation/Devil/UI/RevivalContractBoundUserInterface.cs b/Content.Client/_Goobstation/Devil/UI/RevivalContractBoundUserInterface.cs new file mode 100644 index 0000000000..527d49cfbc --- /dev/null +++ b/Content.Client/_Goobstation/Devil/UI/RevivalContractBoundUserInterface.cs @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2025 GoobBot +// SPDX-FileCopyrightText: 2025 SolsticeOfTheWinter +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +using Content.Shared._Goobstation.Devil.UI; +using JetBrains.Annotations; +using Robust.Client.UserInterface; + +namespace Content.Client._Goobstation.Devil.UI; + +[UsedImplicitly] +public sealed class RevivalContractBoundUserInterface : BoundUserInterface +{ + private RevivalContractMenu? _menu; + + public RevivalContractBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + IoCManager.InjectDependencies(this); + } + + protected override void Open() + { + base.Open(); + + _menu = this.CreateWindow(); + _menu.SetEntity(Owner); + _menu.Accepted += OnAccepted; + _menu.Rejected += OnRejected; + _menu.OnClose += OnClosed; + + _menu.OpenCentered(); + } + + private void OnAccepted() + { + SendPredictedMessage(new RevivalContractMessage(true)); + Close(); + } + + private void OnRejected() + { + SendPredictedMessage(new RevivalContractMessage(false)); + Close(); + } + + private void OnClosed() + { + SendPredictedMessage(new RevivalContractMessage(false)); + Close(); + } +} diff --git a/Content.Client/_Goobstation/Devil/UI/RevivalContractMenu.xaml b/Content.Client/_Goobstation/Devil/UI/RevivalContractMenu.xaml new file mode 100644 index 0000000000..51d4c63879 --- /dev/null +++ b/Content.Client/_Goobstation/Devil/UI/RevivalContractMenu.xaml @@ -0,0 +1,17 @@ + + +