diff --git a/OpenRA.Game/Effects/SpriteEffect.cs b/OpenRA.Game/Effects/SpriteEffect.cs index 838f470c4c..c415dfab19 100644 --- a/OpenRA.Game/Effects/SpriteEffect.cs +++ b/OpenRA.Game/Effects/SpriteEffect.cs @@ -18,11 +18,13 @@ namespace OpenRA.Effects readonly string palette; readonly Animation anim; readonly WPos pos; + readonly bool scaleSizeWithZoom; - public SpriteEffect(WPos pos, World world, string image, string palette) + public SpriteEffect(WPos pos, World world, string image, string palette, bool scaleSizeWithZoom = false) { this.pos = pos; this.palette = palette; + this.scaleSizeWithZoom = scaleSizeWithZoom; anim = new Animation(world, image); anim.PlayThen("idle", () => world.AddFrameEndTask(w => w.Remove(this))); } @@ -34,7 +36,8 @@ namespace OpenRA.Effects public IEnumerable Render(WorldRenderer wr) { - return anim.Render(pos, WVec.Zero, 0, wr.Palette(palette), 1f / wr.Viewport.Zoom); + var zoom = scaleSizeWithZoom ? 1f / wr.Viewport.Zoom : 1f; + return anim.Render(pos, WVec.Zero, 0, wr.Palette(palette), zoom); } } } \ No newline at end of file diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index b2bfeb835f..232b4cdbe4 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -214,7 +214,7 @@ namespace OpenRA.Widgets else if (o.TargetLocation != CPos.Zero) { var pos = world.Map.CenterOfCell(cell); - world.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, world, "moveflsh", "moveflash"))); + world.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, world, "moveflsh", "moveflash", true))); flashed = true; } }