generalize rough cursor to be customizable for any terrain type

This commit is contained in:
Chris Forbes
2012-07-01 12:47:28 +12:00
parent 63d21eac8c
commit f2ab8a8541
3 changed files with 7 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ namespace OpenRA.FileFormats
public string[] AcceptsSmudgeType = { }; public string[] AcceptsSmudgeType = { };
public bool IsWater = false; public bool IsWater = false;
public Color Color; public Color Color;
public string CustomCursor;
public TerrainTypeInfo() {} public TerrainTypeInfo() {}
public TerrainTypeInfo(MiniYaml my) { FieldLoader.Load(this, my); } public TerrainTypeInfo(MiniYaml my) { FieldLoader.Load(this, my); }

View File

@@ -456,8 +456,10 @@ namespace OpenRA.Mods.RA.Move
{ {
IsQueued = forceQueued; IsQueued = forceQueued;
cursor = "move"; cursor = "move";
if (self.World.LocalPlayer.Shroud.IsExplored(location) && self.World.GetTerrainType(location) == "Rough")
cursor = "move-rough"; if (self.World.LocalPlayer.Shroud.IsExplored(location))
cursor = self.World.GetTerrainInfo(location).CustomCursor ?? cursor;
if (!self.World.Map.IsInMap(location) || (self.World.LocalPlayer.Shroud.IsExplored(location) && if (!self.World.Map.IsInMap(location) || (self.World.LocalPlayer.Shroud.IsExplored(location) &&
unitType.MovementCostForCell(self.World, location) == int.MaxValue)) unitType.MovementCostForCell(self.World, location) == int.MaxValue))
cursor = "move-blocked"; cursor = "move-blocked";

View File

@@ -31,6 +31,7 @@ Terrain:
AcceptsSmudgeType: AcceptsSmudgeType:
IsWater: False IsWater: False
Color: 255,88,116,116 Color: 255,88,116,116
CustomCursor: move-rough
TerrainType@Concrete: TerrainType@Concrete:
Type: Concrete Type: Concrete
AcceptsSmudgeType: AcceptsSmudgeType:
@@ -4788,4 +4789,4 @@ Templates:
PickAny: False PickAny: False
Tiles: Tiles:
0: Rough 0: Rough
1: Rough 1: Rough