Add sequence parameter to SpriteEffect.
This commit is contained in:
@@ -20,13 +20,13 @@ namespace OpenRA.Effects
|
|||||||
readonly WPos pos;
|
readonly WPos pos;
|
||||||
readonly bool scaleSizeWithZoom;
|
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.pos = pos;
|
||||||
this.palette = palette;
|
this.palette = palette;
|
||||||
this.scaleSizeWithZoom = scaleSizeWithZoom;
|
this.scaleSizeWithZoom = scaleSizeWithZoom;
|
||||||
anim = new Animation(world, image);
|
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)
|
public void Tick(World world)
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ namespace OpenRA.Widgets
|
|||||||
else if (o.TargetLocation != CPos.Zero)
|
else if (o.TargetLocation != CPos.Zero)
|
||||||
{
|
{
|
||||||
var pos = world.Map.CenterOfCell(cell);
|
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;
|
flashed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
self.World.Map.CenterOfCell(cachedCell);
|
self.World.Map.CenterOfCell(cachedCell);
|
||||||
|
|
||||||
if (info.TerrainTypes.Contains(type) && !string.IsNullOrEmpty(info.Image))
|
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;
|
cachedPosition = self.CenterPosition;
|
||||||
ticks = 0;
|
ticks = 0;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.Play(info.DeploySound, location);
|
Game.Sound.Play(info.DeploySound, location);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.EffectSequence) && !string.IsNullOrEmpty(info.EffectPalette))
|
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
|
var actor = w.CreateActor(info.Actor, new TypeDictionary
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user