1
0

ToggleGhostVisibilityCommand.cs 808 B

1234567891011121314151617181920212223242526
  1. using Robust.Shared.Console;
  2. namespace Content.Client.Ghost.Commands;
  3. public sealed class ToggleGhostVisibilityCommand : IConsoleCommand
  4. {
  5. [Dependency] private readonly IEntitySystemManager _entSysMan = default!;
  6. public string Command => "toggleghostvisibility";
  7. public string Description => "Toggles ghost visibility on the client.";
  8. public string Help => "toggleghostvisibility [bool]";
  9. public void Execute(IConsoleShell shell, string argStr, string[] args)
  10. {
  11. var ghostSystem = _entSysMan.GetEntitySystem<GhostSystem>();
  12. if (args.Length != 0 && bool.TryParse(args[0], out var visibility))
  13. {
  14. ghostSystem.ToggleGhostVisibility(visibility);
  15. }
  16. else
  17. {
  18. ghostSystem.ToggleGhostVisibility();
  19. }
  20. }
  21. }