mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
29 lines
868 B
C#
29 lines
868 B
C#
using Content.Server.Administration;
|
|
using Content.Shared.Administration;
|
|
using Content.Shared.Maps;
|
|
using Robust.Shared.Console;
|
|
|
|
namespace Content.Server.Maps;
|
|
|
|
/// <summary>
|
|
/// Toggles GridDragging on the system.
|
|
/// </summary>
|
|
[AdminCommand(AdminFlags.Fun)]
|
|
public sealed partial class GridDraggingCommand : LocalizedEntityCommands
|
|
{
|
|
[Dependency] private GridDraggingSystem _grid = default!;
|
|
|
|
public override string Command => SharedGridDraggingSystem.CommandName;
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
{
|
|
if (shell.Player == null)
|
|
{
|
|
shell.WriteError("shell-only-players-can-run-this-command");
|
|
return;
|
|
}
|
|
|
|
_grid.Toggle(shell.Player);
|
|
shell.WriteLine(Loc.GetString($"cmd-griddrag-status", ("status", _grid.IsEnabled(shell.Player))));
|
|
}
|
|
}
|