Add support for transient text notifications matching speech notifications

This commit is contained in:
Ivaylo Draganov
2022-01-08 18:28:25 +02:00
committed by Paul Chote
parent 9f723be65a
commit 24b9482cc1
50 changed files with 372 additions and 46 deletions

View File

@@ -46,9 +46,12 @@ namespace OpenRA.Mods.Common.Traits
public readonly CVec[] Path = Array.Empty<CVec>();
[NotificationReference("Speech")]
[Desc("The speech notification to play when setting a new rallypoint.")]
[Desc("Speech notification to play when setting a new rallypoint.")]
public readonly string Notification = null;
[Desc("Text notification to display when setting a new rallypoint.")]
public readonly string TextNotification = null;
[Desc("Used to group equivalent actors to allow force-setting a rallypoint (e.g. for Primary production).")]
public readonly string ForceSetType = null;
@@ -101,6 +104,7 @@ namespace OpenRA.Mods.Common.Traits
if (order.OrderID == OrderID)
{
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.Notification, self.Owner.Faction.InternalName);
TextNotificationsManager.AddTransientLine(Info.TextNotification, self.Owner);
return new Order(order.OrderID, self, target, queued)
{