]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
add scale:multiplyvector toolshed command (#39424)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Wed, 6 Aug 2025 17:23:05 +0000 (19:23 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Aug 2025 17:23:05 +0000 (19:23 +0200)
Content.Server/Toolshed/Commands/Misc/ScaleCommand.cs
Resources/Locale/en-US/commands/toolshed-commands.ftl

index ab8cdf7ed9fc52d17db5776f8953f4c3718ace25..67bd21737fee667f1b33c08363ebe8f3e6a755ff 100644 (file)
@@ -41,6 +41,19 @@ public sealed class ScaleCommand : ToolshedCommand
         }
     }
 
+    [CommandImplementation("multiplyvector")]
+    public IEnumerable<EntityUid> Multiply([PipedArgument] IEnumerable<EntityUid> input, Vector2 factor)
+    {
+        _scaleVisuals ??= GetSys<SharedScaleVisualsSystem>();
+
+        foreach (var ent in input)
+        {
+            var scale = _scaleVisuals.GetSpriteScale(ent) * factor;
+            _scaleVisuals.SetSpriteScale(ent, scale);
+            yield return ent;
+        }
+    }
+
     [CommandImplementation("multiplywithfixture")]
     public IEnumerable<EntityUid> MultiplyWithFixture([PipedArgument] IEnumerable<EntityUid> input, float factor)
     {
index 08732fabac974882814708abbf04ca60b9a2eadd..cc5c03d52b60a322a75459e4ac24fb8d13fdb08e 100644 (file)
@@ -102,5 +102,7 @@ command-description-scale-get =
     Get an entity's sprite scale as set by ScaleVisualsComponent. Does not include any changes directly made in the SpriteComponent.
 command-description-scale-multiply =
     Multiply an entity's sprite size with a certain factor (without changing its fixture).
+command-description-scale-multiplyvector =
+    Multiply an entity's sprite size with a certain 2d vector (without changing its fixture).
 command-description-scale-multiplywithfixture =
     Multiply an entity's sprite size with a certain factor (including its fixture).