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)

View File

@@ -358,12 +358,13 @@ garadr:
ShadowStart: 5
Tick: 400
idle-dish: gtradr_a
Frames: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Length: 28
Length: 15
Reverses: True
Tick: 200
damaged-idle-dish: gtradr_a
Frames: 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16
Length: 28
Start: 15
Length: 15
Reverses: True
Tick: 240
make: gtradrmk
Length: 20