Add health overlay and a command to toggle it (#3278)

* Add health overlay bar and a command to toggle it

* Remove empty line
This commit is contained in:
DrSmugleaf
2021-02-19 19:31:25 +01:00
committed by GitHub
parent 5667cffe95
commit 0ae4a6792f
8 changed files with 458 additions and 15 deletions

View File

@@ -0,0 +1,21 @@
using Content.Client.GameObjects.EntitySystems.HealthOverlay;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
namespace Content.Client.Commands
{
public class ToggleHealthOverlayCommand : IConsoleCommand
{
public string Command => "togglehealthoverlay";
public string Description => "Toggles a health bar above mobs.";
public string Help => $"Usage: {Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var system = EntitySystem.Get<HealthOverlaySystem>();
system.Enabled = !system.Enabled;
shell.WriteLine($"Health overlay system {(system.Enabled ? "enabled" : "disabled")}.");
}
}
}