add scale:multiplyvector toolshed command (#39424)

This commit is contained in:
slarticodefast
2025-08-06 19:23:05 +02:00
committed by GitHub
parent 96dcfa9b94
commit fdf39dbffb
2 changed files with 15 additions and 0 deletions

View 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)
{

View 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).