Replace WithChargeAnimation with -SpriteBody

PlayFetchIndex on a With*Animation trait conflicts with the animation
concept, as it's bound to conflict with pretty much all 'normal'
animation traits and blocks progress on the animation priority system.

We also already have multiple precedent SpriteBody traits of similar kind,
like WithGateSpriteBody and WithWallSpriteBody.
This commit is contained in:
reaperrr
2018-12-13 23:32:47 +01:00
committed by Paul Chote
parent e292e88bff
commit 305d82f887
8 changed files with 177 additions and 58 deletions

View File

@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Traits.Render
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
}
public void PlayCustomAnimation(Actor self, string name, Action after = null)
public virtual void PlayCustomAnimation(Actor self, string name, Action after = null)
{
DefaultAnimation.PlayThen(NormalizeSequence(self, name), () =>
{
@@ -102,12 +102,12 @@ namespace OpenRA.Mods.Common.Traits.Render
});
}
public void PlayCustomAnimationRepeating(Actor self, string name)
public virtual void PlayCustomAnimationRepeating(Actor self, string name)
{
DefaultAnimation.PlayRepeating(NormalizeSequence(self, name));
}
public void PlayCustomAnimationBackwards(Actor self, string name, Action after = null)
public virtual void PlayCustomAnimationBackwards(Actor self, string name, Action after = null)
{
DefaultAnimation.PlayBackwardsThen(NormalizeSequence(self, name), () =>
{
@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Traits.Render
});
}
public void CancelCustomAnimation(Actor self)
public virtual void CancelCustomAnimation(Actor self)
{
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
}