AnnounceUiCommand.cs 900 B

12345678910111213141516171819202122232425262728293031
  1. using Content.Server.Administration.UI;
  2. using Content.Server.EUI;
  3. using Content.Shared.Administration;
  4. using Robust.Shared.Console;
  5. namespace Content.Server.Administration.Commands
  6. {
  7. [AdminCommand(AdminFlags.Moderator)]
  8. public sealed class AnnounceUiCommand : IConsoleCommand
  9. {
  10. public string Command => "announceui";
  11. public string Description => "Opens the announcement UI";
  12. public string Help => $"{Command}";
  13. public void Execute(IConsoleShell shell, string argStr, string[] args)
  14. {
  15. var player = shell.Player;
  16. if (player == null)
  17. {
  18. shell.WriteLine("This does not work from the server console.");
  19. return;
  20. }
  21. var eui = IoCManager.Resolve<EuiManager>();
  22. var ui = new AdminAnnounceEui();
  23. eui.OpenEui(ui, player);
  24. }
  25. }
  26. }