Fluid spread refactor (#11908)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fix undefined
This commit is contained in:
Ygg01
2022-11-15 12:30:59 +01:00
committed by GitHub
parent 89b959f931
commit 75ea093d78
17 changed files with 719 additions and 336 deletions

View File

@@ -0,0 +1,32 @@
using Content.Server.Administration;
using Content.Server.Fluids.EntitySystems;
using Content.Shared.Administration;
using Robust.Server.Player;
using Robust.Shared.Console;
namespace Content.Server.Fluids;
[AdminCommand(AdminFlags.Debug)]
public sealed class ShowFluidsCommand : IConsoleCommand
{
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
public string Command => "showfluids";
public string Description => "Toggles seeing puddle debug overlay.";
public string Help => $"Usage: {Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var player = shell.Player as IPlayerSession;
if (player == null)
{
shell.WriteLine("You must be a player to use this command.");
return;
}
var fluidDebug = _entitySystem.GetEntitySystem<PuddleDebugDebugOverlaySystem>();
var enabled = fluidDebug.ToggleObserver(player);
shell.WriteLine(enabled
? "Enabled the puddle debug overlay."
: "Disabled the puddle debug overlay.");
}
}