Add support for transient text notifications matching speech notifications
This commit is contained in:
committed by
Paul Chote
parent
9f723be65a
commit
24b9482cc1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user