Make WithSpriteBody always use Animation.PlayRepeating

... for looped sequences.

PlayCustomAnimationRepeating looping back into itself via Action instead of simply using Animation.PlayRepeating is weird, and in fact causes a slight 'desync' in animation speed with Animation.PlayRepeating in at least one downstream mod.
This commit is contained in:
reaperrr
2018-09-08 01:43:22 +02:00
committed by abcdefg30
parent 9bcb754836
commit 1098804f9b

View File

@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits.Render
if (info.StartSequence != null)
PlayCustomAnimation(init.Self, info.StartSequence,
() => PlayCustomAnimationRepeating(init.Self, info.Sequence));
() => DefaultAnimation.PlayRepeating(NormalizeSequence(init.Self, info.Sequence)));
else
DefaultAnimation.PlayRepeating(NormalizeSequence(init.Self, info.Sequence));
}
@@ -103,8 +103,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public void PlayCustomAnimationRepeating(Actor self, string name)
{
var sequence = NormalizeSequence(self, name);
DefaultAnimation.PlayThen(sequence, () => PlayCustomAnimationRepeating(self, sequence));
DefaultAnimation.PlayRepeating(NormalizeSequence(self, name));
}
public void PlayCustomAnimationBackwards(Actor self, string name, Action after = null)