Files
tbd-station-14/Content.Client/Commands/DebugCommands.cs
PrPleGoo 0e306e7862 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
2024-01-03 17:29:37 -05:00

77 lines
2.6 KiB
C#

using Content.Client.Markers;
using Content.Client.Popups;
using Content.Client.SubFloor;
using Content.Shared.SubFloor;
using Robust.Client.GameObjects;
using Robust.Shared.Console;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Commands;
internal sealed class ShowMarkersCommand : LocalizedCommands
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
public override string Command => "showmarkers";
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
_entitySystemManager.GetEntitySystem<MarkerSystem>().MarkersVisible ^= true;
}
}
internal sealed class ShowSubFloor : LocalizedCommands
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
public override string Command => "showsubfloor";
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
_entitySystemManager.GetEntitySystem<SubFloorHideSystem>().ShowAll ^= true;
}
}
internal sealed class ShowSubFloorForever : LocalizedCommands
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
public const string CommandName = "showsubfloorforever";
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)
{
_entitySystemManager.GetEntitySystem<SubFloorHideSystem>().ShowAll = true;
var entMan = IoCManager.Resolve<IEntityManager>();
var components = entMan.EntityQuery<SubFloorHideComponent, SpriteComponent>(true);
foreach (var (_, sprite) in components)
{
sprite.DrawDepth = (int) DrawDepth.Overlays;
}
}
}
internal sealed class NotifyCommand : LocalizedCommands
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
public override string Command => "notify";
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var message = args[0];
_entitySystemManager.GetEntitySystem<PopupSystem>().PopupCursor(message);
}
}