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.
26 lines
670 B
C#
26 lines
670 B
C#
#region Copyright & License Information
|
|
/*
|
|
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
|
* This file is part of OpenRA, which is free software. It is made
|
|
* available to you under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation. For more information,
|
|
* see COPYING.
|
|
*/
|
|
#endregion
|
|
|
|
using OpenRA.Traits;
|
|
|
|
namespace OpenRA.Mods.Common.Traits
|
|
{
|
|
[Desc("Play the Build voice of this actor when trained.")]
|
|
public class AnnounceOnBuildInfo : TraitInfo<AnnounceOnBuild> { }
|
|
|
|
public class AnnounceOnBuild : INotifyBuildComplete
|
|
{
|
|
public void BuildingComplete(Actor self)
|
|
{
|
|
self.PlayVoice("Build");
|
|
}
|
|
}
|
|
}
|