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().GetGhostRolesInfo()); } public override void HandleMessage(EuiMessageBase msg) { base.HandleMessage(msg); switch (msg) { case GhostRoleTakeoverRequestMessage req: EntitySystem.Get().Takeover(Player, req.Identifier); break; case GhostRoleFollowRequestMessage req: EntitySystem.Get().Follow(Player, req.Identifier); break; case GhostRoleWindowCloseMessage _: Closed(); break; } } public override void Closed() { base.Closed(); EntitySystem.Get().CloseEui(Player); } } }