Add localisation support to transient lines.

This commit is contained in:
Matthias Mailänder
2023-08-19 12:57:21 +02:00
committed by Gustas
parent 43d1a20d8c
commit 1899eed839
44 changed files with 95 additions and 82 deletions

View File

@@ -166,7 +166,7 @@ namespace OpenRA.Mods.Common.Traits
{
Game.Sound.Play(SoundType.UI, Info.DetectedSound);
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.DetectedSpeechNotification, player.Faction.InternalName);
TextNotificationsManager.AddTransientLine(info.DetectedTextNotification, player);
TextNotificationsManager.AddTransientLine(player, info.DetectedTextNotification);
}
}
@@ -181,7 +181,7 @@ namespace OpenRA.Mods.Common.Traits
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.BeginChargeSpeechNotification, self.Owner.Faction.InternalName);
TextNotificationsManager.AddTransientLine(Info.BeginChargeTextNotification, self.Owner);
TextNotificationsManager.AddTransientLine(self.Owner, Info.BeginChargeTextNotification);
}
public virtual void Charged(Actor self, string key)
@@ -190,7 +190,7 @@ namespace OpenRA.Mods.Common.Traits
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.EndChargeSpeechNotification, self.Owner.Faction.InternalName);
TextNotificationsManager.AddTransientLine(Info.EndChargeTextNotification, self.Owner);
TextNotificationsManager.AddTransientLine(self.Owner, Info.EndChargeTextNotification);
foreach (var notify in self.TraitsImplementing<INotifySupportPower>())
notify.Charged(self);
@@ -228,7 +228,8 @@ namespace OpenRA.Mods.Common.Traits
var speech = isAllied ? Info.LaunchSpeechNotification : Info.IncomingSpeechNotification;
Game.Sound.PlayNotification(Self.World.Map.Rules, localPlayer, "Speech", speech, localPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(isAllied ? Info.LaunchTextNotification : Info.IncomingTextNotification, localPlayer);
var text = isAllied ? Info.LaunchTextNotification : Info.IncomingTextNotification;
TextNotificationsManager.AddTransientLine(localPlayer, text);
}
public IEnumerable<CPos> CellsMatching(CPos location, char[] footprint, CVec dimensions)