Move Text handling to its own class

This commit is contained in:
teinarss
2021-06-03 19:33:32 +02:00
committed by reaperrr
parent 2a26ddc622
commit 82115c6bf7
25 changed files with 97 additions and 74 deletions

View File

@@ -99,7 +99,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
Game.AddSystemLine(player.PlayerName + " is defeated.");
TextNotificationsManager.AddSystemLine(player.PlayerName + " is defeated.");
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
Game.AddSystemLine(player.PlayerName + " is victorious.");
TextNotificationsManager.AddSystemLine(player.PlayerName + " is victorious.");
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)

View File

@@ -273,7 +273,7 @@ namespace OpenRA.Mods.Common.Traits
return;
}
Game.Debug("Cheat used: {0} by {1}{2}", order.OrderString, self.Owner.PlayerName, debugSuffix);
TextNotificationsManager.Debug("Cheat used: {0} by {1}{2}", order.OrderString, self.Owner.PlayerName, debugSuffix);
}
bool IUnlocksRenderPlayer.RenderPlayerUnlocked => Enabled;

View File

@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
Game.AddSystemLine(player.PlayerName + " is defeated.");
TextNotificationsManager.AddSystemLine(player.PlayerName + " is defeated.");
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
@@ -150,7 +150,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
Game.AddSystemLine(player.PlayerName + " is victorious.");
TextNotificationsManager.AddSystemLine(player.PlayerName + " is victorious.");
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)

View File

@@ -158,7 +158,7 @@ namespace OpenRA.Mods.Common.Traits
{
if (ticksRemaining == m * 60 * ticksPerSecond)
{
Game.AddSystemLine(Notification.F(m, m > 1 ? "s" : null));
TextNotificationsManager.AddSystemLine(Notification.F(m, m > 1 ? "s" : null));
var faction = self.World.LocalPlayer == null ? null : self.World.LocalPlayer.Faction.InternalName;
Game.Sound.PlayNotification(self.World.Map.Rules, self.World.LocalPlayer, "Speech", info.TimeLimitWarnings[m], faction);
@@ -172,7 +172,7 @@ namespace OpenRA.Mods.Common.Traits
countdownLabel.GetText = () => null;
if (!info.SkipTimerExpiredNotification)
Game.AddSystemLine("Time limit has expired.");
TextNotificationsManager.AddSystemLine("Time limit has expired.");
}
}
}