From ab7907c5a17d7a2b20fa0dd690857de2f4076212 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Thu, 21 Jan 2016 17:43:41 +0100 Subject: [PATCH] Unhardcode the chronoshift cursor sequences --- .../Traits/SupportPowers/ChronoshiftPower.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs index 6ff78816d5..4e54977fc9 100644 --- a/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs @@ -36,6 +36,15 @@ namespace OpenRA.Mods.RA.Traits public readonly bool KillCargo = true; + [Desc("Cursor sequence to use when selecting targets for the chronoshift.")] + public readonly string SelectionCursor = "chrono-select"; + + [Desc("Cursor sequence to use when targeting an area for the chronoshift.")] + public readonly string TargetCursor = "chrono-target"; + + [Desc("Cursor sequence to use when the targeted area is blocked.")] + public readonly string TargetBlockedCursor = "move-blocked"; + public override object Create(ActorInitializer init) { return new ChronoshiftPower(init.Self, this); } } @@ -162,7 +171,7 @@ namespace OpenRA.Mods.RA.Traits public string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { - return "chrono-select"; + return ((ChronoshiftPowerInfo)power.Info).SelectionCursor; } } @@ -295,7 +304,8 @@ namespace OpenRA.Mods.RA.Traits public string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { - return IsValidTarget(cell) ? "chrono-target" : "move-blocked"; + var powerInfo = (ChronoshiftPowerInfo)power.Info; + return IsValidTarget(cell) ? powerInfo.TargetCursor : powerInfo.TargetBlockedCursor; } } }