Files
crystall-punk-14/Content.Server/Maps/GridDraggingCommand.cs

30 lines
869 B
C#
Raw Permalink Normal View History

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