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,45 +1,41 @@
using System;
using Content.Client.Administration;
using Content.Client.Administration.Systems;
using Content.Client.UserInterface.Systems.Bwoink;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Content.Shared.Administration;
using Robust.Client.UserInterface;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.Network;
namespace Content.Client.Commands
{
[AnyCommand]
public sealed class OpenAHelpCommand : IConsoleCommand
{
public string Command => "openahelp";
public string Description => $"Opens AHelp channel for a given NetUserID, or your personal channel if none given.";
public string Help => $"{Command} [<netuserid>]";
namespace Content.Client.Commands;
public void Execute(IConsoleShell shell, string argStr, string[] args)
[AnyCommand]
public sealed class OpenAHelpCommand : LocalizedCommands
{
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
public override string Command => "openahelp";
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length >= 2)
{
if (args.Length >= 2)
shell.WriteLine(Help);
return;
}
if (args.Length == 0)
{
_userInterfaceManager.GetUIController<AHelpUIController>().Open();
}
else
{
if (Guid.TryParse(args[0], out var guid))
{
shell.WriteLine(Help);
return;
}
if (args.Length == 0)
{
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<AHelpUIController>().Open();
var targetUser = new NetUserId(guid);
_userInterfaceManager.GetUIController<AHelpUIController>().Open(targetUser);
}
else
{
if (Guid.TryParse(args[0], out var guid))
{
var targetUser = new NetUserId(guid);
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<AHelpUIController>().Open(targetUser);
}
else
{
shell.WriteLine("Bad GUID!");
}
shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
}
}
}