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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user