2023-08-15 14:47:55 +03:00
|
|
|
using Content.Server.EUI;
|
|
|
|
|
using Content.Shared.Eui;
|
2024-01-28 18:37:24 +07:00
|
|
|
using Content.Shared._White.GhostRecruitment;
|
2023-08-15 14:47:55 +03:00
|
|
|
|
2024-01-28 18:18:54 +07:00
|
|
|
namespace Content.Server._White.GhostRecruitment;
|
2023-08-15 14:47:55 +03:00
|
|
|
|
|
|
|
|
public sealed class GhostRecruitmentEuiAccept : BaseEui
|
|
|
|
|
{
|
|
|
|
|
private readonly EntityUid _uid;
|
|
|
|
|
private readonly string _recruitmentName;
|
|
|
|
|
private readonly GhostRecruitmentSystem _recruitment;
|
|
|
|
|
|
|
|
|
|
public GhostRecruitmentEuiAccept(EntityUid uid,string recruitmentName, GhostRecruitmentSystem system)
|
|
|
|
|
{
|
|
|
|
|
_uid = uid;
|
|
|
|
|
_recruitmentName = recruitmentName;
|
|
|
|
|
_recruitment = system;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void HandleMessage(EuiMessageBase msg)
|
|
|
|
|
{
|
|
|
|
|
base.HandleMessage(msg);
|
|
|
|
|
|
|
|
|
|
if (msg is not AcceptRecruitmentChoiceMessage choice ||
|
|
|
|
|
choice.Button == AcceptRecruitmentUiButton.Deny)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_recruitment.Recruit(_uid,_recruitmentName);
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
}
|