Files
tbd-station-14/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs
2022-05-13 17:59:03 +10:00

40 lines
1.1 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
{
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;
case GhostRoleWindowCloseMessage _:
Closed();
break;
}
}
public override void Closed()
{
base.Closed();
EntitySystem.Get<GhostRoleSystem>().CloseEui(Player);
}
}
}