From 6af377030cbb50d44da567a43226eb66a95b3020 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 2 Jan 2016 12:42:57 +0000 Subject: [PATCH] Add sequence parameter to SpriteEffect. --- OpenRA.Game/Effects/SpriteEffect.cs | 4 ++-- OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs | 2 +- OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs | 2 +- OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/Effects/SpriteEffect.cs b/OpenRA.Game/Effects/SpriteEffect.cs index c415dfab19..46929ebd6a 100644 --- a/OpenRA.Game/Effects/SpriteEffect.cs +++ b/OpenRA.Game/Effects/SpriteEffect.cs @@ -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) diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index 232b4cdbe4..6bcf07d067 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", true))); + world.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, world, "moveflsh", "idle", "moveflash", true))); flashed = true; } } diff --git a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs index 6ca9e85c01..30bb428a59 100644 --- a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs +++ b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs @@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Traits self.World.Map.CenterOfCell(cachedCell); if (info.TerrainTypes.Contains(type) && !string.IsNullOrEmpty(info.Image)) - self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, self.World, info.Image, info.Palette))); + self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, self.World, info.Image, "idle", info.Palette))); cachedPosition = self.CenterPosition; ticks = 0; diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs index f0f4f21f46..d704651789 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs @@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits Game.Sound.Play(info.DeploySound, location); if (!string.IsNullOrEmpty(info.EffectSequence) && !string.IsNullOrEmpty(info.EffectPalette)) - w.Add(new SpriteEffect(location, w, info.EffectSequence, info.EffectPalette)); + w.Add(new SpriteEffect(location, w, info.EffectSequence, "idle", info.EffectPalette)); var actor = w.CreateActor(info.Actor, new TypeDictionary {