Add AlwaysConsiderTurnAsMove plumbing to Mobile
Can be used to make walker units like the TS mechs display move animations while turning on the spot.
This commit is contained in:
@@ -225,6 +225,11 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
{
|
{
|
||||||
path.Add(nextCell.Value.First);
|
path.Add(nextCell.Value.First);
|
||||||
|
|
||||||
|
// If Mobile.Info.AlwaysConsiderTurnAsMove is true, we consider Turn as movement regardless of facing delta size.
|
||||||
|
// IsMoving is then set back to false in Turn.OnLastRun.
|
||||||
|
// This is needed for actors that want to display their movement animation during turns (walker units, for example).
|
||||||
|
mobile.IsMoving = mobile.Info.AlwaysConsiderTurnAsMove;
|
||||||
|
|
||||||
// HACK: To fix visual hiccups on actors with move animations during "L-turn to next part of movement" transitions
|
// HACK: To fix visual hiccups on actors with move animations during "L-turn to next part of movement" transitions
|
||||||
// or invisible mini-turns (due to less sprite facings than internal facings), we set IsMoving to 'true' during Turn activity
|
// or invisible mini-turns (due to less sprite facings than internal facings), we set IsMoving to 'true' during Turn activity
|
||||||
// when the facing delta is low enough to be covered with a single Turn tick.
|
// when the facing delta is low enough to be covered with a single Turn tick.
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Speed at which the actor turns.")]
|
[Desc("Speed at which the actor turns.")]
|
||||||
public readonly int TurnSpeed = 255;
|
public readonly int TurnSpeed = 255;
|
||||||
|
|
||||||
|
[Desc("Should turning always be considering as moving (instead of only turning while moving forward).")]
|
||||||
|
public readonly bool AlwaysConsiderTurnAsMove = false;
|
||||||
|
|
||||||
public readonly int Speed = 1;
|
public readonly int Speed = 1;
|
||||||
|
|
||||||
public readonly string Cursor = "move";
|
public readonly string Cursor = "move";
|
||||||
|
|||||||
Reference in New Issue
Block a user