Allow all sprites to use interpolated facings.
This commit is contained in:
@@ -23,14 +23,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Defines sequence to derive facings from.")]
|
||||
public readonly string Sequence = "idle";
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race)
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequences, string faction)
|
||||
{
|
||||
if (string.IsNullOrEmpty(Sequence))
|
||||
throw new InvalidOperationException("Actor " + ai.Name + " is missing sequence to quantize facings from.");
|
||||
throw new InvalidOperationException($"Actor {ai.Name} is missing sequence to quantize facings from.");
|
||||
|
||||
var rsi = ai.TraitInfo<RenderSpritesInfo>();
|
||||
var seq = sequenceProvider.GetSequence(rsi.GetImage(ai, race), Sequence);
|
||||
return seq.InterpolatedFacings == -1 ? seq.Facings : seq.InterpolatedFacings;
|
||||
return sequences.GetSequence(rsi.GetImage(ai, faction), Sequence).Facings;
|
||||
}
|
||||
|
||||
public override object Create(ActorInitializer init) { return new QuantizeFacingsFromSequence(this); }
|
||||
|
||||
Reference in New Issue
Block a user