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,33 +1,28 @@
using JetBrains.Annotations;
using System;
using Content.Client.Markers;
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
namespace Content.Client.Commands;
/// <summary>
/// Sent by mapping command to client.
/// This is because the debug commands for some of these options are on toggles.
/// </summary>
[UsedImplicitly]
internal sealed class MappingClientSideSetupCommand : IConsoleCommand
internal sealed class MappingClientSideSetupCommand : LocalizedCommands
{
// ReSharper disable once StringLiteralTypo
public string Command => "mappingclientsidesetup";
public string Description => "Sets up the lighting control and such settings client-side. Sent by 'mapping' to client.";
public string Help => "";
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly ILightManager _lightManager = default!;
public void Execute(IConsoleShell shell, string argStr, string[] args)
public override string Command => "mappingclientsidesetup";
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var mgr = IoCManager.Resolve<ILightManager>();
if (!mgr.LockConsoleAccess)
if (!_lightManager.LockConsoleAccess)
{
EntitySystem.Get<MarkerSystem>().MarkersVisible = true;
mgr.Enabled = false;
shell.ExecuteCommand("showsubfloorforever");
shell.ExecuteCommand("loadmapacts");
_entitySystemManager.GetEntitySystem<MarkerSystem>().MarkersVisible = true;
_lightManager.Enabled = false;
shell.ExecuteCommand(ShowSubFloorForever.CommandName);
shell.ExecuteCommand(LoadMappingActionsCommand.CommandName);
}
}
}