Command resolve killing, LEC conversions, and general cleanup. (#38338)

* i'm just gonna put this here.

* I'm just gonna do it.

* Update ShowHTNCommand.cs

* I feel dumb.

* may as well with this too.

* this does in fact not work

* :/
This commit is contained in:
Kyle Tyo
2025-06-17 14:08:12 -04:00
committed by GitHub
parent 0e1ff2644f
commit 9d22f6147c
20 changed files with 111 additions and 106 deletions

View File

@@ -1,48 +1,39 @@
using Content.Client.Administration.Managers;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Client.NodeContainer
{
public sealed class NodeVisCommand : IConsoleCommand
public sealed class NodeVisCommand : LocalizedEntityCommands
{
[Dependency] private readonly IEntityManager _e = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!;
[Dependency] private readonly NodeGroupSystem _nodeSystem = default!;
public string Command => "nodevis";
public string Description => "Toggles node group visualization";
public string Help => "";
public override string Command => "nodevis";
public void Execute(IConsoleShell shell, string argStr, string[] args)
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var adminMan = IoCManager.Resolve<IClientAdminManager>();
if (!adminMan.HasFlag(AdminFlags.Debug))
if (!_adminManager.HasFlag(AdminFlags.Debug))
{
shell.WriteError("You need +DEBUG for this command");
shell.WriteError(Loc.GetString($"shell-missing-required-permission", ("perm", "+DEBUG")));
return;
}
var sys = _e.System<NodeGroupSystem>();
sys.SetVisEnabled(!sys.VisEnabled);
_nodeSystem.SetVisEnabled(!_nodeSystem.VisEnabled);
}
}
public sealed class NodeVisFilterCommand : IConsoleCommand
public sealed class NodeVisFilterCommand : LocalizedEntityCommands
{
[Dependency] private readonly IEntityManager _e = default!;
[Dependency] private readonly NodeGroupSystem _nodeSystem = default!;
public string Command => "nodevisfilter";
public string Description => "Toggles showing a specific group on nodevis";
public string Help => "Usage: nodevis [filter]\nOmit filter to list currently masked-off";
public override string Command => "nodevisfilter";
public void Execute(IConsoleShell shell, string argStr, string[] args)
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var sys = _e.System<NodeGroupSystem>();
if (args.Length == 0)
{
foreach (var filtered in sys.Filtered)
foreach (var filtered in _nodeSystem.Filtered)
{
shell.WriteLine(filtered);
}
@@ -50,10 +41,8 @@ namespace Content.Client.NodeContainer
else
{
var filter = args[0];
if (!sys.Filtered.Add(filter))
{
sys.Filtered.Remove(filter);
}
if (!_nodeSystem.Filtered.Add(filter))
_nodeSystem.Filtered.Remove(filter);
}
}
}