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,30 +1,26 @@
using Content.Shared.Body.Organ;
using Robust.Client.Console;
using Content.Shared.Body.Organ;
using Robust.Client.GameObjects;
using Robust.Shared.Console;
namespace Content.Client.Commands
namespace Content.Client.Commands;
public sealed class ShowMechanismsCommand : LocalizedCommands
{
public sealed class ShowMechanismsCommand : IConsoleCommand
[Dependency] private readonly IEntityManager _entManager = default!;
public const string CommandName = "showmechanisms";
public override string Command => CommandName;
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
public const string CommandName = "showmechanisms";
var query = _entManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
// ReSharper disable once StringLiteralTypo
public string Command => CommandName;
public string Description => "Makes mechanisms visible, even when they shouldn't be.";
public string Help => $"{Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
while (query.MoveNext(out _, out var sprite))
{
var entityManager = IoCManager.Resolve<IEntityManager>();
var query = entityManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
while (query.MoveNext(out _, out var sprite))
{
sprite.ContainerOccluded = false;
}
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand("showcontainedcontext");
sprite.ContainerOccluded = false;
}
}
}