Add support for transient text notifications matching speech notifications
This commit is contained in:
committed by
Paul Chote
parent
9f723be65a
commit
24b9482cc1
@@ -25,6 +25,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[NotificationReference("Speech")]
|
||||
public readonly string SpeechNotification = null;
|
||||
|
||||
public readonly string TextNotification = null;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new PowerManager(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -161,6 +163,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (isLowPower && Game.RunTime > lastPowerAdviceTime + info.AdviceInterval)
|
||||
{
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName);
|
||||
TextNotificationsManager.AddTransientLine(info.TextNotification, self.Owner);
|
||||
|
||||
lastPowerAdviceTime = Game.RunTime;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user