1
0

ShowFluidsCommand.cs 1.0 KB

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