2020-12-03 03:40:47 +01:00
|
|
|
using Content.Server.Administration;
|
2021-06-19 13:25:05 +02:00
|
|
|
using Content.Server.Atmos.EntitySystems;
|
2020-12-03 03:40:47 +01:00
|
|
|
using Content.Shared.Administration;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2020-12-03 03:40:47 +01:00
|
|
|
|
2021-07-25 09:04:58 +02:00
|
|
|
namespace Content.Server.Atmos.Commands
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
|
|
|
|
[AdminCommand(AdminFlags.Debug)]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class ShowAtmos : IConsoleCommand
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
[Dependency] private readonly IEntityManager _e = default!;
|
|
|
|
|
|
2020-12-03 03:40:47 +01:00
|
|
|
public string Command => "showatmos";
|
|
|
|
|
public string Description => "Toggles seeing atmos debug overlay.";
|
|
|
|
|
public string Help => $"Usage: {Command}";
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
2023-10-28 09:59:53 +11:00
|
|
|
var player = shell.Player;
|
2020-12-03 03:40:47 +01:00
|
|
|
if (player == null)
|
|
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
shell.WriteLine("You must be a player to use this command.");
|
2020-12-03 03:40:47 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 17:34:52 -07:00
|
|
|
var atmosDebug = _e.System<AtmosDebugOverlaySystem>();
|
2020-12-03 03:40:47 +01:00
|
|
|
var enabled = atmosDebug.ToggleObserver(player);
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
shell.WriteLine(enabled
|
2020-12-03 03:40:47 +01:00
|
|
|
? "Enabled the atmospherics debug overlay."
|
|
|
|
|
: "Disabled the atmospherics debug overlay.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|