ShowAtmosCommand.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Content.Server.Administration;
  2. using Content.Server.Atmos.EntitySystems;
  3. using Content.Shared.Administration;
  4. using Robust.Shared.Console;
  5. namespace Content.Server.Atmos.Commands
  6. {
  7. [AdminCommand(AdminFlags.Debug)]
  8. public sealed class ShowAtmos : IConsoleCommand
  9. {
  10. [Dependency] private readonly IEntityManager _e = default!;
  11. public string Command => "showatmos";
  12. public string Description => "Toggles seeing atmos debug overlay.";
  13. public string Help => $"Usage: {Command}";
  14. public void Execute(IConsoleShell shell, string argStr, string[] args)
  15. {
  16. var player = shell.Player;
  17. if (player == null)
  18. {
  19. shell.WriteLine("You must be a player to use this command.");
  20. return;
  21. }
  22. var atmosDebug = _e.System<AtmosDebugOverlaySystem>();
  23. var enabled = atmosDebug.ToggleObserver(player);
  24. shell.WriteLine(enabled
  25. ? "Enabled the atmospherics debug overlay."
  26. : "Disabled the atmospherics debug overlay.");
  27. }
  28. }
  29. }