1
0

GridDraggingCommand.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using Content.Server.Administration;
  2. using Content.Shared.Administration;
  3. using Content.Shared.Maps;
  4. using Robust.Shared.Console;
  5. namespace Content.Server.Maps;
  6. /// <summary>
  7. /// Toggles GridDragging on the system.
  8. /// </summary>
  9. [AdminCommand(AdminFlags.Fun)]
  10. public sealed class GridDraggingCommand : IConsoleCommand
  11. {
  12. public string Command => SharedGridDraggingSystem.CommandName;
  13. public string Description => $"Allows someone with permissions to drag grids around.";
  14. public string Help => $"{Command}";
  15. public void Execute(IConsoleShell shell, string argStr, string[] args)
  16. {
  17. if (shell.Player == null)
  18. {
  19. shell.WriteError("shell-server-cannot");
  20. return;
  21. }
  22. var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GridDraggingSystem>();
  23. system.Toggle(shell.Player);
  24. if (system.IsEnabled(shell.Player))
  25. shell.WriteLine("Grid dragging toggled on");
  26. else
  27. shell.WriteLine("Grid dragging toggled off");
  28. }
  29. }