Makes accept cloning message use Eui (#2910)

This commit is contained in:
Vera Aguilera Puerto
2021-01-03 17:20:17 +01:00
committed by GitHub
parent c04a0270e1
commit 9c2aaef73a
11 changed files with 129 additions and 154 deletions

View File

@@ -0,0 +1,41 @@
using Content.Client.Eui;
using Content.Shared.GameObjects.Components.Medical;
using Content.Shared.GameObjects.Components.Observer;
using JetBrains.Annotations;
namespace Content.Client.GameObjects.Components.Observer
{
[UsedImplicitly]
public class AcceptCloningEui : BaseEui
{
private readonly AcceptCloningWindow _window;
public AcceptCloningEui()
{
_window = new AcceptCloningWindow();
_window.DenyButton.OnPressed += _ =>
{
SendMessage(new AcceptCloningChoiceMessage(AcceptCloningUiButton.Deny));
_window.Close();
};
_window.AcceptButton.OnPressed += _ =>
{
SendMessage(new AcceptCloningChoiceMessage(AcceptCloningUiButton.Accept));
_window.Close();
};
}
public override void Opened()
{
_window.OpenCentered();
}
public override void Closed()
{
_window.Close();
}
}
}

View File

@@ -0,0 +1,58 @@
#nullable enable
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization;
namespace Content.Client.GameObjects.Components.Observer
{
public sealed class AcceptCloningWindow : SS14Window
{
public readonly Button DenyButton;
public readonly Button AcceptButton;
public AcceptCloningWindow()
{
Title = Loc.GetString("Cloning Machine");
Contents.AddChild(new VBoxContainer
{
Children =
{
new VBoxContainer
{
Children =
{
(new Label()
{
Text = Loc.GetString("You are being cloned!\nTransfer your soul to the clone body?")
}),
new HBoxContainer
{
Align = BoxContainer.AlignMode.Center,
Children =
{
(AcceptButton = new Button
{
Text = Loc.GetString("Yes"),
}),
(new Control()
{
CustomMinimumSize = (20, 0)
}),
(DenyButton = new Button
{
Text = Loc.GetString("No"),
})
}
},
}
},
}
});
}
}
}