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

@@ -39,13 +39,19 @@ namespace OpenRA.Mods.Common.Traits
public readonly string[] NoTransformSounds = Array.Empty<string>();
[NotificationReference("Speech")]
[Desc("Notification to play when transforming.")]
[Desc("Speech notification to play when transforming.")]
public readonly string TransformNotification = null;
[Desc("Text notification to display when transforming.")]
public readonly string TransformTextNotification = null;
[NotificationReference("Speech")]
[Desc("Notification to play when the transformation is blocked.")]
[Desc("Speech notification to play when the transformation is blocked.")]
public readonly string NoTransformNotification = null;
[Desc("Text notification to display when the transformation is blocked.")]
public readonly string NoTransformTextNotification = null;
[CursorReference]
[Desc("Cursor to display when able to (un)deploy the actor.")]
public readonly string DeployCursor = "deploy";
@@ -97,6 +103,7 @@ namespace OpenRA.Mods.Common.Traits
Facing = Info.Facing,
Sounds = Info.TransformSounds,
Notification = Info.TransformNotification,
TextNotification = Info.TransformTextNotification,
Faction = faction
};
}
@@ -136,6 +143,7 @@ namespace OpenRA.Mods.Common.Traits
Game.Sound.PlayToPlayer(SoundType.World, self.Owner, s);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.NoTransformNotification, self.Owner.Faction.InternalName);
TextNotificationsManager.AddTransientLine(Info.NoTransformTextNotification, self.Owner);
return;
}