Add support for transient text notifications matching speech notifications
This commit is contained in:
committed by
Paul Chote
parent
9f723be65a
commit
24b9482cc1
@@ -22,13 +22,19 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Sound the victim will hear when technology gets stolen.")]
|
||||
[Desc("Sound the victim will hear when they get sabotaged.")]
|
||||
public readonly string InfiltratedNotification = null;
|
||||
|
||||
[Desc("Text notification the victim will see when they get sabotaged.")]
|
||||
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 InfiltrateForSupportPowerReset(this); }
|
||||
}
|
||||
|
||||
@@ -52,6 +58,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);
|
||||
|
||||
var manager = self.Owner.PlayerActor.Trait<SupportPowerManager>();
|
||||
var powers = manager.GetPowersForActor(self).Where(sp => !sp.Disabled);
|
||||
foreach (var power in powers)
|
||||
|
||||
Reference in New Issue
Block a user