Implement INotifyDamageStateChanged explicitly in WithSpriteBody
This commit is contained in:
@@ -83,7 +83,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
return int2.Lerp(0, DefaultAnimation.CurrentSequence.Length - 1, gate.Position, gate.OpenPosition);
|
return int2.Lerp(0, DefaultAnimation.CurrentSequence.Length - 1, gate.Position, gate.OpenPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DamageStateChanged(Actor self, AttackInfo e)
|
protected override void DamageStateChanged(Actor self)
|
||||||
{
|
{
|
||||||
UpdateState(self);
|
UpdateState(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,10 +117,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
|
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void DamageStateChanged(Actor self, AttackInfo e)
|
protected virtual void DamageStateChanged(Actor self)
|
||||||
{
|
{
|
||||||
if (DefaultAnimation.CurrentSequence != null)
|
if (DefaultAnimation.CurrentSequence != null)
|
||||||
DefaultAnimation.ReplaceAnim(NormalizeSequence(self, DefaultAnimation.CurrentSequence.Name));
|
DefaultAnimation.ReplaceAnim(NormalizeSequence(self, DefaultAnimation.CurrentSequence.Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e)
|
||||||
|
{
|
||||||
|
DamageStateChanged(self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
turreted.QuantizedFacings = DefaultAnimation.CurrentSequence.Facings;
|
turreted.QuantizedFacings = DefaultAnimation.CurrentSequence.Facings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DamageStateChanged(Actor self, AttackInfo e)
|
protected override void DamageStateChanged(Actor self)
|
||||||
{
|
{
|
||||||
base.DamageStateChanged(self, e);
|
base.DamageStateChanged(self);
|
||||||
turreted.QuantizedFacings = DefaultAnimation.CurrentSequence.Facings;
|
turreted.QuantizedFacings = DefaultAnimation.CurrentSequence.Facings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
wallInfo = info;
|
wallInfo = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DamageStateChanged(Actor self, AttackInfo e)
|
protected override void DamageStateChanged(Actor self)
|
||||||
{
|
{
|
||||||
DefaultAnimation.PlayFetchIndex(NormalizeSequence(self, Info.Sequence), () => adjacent);
|
DefaultAnimation.PlayFetchIndex(NormalizeSequence(self, Info.Sequence), () => adjacent);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user