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

@@ -14,6 +14,7 @@ namespace OpenRA.Mods.RA.Widgets
public char AttackMoveKey = 'a';
public char StopKey = 's';
public char ScatterKey = 'x';
public readonly OrderManager OrderManager;
[ObjectCreator.UseCtor]
@@ -46,6 +47,9 @@ namespace OpenRA.Mods.RA.Widgets
if (e.KeyChar == StopKey)
return PerformStop();
if (e.KeyChar == ScatterKey)
return PerformScatter();
}
return false;
@@ -67,5 +71,14 @@ namespace OpenRA.Mods.RA.Widgets
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;
}
}
}