Add a Reverses sequence key for TS/RA2 animations.

This commit is contained in:
Paul Chote
2015-03-23 20:15:02 +00:00
parent 4d60757611
commit 4baf639130
2 changed files with 13 additions and 4 deletions

View File

@@ -129,6 +129,14 @@ namespace OpenRA.Mods.Common.Graphics
else
Length = LoadField<int>(d, "Length", 1);
// Plays the animation forwards, and then in reverse
if (LoadField<bool>(d, "Reverses", false))
{
var frames = Frames ?? Exts.MakeArray(Length, i => Start + i);
Frames = frames.Concat(frames.Skip(1).Take(frames.Length - 2).Reverse()).ToArray();
Length = 2 * Length - 2;
}
Stride = LoadField<int>(d, "Stride", Length);
if (Length > Stride)