Files
Delta-v/Content.Client/_DV/Administration/Commands/AdminOverlayCommand.cs
T
DisposableCrewmember42 e15dd1a715 feat: adminoverlay command (#5123)
* feat: adminoverlay command

* tweak: move adminoverlay perm under ADMIN
2026-01-10 15:17:57 +01:00

33 lines
935 B
C#

using Content.Client.Administration.Systems;
using Robust.Shared.Console;
namespace Content.Client._DV.Administration.Commands;
public sealed class AdminOverlayCommand : LocalizedEntityCommands
{
[Dependency] private readonly AdminSystem _admin = default!;
public override string Command => "adminoverlay";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1 || !Boolean.TryParse(args[0], out var newValue))
{
shell.WriteLine(Help);
return;
}
if (newValue)
{
_admin.AdminOverlayOn();
}
else
{
_admin.AdminOverlayOff();
}
}
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
{
return args.Length == 1 ? CompletionResult.FromOptions(CompletionHelper.Booleans) : CompletionResult.Empty;
}
}