Client commands: clean up and localize (#22897)

* action commands

* atmos debug commands

* comming

* credits command

* debug commands

* usage

* usings

* debug pathfinding command

* grouping entity menu command

* hide mechanisms command

* commit

* mapping client side setup command

* open ahelp command

* set menu visibility command

* commit

* show mechanisms command

* toggle health overlay command

* toggle outline command

* stage

* disable once

* ioc

* namespaces

* WriteError

* clean up command usage

* don't abbriviate

* ActionsCommands

* AtmosDebugCommands

* the rest

* oops

* undo
This commit is contained in:
PrPleGoo
2024-01-03 23:29:37 +01:00
committed by GitHub
parent e790e59e19
commit 0e306e7862
28 changed files with 495 additions and 447 deletions

View File

@@ -1,21 +1,21 @@
using Content.Client.HealthOverlay;
using Content.Client.HealthOverlay;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
namespace Content.Client.Commands
namespace Content.Client.Commands;
public sealed class ToggleHealthOverlayCommand : LocalizedCommands
{
public sealed class ToggleHealthOverlayCommand : IConsoleCommand
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
public override string Command => "togglehealthoverlay";
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
public string Command => "togglehealthoverlay";
public string Description => "Toggles a health bar above mobs.";
public string Help => $"Usage: {Command}";
var system = _entitySystemManager.GetEntitySystem<HealthOverlaySystem>();
system.Enabled = !system.Enabled;
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")}.");
}
shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-notify", ("state", system.Enabled ? "enabled" : "disabled")));
}
}