Add sequence parameter to SpriteEffect.

This commit is contained in:
Paul Chote
2016-01-02 12:42:57 +00:00
parent 8d7ed98636
commit 6af377030c
4 changed files with 5 additions and 5 deletions

View File

@@ -20,13 +20,13 @@ namespace OpenRA.Effects
readonly WPos pos;
readonly bool scaleSizeWithZoom;
public SpriteEffect(WPos pos, World world, string image, string palette, bool scaleSizeWithZoom = false)
public SpriteEffect(WPos pos, World world, string image, string sequence, 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)));
anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
}
public void Tick(World world)

View File

@@ -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", true)));
world.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, world, "moveflsh", "idle", "moveflash", true)));
flashed = true;
}
}