2021-01-03 17:20:17 +01:00
|
|
|
#nullable enable
|
|
|
|
|
using Content.Server.Eui;
|
|
|
|
|
using Content.Server.Players;
|
|
|
|
|
using Content.Shared.Eui;
|
|
|
|
|
using Content.Shared.GameObjects.Components.Observer;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-01-03 17:20:17 +01:00
|
|
|
|
|
|
|
|
namespace Content.Server.GameObjects.Components.Observer
|
|
|
|
|
{
|
|
|
|
|
public class AcceptCloningEui : BaseEui
|
|
|
|
|
{
|
|
|
|
|
private readonly IEntity _newMob;
|
|
|
|
|
|
|
|
|
|
public AcceptCloningEui(IEntity newMob)
|
|
|
|
|
{
|
|
|
|
|
_newMob = newMob;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void HandleMessage(EuiMessageBase msg)
|
|
|
|
|
{
|
|
|
|
|
base.HandleMessage(msg);
|
|
|
|
|
|
|
|
|
|
if (msg is not AcceptCloningChoiceMessage choice
|
|
|
|
|
|| choice.Button == AcceptCloningUiButton.Deny
|
|
|
|
|
|| _newMob.Deleted)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Player.ContentData()?.Mind?.TransferTo(_newMob);
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|