generalize rough cursor to be customizable for any terrain type
This commit is contained in:
@@ -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); }
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user