Defibrillator (#15922)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
44
Content.Client/Ghost/UI/ReturnToBodyEui.cs
Normal file
44
Content.Client/Ghost/UI/ReturnToBodyEui.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Content.Client.Eui;
|
||||
using Content.Shared.Ghost;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Graphics;
|
||||
|
||||
namespace Content.Client.Ghost.UI;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class ReturnToBodyEui : BaseEui
|
||||
{
|
||||
private readonly ReturnToBodyMenu _menu;
|
||||
|
||||
public ReturnToBodyEui()
|
||||
{
|
||||
_menu = new ReturnToBodyMenu();
|
||||
|
||||
_menu.DenyButton.OnPressed += _ =>
|
||||
{
|
||||
SendMessage(new ReturnToBodyMessage(false));
|
||||
_menu.Close();
|
||||
};
|
||||
|
||||
_menu.AcceptButton.OnPressed += _ =>
|
||||
{
|
||||
SendMessage(new ReturnToBodyMessage(true));
|
||||
_menu.Close();
|
||||
};
|
||||
}
|
||||
|
||||
public override void Opened()
|
||||
{
|
||||
IoCManager.Resolve<IClyde>().RequestWindowAttention();
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
public override void Closed()
|
||||
{
|
||||
base.Closed();
|
||||
|
||||
SendMessage(new ReturnToBodyMessage(false));
|
||||
_menu.Close();
|
||||
}
|
||||
|
||||
}
|
||||
59
Content.Client/Ghost/UI/ReturnToBodyMenu.cs
Normal file
59
Content.Client/Ghost/UI/ReturnToBodyMenu.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Content.Client.Ghost.UI;
|
||||
|
||||
public sealed class ReturnToBodyMenu : DefaultWindow
|
||||
{
|
||||
public readonly Button DenyButton;
|
||||
public readonly Button AcceptButton;
|
||||
|
||||
public ReturnToBodyMenu()
|
||||
{
|
||||
Title = Loc.GetString("ghost-return-to-body-title");
|
||||
|
||||
Contents.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Children =
|
||||
{
|
||||
new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Children =
|
||||
{
|
||||
(new Label()
|
||||
{
|
||||
Text = Loc.GetString("ghost-return-to-body-text")
|
||||
}),
|
||||
new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
Align = AlignMode.Center,
|
||||
Children =
|
||||
{
|
||||
(AcceptButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("accept-cloning-window-accept-button"),
|
||||
}),
|
||||
|
||||
(new Control()
|
||||
{
|
||||
MinSize = (20, 0)
|
||||
}),
|
||||
|
||||
(DenyButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("accept-cloning-window-deny-button"),
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user