2022-09-01 13:11:45 +10:00
|
|
|
using Content.Server.Administration;
|
|
|
|
|
using Content.Shared.Administration;
|
2022-05-10 12:27:37 +10:00
|
|
|
using Content.Shared.Maps;
|
|
|
|
|
using Robust.Shared.Console;
|
|
|
|
|
|
2022-09-01 13:11:45 +10:00
|
|
|
namespace Content.Server.Maps;
|
2022-05-10 12:27:37 +10:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Toggles GridDragging on the system.
|
|
|
|
|
/// </summary>
|
2022-09-01 13:11:45 +10:00
|
|
|
[AdminCommand(AdminFlags.Fun)]
|
2025-06-17 05:39:42 -04:00
|
|
|
public sealed class GridDraggingCommand : LocalizedEntityCommands
|
2022-05-10 12:27:37 +10:00
|
|
|
{
|
2025-06-17 05:39:42 -04:00
|
|
|
[Dependency] private readonly GridDraggingSystem _grid = default!;
|
|
|
|
|
|
|
|
|
|
public override string Command => SharedGridDraggingSystem.CommandName;
|
|
|
|
|
|
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
2022-05-10 12:27:37 +10:00
|
|
|
{
|
2022-09-01 13:11:45 +10:00
|
|
|
if (shell.Player == null)
|
|
|
|
|
{
|
2025-06-17 05:39:42 -04:00
|
|
|
shell.WriteError("shell-only-players-can-run-this-command");
|
2022-09-01 13:11:45 +10:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-17 05:39:42 -04:00
|
|
|
_grid.Toggle(shell.Player);
|
|
|
|
|
shell.WriteLine(Loc.GetString($"cmd-griddrag-status", ("status", _grid.IsEnabled(shell.Player))));
|
2022-05-10 12:27:37 +10:00
|
|
|
}
|
|
|
|
|
}
|