Moved Voice-related extensions to VoiceExts.

Note: This is a work-around until Selectable can be moved to Mods.Common, which is when the voice extensions should be moved back to ActorExts.

Pulled phrase check before foreach in PlayVoice ActorExts.
Removed superflous actor parameter from PlayVoice/PlayVoiceLocal.

Simplified PlayVoice extensions.

variant is no longer customisable, as all current usages use self.Owner.Country.Race anyway.
This commit is contained in:
reaperrr
2015-05-21 15:48:30 +02:00
parent b9e8406aeb
commit 3777a8bca9
8 changed files with 80 additions and 58 deletions

View File

@@ -59,8 +59,7 @@ namespace OpenRA
var voicedActor = actors.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.IsInWorld && a.HasTrait<IVoiced>());
if (voicedActor != null)
foreach (var voice in voicedActor.TraitsImplementing<IVoiced>())
voice.PlayVoice(voicedActor, "Select", voicedActor.Owner.Country.Race);
voicedActor.PlayVoice("Select");
foreach (var a in newSelection)
foreach (var sel in a.TraitsImplementing<INotifySelected>())