]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Hide mechanism and show mechanism commands to LEC (#38587)
authorKyle Tyo <36606155+VerinSenpai@users.noreply.github.com>
Thu, 26 Jun 2025 13:00:44 +0000 (09:00 -0400)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 13:00:44 +0000 (15:00 +0200)
commit

Content.Client/Commands/HideMechanismsCommand.cs
Content.Client/Commands/ShowMechanismsCommand.cs
Resources/Locale/en-US/commands/hide-mechanisms-command.ftl
Resources/Locale/en-US/commands/show-mechanisms-command.ftl

index db68a562576ad8f597bb885af651776291e2f9b1..00e024a72cb516073bbb2ecbebbc4c0b3164f367 100644 (file)
@@ -5,32 +5,27 @@ using Robust.Shared.Containers;
 
 namespace Content.Client.Commands;
 
-public sealed class HideMechanismsCommand : LocalizedCommands
+public sealed class HideMechanismsCommand : LocalizedEntityCommands
 {
-    [Dependency] private readonly IEntityManager _entityManager = default!;
+    [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
+    [Dependency] private readonly SpriteSystem _spriteSystem = default!;
 
     public override string Command => "hidemechanisms";
 
-    public override string Description => LocalizationManager.GetString($"cmd-{Command}-desc", ("showMechanismsCommand", ShowMechanismsCommand.CommandName));
-
-    public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
-
     public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var containerSys = _entityManager.System<SharedContainerSystem>();
-        var spriteSys = _entityManager.System<SpriteSystem>();
-        var query = _entityManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
+        var query = EntityManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
 
         while (query.MoveNext(out var uid, out _, out var sprite))
         {
-            spriteSys.SetContainerOccluded((uid, sprite), false);
+            _spriteSystem.SetContainerOccluded((uid, sprite), false);
 
             var tempParent = uid;
-            while (containerSys.TryGetContainingContainer((tempParent, null, null), out var container))
+            while (_containerSystem.TryGetContainingContainer((tempParent, null, null), out var container))
             {
                 if (!container.ShowContents)
                 {
-                    spriteSys.SetContainerOccluded((uid, sprite), true);
+                    _spriteSystem.SetContainerOccluded((uid, sprite), true);
                     break;
                 }
 
index 19305b207c8117700d67fb3e3c8e7fce652bbbe3..091fe05f89e1c20b8e47b18d2317cceb35e679b2 100644 (file)
@@ -4,24 +4,19 @@ using Robust.Shared.Console;
 
 namespace Content.Client.Commands;
 
-public sealed class ShowMechanismsCommand : LocalizedCommands
+public sealed class ShowMechanismsCommand : LocalizedEntityCommands
 {
-    [Dependency] private readonly IEntityManager _entManager = default!;
+    [Dependency] private readonly SpriteSystem _spriteSystem = default!;
 
-    public const string CommandName = "showmechanisms";
-
-    public override string Command => CommandName;
-
-    public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
+    public override string Command => "showmechanisms";
 
     public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var spriteSys = _entManager.System<SpriteSystem>();
-        var query = _entManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
+        var query = EntityManager.AllEntityQueryEnumerator<OrganComponent, SpriteComponent>();
 
         while (query.MoveNext(out var uid, out _, out var sprite))
         {
-            spriteSys.SetContainerOccluded((uid, sprite), false);
+            _spriteSystem.SetContainerOccluded((uid, sprite), false);
         }
     }
 }
index 75c9cbc815cab746356c293d116610bc19271bd2..db15e90aa4bcc0c973ca687bb093f1591832962d 100644 (file)
@@ -1,2 +1,2 @@
-cmd-hidemechanisms-desc = Reverts the effects of {$showMechanismsCommand}
-cmd-hidemechanisms-help = Usage: {$command}
\ No newline at end of file
+cmd-hidemechanisms-desc = Reverts the effects of showmechanisms command.
+cmd-hidemechanisms-help = Usage: hidemechanisms
index 0512381b6349c0f1423e5112de55a7deb4f6d03f..0415482e8e3d008465322ee140055634d0525135 100644 (file)
@@ -1,2 +1,2 @@
 cmd-showmechanisms-desc = Makes mechanisms visible, even when they shouldn't be.
-cmd-showmechanisms-help = Usage: {$command}
\ No newline at end of file
+cmd-showmechanisms-help = Usage: showmechanisms