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

@@ -82,6 +82,9 @@ namespace OpenRA.Mods.D2k.Activities
foreach (var player in affectedPlayers)
self.World.AddFrameEndTask(w => w.Add(new MapNotificationEffect(player, "Speech", swallow.Info.WormAttackNotification, 25, true, attackPosition, Color.Red)));
if (affectedPlayers.Contains(self.World.LocalPlayer))
TextNotificationsManager.AddTransientLine(swallow.Info.WormAttackTextNotification, self.World.LocalPlayer);
var barrel = armament.CheckFire(self, facing, target);
if (barrel == null)
return false;

View File

@@ -38,6 +38,8 @@ namespace OpenRA.Mods.D2k.Traits
[NotificationReference("Speech")]
public readonly string WormAttackNotification = "WormAttack";
public readonly string WormAttackTextNotification = "Worm attack.";
public override object Create(ActorInitializer init) { return new AttackSwallow(init.Self, this); }
}