NPCCommand.cs 809 B

1234567891011121314151617181920212223242526
  1. using Content.Server.Administration;
  2. using Content.Server.EUI;
  3. using Content.Server.NPC.UI;
  4. using Content.Shared.Administration;
  5. using Robust.Shared.Console;
  6. namespace Content.Server.NPC.Commands;
  7. [AdminCommand(AdminFlags.Debug)]
  8. public sealed class NPCCommand : IConsoleCommand
  9. {
  10. public string Command => "npc";
  11. public string Description => "Opens the debug window for NPCs";
  12. public string Help => $"{Command}";
  13. public void Execute(IConsoleShell shell, string argStr, string[] args)
  14. {
  15. if (shell.Player is not { } playerSession)
  16. {
  17. shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
  18. return;
  19. }
  20. var euiManager = IoCManager.Resolve<EuiManager>();
  21. euiManager.OpenEui(new NPCEui(), playerSession);
  22. }
  23. }