2024-04-25 09:26:21 -07:00
|
|
|
|
using Robust.Shared.Console;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.Ghost.Commands;
|
|
|
|
|
|
|
2025-06-17 14:08:12 -04:00
|
|
|
|
public sealed class ToggleGhostVisibilityCommand : LocalizedEntityCommands
|
2024-04-25 09:26:21 -07:00
|
|
|
|
{
|
2025-06-17 14:08:12 -04:00
|
|
|
|
[Dependency] private readonly GhostSystem _ghost = default!;
|
2024-04-25 09:26:21 -07:00
|
|
|
|
|
2025-06-17 14:08:12 -04:00
|
|
|
|
public override string Command => "toggleghostvisibility";
|
2024-04-25 09:26:21 -07:00
|
|
|
|
|
2025-06-17 14:08:12 -04:00
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
2024-04-25 09:26:21 -07:00
|
|
|
|
{
|
|
|
|
|
|
if (args.Length != 0 && bool.TryParse(args[0], out var visibility))
|
2025-06-17 14:08:12 -04:00
|
|
|
|
_ghost.ToggleGhostVisibility(visibility);
|
2024-04-25 09:26:21 -07:00
|
|
|
|
else
|
2025-06-17 14:08:12 -04:00
|
|
|
|
_ghost.ToggleGhostVisibility();
|
2024-04-25 09:26:21 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|