From 74d22f4db20909f0bdc00dd4b8dad412f05fb390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 6 Dec 2014 19:00:37 +0100 Subject: [PATCH] unhardcode the cursor definitions closes #7074 --- OpenRA.Mods.RA/Move/Mobile.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index d07c0e0f22..f61b46d704 100644 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -56,6 +56,9 @@ namespace OpenRA.Mods.RA.Move [Desc("Can the actor be ordered to move in to shroud?")] 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); } static object LoadSpeeds(MiniYaml y) @@ -620,12 +623,10 @@ namespace OpenRA.Mods.RA.Move var explored = self.Owner.Shroud.IsExplored(location); cursor = self.World.Map.Contains(location) ? - (self.World.Map.GetTerrainInfo(location).CustomCursor ?? "move") : - "move-blocked"; + (self.World.Map.GetTerrainInfo(location).CustomCursor ?? unitType.Cursor) : unitType.BlockedCursor; - if ((!explored && !unitType.MoveIntoShroud) || - (explored && unitType.MovementCostForCell(self.World, location) == int.MaxValue)) - cursor = "move-blocked"; + if ((!explored && !unitType.MoveIntoShroud) || (explored && unitType.MovementCostForCell(self.World, location) == int.MaxValue)) + cursor = unitType.BlockedCursor; return true; }