Convert a few debugging commands and the mapping setup command to LEC. (#38589)

* commit

* Update MappingClientSideSetupCommand.cs

* missed a spot

* Update MappingClientSideSetupCommand.cs

* whoopos

* Update mappingclientsidesetup-command.ftl
This commit is contained in:
Kyle Tyo
2025-07-28 12:29:15 -04:00
committed by GitHub
parent cb9b8c001d
commit a52bf2a7c8
3 changed files with 22 additions and 36 deletions

View File

@@ -1,53 +1,42 @@
using Content.Client.Markers; using Content.Client.Markers;
using Content.Client.Popups; using Content.Client.Popups;
using Content.Client.SubFloor; using Content.Client.SubFloor;
using Content.Shared.SubFloor;
using Robust.Client.GameObjects;
using Robust.Shared.Console; using Robust.Shared.Console;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Commands; namespace Content.Client.Commands;
internal sealed class ShowMarkersCommand : LocalizedCommands internal sealed class ShowMarkersCommand : LocalizedEntityCommands
{ {
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; [Dependency] private readonly MarkerSystem _markerSystem = default!;
public override string Command => "showmarkers"; 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) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
_entitySystemManager.GetEntitySystem<MarkerSystem>().MarkersVisible ^= true; _markerSystem.MarkersVisible ^= true;
} }
} }
internal sealed class ShowSubFloor : LocalizedCommands internal sealed class ShowSubFloor : LocalizedEntityCommands
{ {
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; [Dependency] private readonly SubFloorHideSystem _subfloorSystem = default!;
public override string Command => "showsubfloor"; 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) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
_entitySystemManager.GetEntitySystem<SubFloorHideSystem>().ShowAll ^= true; _subfloorSystem.ShowAll ^= true;
} }
} }
internal sealed class NotifyCommand : LocalizedCommands internal sealed class NotifyCommand : LocalizedEntityCommands
{ {
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; [Dependency] private readonly PopupSystem _popupSystem = default!;
public override string Command => "notify"; 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) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var message = args[0]; _popupSystem.PopupCursor(args[0]);
_entitySystemManager.GetEntitySystem<PopupSystem>().PopupCursor(message);
} }
} }

View File

@@ -1,32 +1,29 @@
using Content.Client.Actions; using Content.Client.Actions;
using Content.Client.Mapping;
using Content.Client.Markers; using Content.Client.Markers;
using JetBrains.Annotations; using Content.Client.SubFloor;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.State;
using Robust.Shared.Console; using Robust.Shared.Console;
namespace Content.Client.Commands; namespace Content.Client.Commands;
[UsedImplicitly] internal sealed class MappingClientSideSetupCommand : LocalizedEntityCommands
internal sealed class MappingClientSideSetupCommand : LocalizedCommands
{ {
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly ILightManager _lightManager = default!; [Dependency] private readonly ILightManager _lightManager = default!;
[Dependency] private readonly ActionsSystem _actionSystem = default!;
[Dependency] private readonly MarkerSystem _markerSystem = default!;
[Dependency] private readonly SubFloorHideSystem _subfloorSystem = default!;
public override string Command => "mappingclientsidesetup"; 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) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
if (!_lightManager.LockConsoleAccess) if (_lightManager.LockConsoleAccess)
{ return;
_entitySystemManager.GetEntitySystem<MarkerSystem>().MarkersVisible = true;
_markerSystem.MarkersVisible = true;
_lightManager.Enabled = false; _lightManager.Enabled = false;
shell.ExecuteCommand("showsubfloor"); _subfloorSystem.ShowAll = true;
_entitySystemManager.GetEntitySystem<ActionsSystem>().LoadActionAssignments("/mapping_actions.yml", false); _actionSystem.LoadActionAssignments("/mapping_actions.yml", false);
}
} }
} }

View File

@@ -1,2 +1,2 @@
cmd-mappingclientsidesetup-desc = Sets up the lighting control and such settings client-side. Sent by 'mapping' to client. cmd-mappingclientsidesetup-desc = Sets up the lighting control and such settings client-side. Sent by 'mapping' to client.
cmd-mappingclientsidesetup-help = Usage: {$command} cmd-mappingclientsidesetup-help = Usage: mappingclientsidesetup