Files
tbd-station-14/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs
2023-04-29 13:16:24 +10:00

37 lines
1023 B
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
{
public override GhostRolesEuiState GetNewState()
{
return new(EntitySystem.Get<GhostRoleSystem>().GetGhostRolesInfo());
}
public override void HandleMessage(EuiMessageBase msg)
{
base.HandleMessage(msg);
switch (msg)
{
case GhostRoleTakeoverRequestMessage req:
EntitySystem.Get<GhostRoleSystem>().Takeover(Player, req.Identifier);
break;
case GhostRoleFollowRequestMessage req:
EntitySystem.Get<GhostRoleSystem>().Follow(Player, req.Identifier);
break;
}
}
public override void Closed()
{
base.Closed();
EntitySystem.Get<GhostRoleSystem>().CloseEui(Player);
}
}
}