Add a scatter key

This commit is contained in:
Paul Chote
2011-02-06 13:15:47 +13:00
parent 47aad3b04b
commit e2af08f812
2 changed files with 18 additions and 0 deletions

View File

@@ -283,6 +283,11 @@ namespace OpenRA.Mods.RA.Move
if (order.OrderString == "Stop") if (order.OrderString == "Stop")
{ {
self.CancelActivity(); self.CancelActivity();
}
if (order.OrderString == "Scatter")
{
OnNudge(self, self);
} }
} }

View File

@@ -14,6 +14,7 @@ namespace OpenRA.Mods.RA.Widgets
public char AttackMoveKey = 'a'; public char AttackMoveKey = 'a';
public char StopKey = 's'; public char StopKey = 's';
public char ScatterKey = 'x';
public readonly OrderManager OrderManager; public readonly OrderManager OrderManager;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
@@ -46,6 +47,9 @@ namespace OpenRA.Mods.RA.Widgets
if (e.KeyChar == StopKey) if (e.KeyChar == StopKey)
return PerformStop(); return PerformStop();
if (e.KeyChar == ScatterKey)
return PerformScatter();
} }
return false; return false;
@@ -67,5 +71,14 @@ namespace OpenRA.Mods.RA.Widgets
return true; return true;
} }
bool PerformScatter()
{
/* issue a stop order to everyone. */
foreach (var a in World.Selection.Actors)
World.IssueOrder(new Order("Scatter", a, false));
return true;
}
} }
} }