]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
ShowEmergencyShuttleCommand and MeleeSpreadCommand LEC conversion. (#37993)
authorKyle Tyo <36606155+VerinSenpai@users.noreply.github.com>
Sat, 7 Jun 2025 00:28:00 +0000 (20:28 -0400)
committerGitHub <noreply@github.com>
Sat, 7 Jun 2025 00:28:00 +0000 (20:28 -0400)
progress

Content.Client/Shuttles/Commands/ShowEmergencyShuttleCommand.cs
Content.Client/Weapons/Melee/MeleeSpreadCommand.cs
Resources/Locale/en-US/commands/melee-spread-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/show-emergency-shuttle-command.ftl [new file with mode: 0644]

index 51430ca315885ab8082d0e9bc5c63da96587db6c..d14136957fc94652a7a5bc8e4b58daee0a4418aa 100644 (file)
@@ -3,15 +3,15 @@ using Robust.Shared.Console;
 
 namespace Content.Client.Shuttles.Commands;
 
-public sealed class ShowEmergencyShuttleCommand : IConsoleCommand
+public sealed class ShowEmergencyShuttleCommand : LocalizedEntityCommands
 {
-    public string Command => "showemergencyshuttle";
-    public string Description => "Shows the expected position of the emergency shuttle";
-    public string Help => $"{Command}";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    [Dependency] private readonly ShuttleSystem _shuttle = default!;
+
+    public override string Command => "showemergencyshuttle";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var tstalker = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ShuttleSystem>();
-        tstalker.EnableShuttlePosition ^= true;
-        shell.WriteLine($"Set emergency shuttle debug to {tstalker.EnableShuttlePosition}");
+        _shuttle.EnableShuttlePosition ^= true;
+        shell.WriteLine(Loc.GetString($"cmd-showemergencyshuttle-status", ("status", _shuttle.EnableShuttlePosition)));
     }
 }
index eda469deaf0f0e0ef1813875e61b8cb5a300249a..1eb82bde1cd7c0a2588a43d9ae9cd3823d1bc5d2 100644 (file)
@@ -3,39 +3,33 @@ using Robust.Client.Graphics;
 using Robust.Client.Input;
 using Robust.Client.Player;
 using Robust.Shared.Console;
-using Robust.Shared.Map;
 
 namespace Content.Client.Weapons.Melee;
 
-
-public sealed class MeleeSpreadCommand : IConsoleCommand
+public sealed class MeleeSpreadCommand : LocalizedEntityCommands
 {
-    public string Command => "showmeleespread";
-    public string Description => "Shows the current weapon's range and arc for debugging";
-    public string Help => $"{Command}";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
-    {
-        var collection = IoCManager.Instance;
-
-        if (collection == null)
-            return;
+    [Dependency] private readonly IEyeManager _eyeManager = default!;
+    [Dependency] private readonly IInputManager _inputManager = default!;
+    [Dependency] private readonly IOverlayManager _overlay = default!;
+    [Dependency] private readonly IPlayerManager _playerManager = default!;
+    [Dependency] private readonly MeleeWeaponSystem _meleeSystem = default!;
+    [Dependency] private readonly SharedCombatModeSystem _combatSystem = default!;
+    [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
 
-        var overlayManager = collection.Resolve<IOverlayManager>();
+    public override string Command => "showmeleespread";
 
-        if (overlayManager.RemoveOverlay<MeleeArcOverlay>())
-        {
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
+    {
+        if (_overlay.RemoveOverlay<MeleeArcOverlay>())
             return;
-        }
-
-        var sysManager = collection.Resolve<IEntitySystemManager>();
 
-        overlayManager.AddOverlay(new MeleeArcOverlay(
-            collection.Resolve<IEntityManager>(),
-            collection.Resolve<IEyeManager>(),
-            collection.Resolve<IInputManager>(),
-            collection.Resolve<IPlayerManager>(),
-            sysManager.GetEntitySystem<MeleeWeaponSystem>(),
-            sysManager.GetEntitySystem<SharedCombatModeSystem>(),
-            sysManager.GetEntitySystem<SharedTransformSystem>()));
+        _overlay.AddOverlay(new MeleeArcOverlay(
+            EntityManager,
+            _eyeManager,
+            _inputManager,
+            _playerManager,
+            _meleeSystem,
+            _combatSystem,
+            _transformSystem));
     }
 }
diff --git a/Resources/Locale/en-US/commands/melee-spread-command.ftl b/Resources/Locale/en-US/commands/melee-spread-command.ftl
new file mode 100644 (file)
index 0000000..7e62fb5
--- /dev/null
@@ -0,0 +1 @@
+cmd-showmeleespread-desc = Shows the current weapon's range and arc for debugging.
diff --git a/Resources/Locale/en-US/commands/show-emergency-shuttle-command.ftl b/Resources/Locale/en-US/commands/show-emergency-shuttle-command.ftl
new file mode 100644 (file)
index 0000000..e514946
--- /dev/null
@@ -0,0 +1,2 @@
+cmd-showemergencyshuttle-desc = Shows the expected position of the emergency shuttle.
+cmd-showemergencyshuttle-status = Set emergency shuttle debug to {$status}.