From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:23:05 +0000 (+0200) Subject: add scale:multiplyvector toolshed command (#39424) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=fdf39dbffb8573dfe3014f0e55eb3879142ee203;p=space-station-14.git add scale:multiplyvector toolshed command (#39424) --- diff --git a/Content.Server/Toolshed/Commands/Misc/ScaleCommand.cs b/Content.Server/Toolshed/Commands/Misc/ScaleCommand.cs index ab8cdf7ed9..67bd21737f 100644 --- a/Content.Server/Toolshed/Commands/Misc/ScaleCommand.cs +++ b/Content.Server/Toolshed/Commands/Misc/ScaleCommand.cs @@ -41,6 +41,19 @@ public sealed class ScaleCommand : ToolshedCommand } } + [CommandImplementation("multiplyvector")] + public IEnumerable Multiply([PipedArgument] IEnumerable input, Vector2 factor) + { + _scaleVisuals ??= GetSys(); + + foreach (var ent in input) + { + var scale = _scaleVisuals.GetSpriteScale(ent) * factor; + _scaleVisuals.SetSpriteScale(ent, scale); + yield return ent; + } + } + [CommandImplementation("multiplywithfixture")] public IEnumerable MultiplyWithFixture([PipedArgument] IEnumerable input, float factor) { diff --git a/Resources/Locale/en-US/commands/toolshed-commands.ftl b/Resources/Locale/en-US/commands/toolshed-commands.ftl index 08732fabac..cc5c03d52b 100644 --- a/Resources/Locale/en-US/commands/toolshed-commands.ftl +++ b/Resources/Locale/en-US/commands/toolshed-commands.ftl @@ -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).