Expose TransformsIntoAircraft move cursor to yaml.
This commit is contained in:
@@ -34,6 +34,14 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Require the force-move modifier to display the move cursor.")]
|
[Desc("Require the force-move modifier to display the move cursor.")]
|
||||||
public readonly bool RequiresForceMove = false;
|
public readonly bool RequiresForceMove = false;
|
||||||
|
|
||||||
|
[CursorReference]
|
||||||
|
[Desc("Cursor to display when a move order can be issued at target location.")]
|
||||||
|
public readonly string Cursor = "move";
|
||||||
|
|
||||||
|
[CursorReference]
|
||||||
|
[Desc("Cursor to display when a move order cannot be issued at target location.")]
|
||||||
|
public readonly string BlockedCursor = "move-blocked";
|
||||||
|
|
||||||
[CursorReference]
|
[CursorReference]
|
||||||
[Desc("Cursor to display when able to land at target building.")]
|
[Desc("Cursor to display when able to land at target building.")]
|
||||||
public readonly string EnterCursor = "enter";
|
public readonly string EnterCursor = "enter";
|
||||||
@@ -200,13 +208,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var location = self.World.Map.CellContaining(target.CenterPosition);
|
var location = self.World.Map.CellContaining(target.CenterPosition);
|
||||||
var explored = self.Owner.Shroud.IsExplored(location);
|
var explored = self.Owner.Shroud.IsExplored(location);
|
||||||
cursor = self.World.Map.Contains(location) ?
|
cursor = self.World.Map.Contains(location) ?
|
||||||
self.World.Map.GetTerrainInfo(location).CustomCursor ?? "move" : "move-blocked";
|
self.World.Map.GetTerrainInfo(location).CustomCursor ?? aircraft.Info.Cursor : aircraft.Info.BlockedCursor;
|
||||||
|
|
||||||
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
|
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
|
||||||
|
|
||||||
if (!(self.CurrentActivity is Transform || aircraft.transforms.Any(t => !t.IsTraitDisabled && !t.IsTraitPaused))
|
if (!(self.CurrentActivity is Transform || aircraft.transforms.Any(t => !t.IsTraitDisabled && !t.IsTraitPaused))
|
||||||
|| (!explored && !aircraft.Info.MoveIntoShroud))
|
|| (!explored && !aircraft.Info.MoveIntoShroud))
|
||||||
cursor = "move-blocked";
|
cursor = aircraft.Info.BlockedCursor;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user