* PROJECT 0 WARNINGS: Resolve `'EntitySystem.Get<T>()' is obsolete` in content * pass entman * dog ass test * webeditor
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using Content.Server.EUI;
|
|
using Content.Shared.Eui;
|
|
using Content.Shared.Ghost.Roles;
|
|
|
|
namespace Content.Server.Ghost.Roles.UI
|
|
{
|
|
public sealed class GhostRolesEui : BaseEui
|
|
{
|
|
private readonly GhostRoleSystem _ghostRoleSystem;
|
|
|
|
public GhostRolesEui()
|
|
{
|
|
_ghostRoleSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GhostRoleSystem>();
|
|
}
|
|
|
|
public override GhostRolesEuiState GetNewState()
|
|
{
|
|
return new(_ghostRoleSystem.GetGhostRolesInfo(Player));
|
|
}
|
|
|
|
public override void HandleMessage(EuiMessageBase msg)
|
|
{
|
|
base.HandleMessage(msg);
|
|
|
|
switch (msg)
|
|
{
|
|
case RequestGhostRoleMessage req:
|
|
_ghostRoleSystem.Request(Player, req.Identifier);
|
|
break;
|
|
case FollowGhostRoleMessage req:
|
|
_ghostRoleSystem.Follow(Player, req.Identifier);
|
|
break;
|
|
case LeaveGhostRoleRaffleMessage req:
|
|
_ghostRoleSystem.LeaveRaffle(Player, req.Identifier);
|
|
break;
|
|
}
|
|
}
|
|
|
|
public override void Closed()
|
|
{
|
|
base.Closed();
|
|
|
|
_ghostRoleSystem.CloseEui(Player);
|
|
}
|
|
}
|
|
}
|