add scale:multiplyvector toolshed command (#39424)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user