Files
tbd-station-14/Content.Client/Commands/ToggleHealthOverlayCommand.cs
DrSmugleaf 0ae4a6792f Add health overlay and a command to toggle it (#3278)
* Add health overlay bar and a command to toggle it

* Remove empty line
2021-02-19 19:31:25 +01:00

22 lines
733 B
C#

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")}.");
}
}
}