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:
21
Content.Client/Commands/ToggleHealthOverlayCommand.cs
Normal file
21
Content.Client/Commands/ToggleHealthOverlayCommand.cs
Normal 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")}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user