From d9da8be53631ebfc04e5792422a9653e5527f594 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 10 Apr 2010 12:31:46 +1200 Subject: [PATCH] convert spy plane to generic SelectTarget --- OpenRA.Mods.RA/SpyPlanePower.cs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/OpenRA.Mods.RA/SpyPlanePower.cs b/OpenRA.Mods.RA/SpyPlanePower.cs index 305b6a5c80..b984372e88 100644 --- a/OpenRA.Mods.RA/SpyPlanePower.cs +++ b/OpenRA.Mods.RA/SpyPlanePower.cs @@ -21,6 +21,7 @@ using System.Collections.Generic; using OpenRA.Traits; using OpenRA.Traits.Activities; +using OpenRA.Orders; namespace OpenRA.Mods.RA { @@ -37,7 +38,7 @@ namespace OpenRA.Mods.RA protected override void OnFinishCharging() { Sound.PlayToPlayer(Owner, "spypln1.aud"); } protected override void OnActivate() { - Game.controller.orderGenerator = new SelectTarget(); + Game.controller.orderGenerator = new GenericSelectTarget(Owner.PlayerActor, "SpyPlane", "ability"); Sound.Play("slcttgt1.aud"); } @@ -69,24 +70,5 @@ namespace OpenRA.Mods.RA plane.QueueActivity(new RemoveSelf()); } } - - class SelectTarget : IOrderGenerator - { - public IEnumerable Order(World world, int2 xy, MouseInput mi) - { - if (mi.Button == MouseButton.Right) - { - Game.controller.CancelInputMode(); - yield break; - } - - yield return new Order("SpyPlane", world.LocalPlayer.PlayerActor, xy); - } - - public void Tick(World world) {} - public void Render(World world) {} - - public string GetCursor(World world, int2 xy, MouseInput mi) { return "ability"; } - } } }