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

@@ -316,7 +316,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (actionManager != null)
actionManager.Modified = false;
TextNotificationsManager.AddTransientLine(TranslationProvider.GetString(SaveCurrentMap), world.LocalPlayer);
TextNotificationsManager.AddTransientLine(world.LocalPlayer, TranslationProvider.GetString(SaveCurrentMap));
}
catch (Exception e)
{

View File

@@ -217,7 +217,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var faction = world.LocalPlayer?.Faction.InternalName;
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", moi.LeaveNotification, faction);
TextNotificationsManager.AddTransientLine(moi.LeaveTextNotification, null);
TextNotificationsManager.AddTransientLine(null, moi.LeaveTextNotification);
}
}

View File

@@ -324,7 +324,7 @@ namespace OpenRA.Mods.Common.Widgets
// Resume a paused item
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.QueuedAudio, World.LocalPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.QueuedTextNotification, World.LocalPlayer);
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.QueuedTextNotification);
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, false));
return true;
@@ -341,7 +341,7 @@ namespace OpenRA.Mods.Common.Widgets
if (!CurrentQueue.AllQueued().Any())
{
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", notification, World.LocalPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(textNotification, World.LocalPlayer);
TextNotificationsManager.AddTransientLine(World.LocalPlayer, textNotification);
}
if (canQueue)
@@ -366,7 +366,7 @@ namespace OpenRA.Mods.Common.Widgets
{
// Instantly cancel items that haven't started, have finished, or if the queue doesn't support pausing
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.CancelledTextNotification, World.LocalPlayer);
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.CancelledTextNotification);
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount));
}
@@ -374,7 +374,7 @@ namespace OpenRA.Mods.Common.Widgets
{
// Pause an existing item
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.OnHoldAudio, World.LocalPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.OnHoldTextNotification, World.LocalPlayer);
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.OnHoldTextNotification);
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, true));
}
@@ -390,7 +390,7 @@ namespace OpenRA.Mods.Common.Widgets
// Directly cancel, skipping "on-hold"
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.CancelledTextNotification, World.LocalPlayer);
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.CancelledTextNotification);
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount));

View File

@@ -174,7 +174,7 @@ namespace OpenRA.Mods.Common.Widgets
Game.Sound.PlayNotification(spm.Self.World.Map.Rules, spm.Self.Owner, "Speech",
clicked.Power.Info.InsufficientPowerSpeechNotification, spm.Self.Owner.Faction.InternalName);
TextNotificationsManager.AddTransientLine(clicked.Power.Info.InsufficientPowerTextNotification, spm.Self.Owner);
TextNotificationsManager.AddTransientLine(spm.Self.Owner, clicked.Power.Info.InsufficientPowerTextNotification);
}
else
clicked.Power.Target();