add audio feedback to stop/scatter/deploy junk

This commit is contained in:
Chris Forbes
2011-03-06 10:22:40 +13:00
parent 1a6ff61836
commit 65a54ba13a
3 changed files with 36 additions and 18 deletions

View File

@@ -99,17 +99,9 @@ namespace OpenRA.Widgets
if (world.OrderGenerator == null) return;
var orders = world.OrderGenerator.Order(world, xy.ToInt2(), mi).ToArray();
orders.Do( o => world.IssueOrder( o ) );
// Find an actor with a phrase to say
foreach (var o in orders)
{
if (o.Subject.Destroyed) continue;
foreach (var v in o.Subject.TraitsImplementing<IOrderVoice>())
if (Sound.PlayVoice(v.VoicePhraseForOrder(o.Subject, o),
o.Subject, o.Subject.Owner.Country.Race))
return;
}
orders.Do( o => world.IssueOrder( o ) );
world.PlayVoiceForOrders(orders);
}
public override string GetCursor(int2 pos)