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:
@@ -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>())
|
||||
|
||||
Reference in New Issue
Block a user