Add support for transient text notifications matching speech notifications
This commit is contained in:
committed by
Paul Chote
parent
9f723be65a
commit
24b9482cc1
@@ -28,10 +28,16 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Sound the victim will hear when technology gets stolen.")]
|
||||
public readonly string InfiltratedNotification = null;
|
||||
|
||||
[Desc("Text notification the victim will see when technology gets stolen.")]
|
||||
public readonly string InfiltratedTextNotification = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Sound the perpetrator will hear after successful infiltration.")]
|
||||
public readonly string InfiltrationNotification = null;
|
||||
|
||||
[Desc("Text notification the perpetrator will see after successful infiltration.")]
|
||||
public readonly string InfiltrationTextNotification = null;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForSupportPower(this); }
|
||||
}
|
||||
|
||||
@@ -55,6 +61,9 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
if (info.InfiltrationNotification != null)
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
||||
|
||||
TextNotificationsManager.AddTransientLine(info.InfiltratedTextNotification, self.Owner);
|
||||
TextNotificationsManager.AddTransientLine(info.InfiltrationTextNotification, infiltrator.Owner);
|
||||
|
||||
infiltrator.World.AddFrameEndTask(w => w.CreateActor(info.Proxy, new TypeDictionary
|
||||
{
|
||||
new OwnerInit(infiltrator.Owner)
|
||||
|
||||
Reference in New Issue
Block a user