Merge pull request #7079 from Mailaender/mobile-cursor
Unhardcoded and self-documented the mobile cursor definitions
This commit is contained in:
@@ -56,6 +56,9 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
[Desc("Can the actor be ordered to move in to shroud?")]
|
[Desc("Can the actor be ordered to move in to shroud?")]
|
||||||
public readonly bool MoveIntoShroud = true;
|
public readonly bool MoveIntoShroud = true;
|
||||||
|
|
||||||
|
public readonly string Cursor = "move";
|
||||||
|
public readonly string BlockedCursor = "move-blocked";
|
||||||
|
|
||||||
public virtual object Create(ActorInitializer init) { return new Mobile(init, this); }
|
public virtual object Create(ActorInitializer init) { return new Mobile(init, this); }
|
||||||
|
|
||||||
static object LoadSpeeds(MiniYaml y)
|
static object LoadSpeeds(MiniYaml y)
|
||||||
@@ -620,12 +623,10 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
|
|
||||||
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") :
|
(self.World.Map.GetTerrainInfo(location).CustomCursor ?? unitType.Cursor) : unitType.BlockedCursor;
|
||||||
"move-blocked";
|
|
||||||
|
|
||||||
if ((!explored && !unitType.MoveIntoShroud) ||
|
if ((!explored && !unitType.MoveIntoShroud) || (explored && unitType.MovementCostForCell(self.World, location) == int.MaxValue))
|
||||||
(explored && unitType.MovementCostForCell(self.World, location) == int.MaxValue))
|
cursor = unitType.BlockedCursor;
|
||||||
cursor = "move-blocked";
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user