diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 68bc7c5478..d7a634379c 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -474,11 +474,6 @@ namespace OpenRA JoinLocal(); - ChromeMetrics.TryGet("ChatMessageColor", out chatMessageColor); - ChromeMetrics.TryGet("SystemMessageColor", out systemMessageColor); - if (!ChromeMetrics.TryGet("SystemMessageLabel", out systemMessageLabel)) - systemMessageLabel = "Battlefield Control"; - ModData.LoadScreen.StartGame(args); } @@ -559,9 +554,6 @@ namespace OpenRA // Note: These delayed actions should only be used by widgets or disposing objects // - things that depend on a particular world should be queuing them on the world actor. static volatile ActionQueue delayedActions = new ActionQueue(); - static Color systemMessageColor = Color.White; - static Color chatMessageColor = Color.White; - static string systemMessageLabel; public static void RunAfterTick(Action a) { delayedActions.Add(a, RunTime); } public static void RunAfterDelay(int delayMilliseconds, Action a) { delayedActions.Add(a, RunTime + delayMilliseconds); } @@ -579,7 +571,7 @@ namespace OpenRA Log.Write("debug", "Taking screenshot " + path); Renderer.SaveScreenshot(path); - Debug("Saved screenshot " + filename); + TextNotificationsManager.Debug("Saved screenshot " + filename); } } @@ -911,26 +903,6 @@ namespace OpenRA state = RunStatus.Success; } - public static void AddSystemLine(string text) - { - AddSystemLine(systemMessageLabel, text); - } - - public static void AddSystemLine(string name, string text) - { - OrderManager.AddChatLine(name, systemMessageColor, text, systemMessageColor); - } - - public static void AddChatLine(string name, Color nameColor, string text) - { - OrderManager.AddChatLine(name, nameColor, text, chatMessageColor); - } - - public static void Debug(string s, params object[] args) - { - AddSystemLine("Debug", string.Format(s, args)); - } - public static void Disconnect() { OrderManager.World?.TraitDict.PrintReport(); diff --git a/OpenRA.Game/Network/Order.cs b/OpenRA.Game/Network/Order.cs index b9627223d7..f3000ffc6f 100644 --- a/OpenRA.Game/Network/Order.cs +++ b/OpenRA.Game/Network/Order.cs @@ -212,8 +212,8 @@ namespace OpenRA Log.Write("debug", e.ToString()); // HACK: this can hopefully go away in the future - Game.Debug("Ignoring malformed order that would have crashed the game"); - Game.Debug("Please file a bug report and include the replay from this match"); + TextNotificationsManager.Debug("Ignoring malformed order that would have crashed the game"); + TextNotificationsManager.Debug("Please file a bug report and include the replay from this match"); return null; } diff --git a/OpenRA.Game/Network/UnitOrders.cs b/OpenRA.Game/Network/UnitOrders.cs index 6345721f43..93e1fa4b6f 100644 --- a/OpenRA.Game/Network/UnitOrders.cs +++ b/OpenRA.Game/Network/UnitOrders.cs @@ -31,7 +31,7 @@ namespace OpenRA.Network { // Server message case "Message": - Game.AddSystemLine(order.TargetString); + TextNotificationsManager.AddSystemLine(order.TargetString); break; // Reports that the target player disconnected @@ -70,7 +70,7 @@ namespace OpenRA.Network if (orderManager.LocalClient != null && client != orderManager.LocalClient && client.Team > 0 && client.Team == orderManager.LocalClient.Team) suffix += " (Ally)"; - Game.AddChatLine(client.Name + suffix, client.Color, message); + TextNotificationsManager.AddChatLine(client.Name + suffix, client.Color, message); break; } @@ -79,7 +79,7 @@ namespace OpenRA.Network { var prefix = order.ExtraData == uint.MaxValue ? "[Spectators] " : "[Team] "; if (orderManager.LocalClient != null && client.Team == orderManager.LocalClient.Team) - Game.AddChatLine(prefix + client.Name, client.Color, message); + TextNotificationsManager.AddChatLine(prefix + client.Name, client.Color, message); break; } @@ -93,7 +93,7 @@ namespace OpenRA.Network { // Validate before adding the line if (client.IsObserver || (player != null && player.WinState != WinState.Undefined)) - Game.AddChatLine("[Spectators] " + client.Name, client.Color, message); + TextNotificationsManager.AddChatLine("[Spectators] " + client.Name, client.Color, message); break; } @@ -103,7 +103,7 @@ namespace OpenRA.Network && world.LocalPlayer != null && world.LocalPlayer.WinState == WinState.Undefined; if (valid && (isSameTeam || world.IsReplay)) - Game.AddChatLine("[Team" + (world.IsReplay ? " " + order.ExtraData : "") + "] " + client.Name, client.Color, message); + TextNotificationsManager.AddChatLine("[Team" + (world.IsReplay ? " " + order.ExtraData : "") + "] " + client.Name, client.Color, message); break; } @@ -133,7 +133,7 @@ namespace OpenRA.Network FieldLoader.GetValue("SaveSyncFrame", saveSyncFrame.Value.Value); } else - Game.AddSystemLine("The game has started."); + TextNotificationsManager.AddSystemLine("The game has started."); Game.StartGame(orderManager.LobbyInfo.GlobalSettings.Map, WorldType.Regular); break; @@ -151,7 +151,7 @@ namespace OpenRA.Network case "GameSaved": if (!orderManager.World.IsReplay) - Game.AddSystemLine("Game saved"); + TextNotificationsManager.AddSystemLine("Game saved"); foreach (var nsr in orderManager.World.WorldActor.TraitsImplementing()) nsr.GameSaved(orderManager.World); @@ -171,7 +171,7 @@ namespace OpenRA.Network if (orderManager.World.Paused != pause && world != null && world.LobbyInfo.NonBotClients.Count() > 1) { var pausetext = $"The game is {(pause ? "paused" : "un-paused")} by {client.Name}"; - Game.AddSystemLine(pausetext); + TextNotificationsManager.AddSystemLine(pausetext); } orderManager.World.Paused = pause; diff --git a/OpenRA.Game/Orders/UnitOrderGenerator.cs b/OpenRA.Game/Orders/UnitOrderGenerator.cs index 0870b10868..85269e08f2 100644 --- a/OpenRA.Game/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Game/Orders/UnitOrderGenerator.cs @@ -188,9 +188,9 @@ namespace OpenRA.Orders static Order CheckSameOrder(IOrderTargeter iot, Order order) { if (order == null && iot.OrderID != null) - Game.Debug("BUG: in order targeter - decided on {0} but then didn't order", iot.OrderID); + TextNotificationsManager.Debug("BUG: in order targeter - decided on {0} but then didn't order", iot.OrderID); else if (order != null && iot.OrderID != order.OrderString) - Game.Debug("BUG: in order targeter - decided on {0} but ordered {1}", iot.OrderID, order.OrderString); + TextNotificationsManager.Debug("BUG: in order targeter - decided on {0} but ordered {1}", iot.OrderID, order.OrderString); return order; } diff --git a/OpenRA.Game/TextNotificationsManager.cs b/OpenRA.Game/TextNotificationsManager.cs new file mode 100644 index 0000000000..9dc564e81b --- /dev/null +++ b/OpenRA.Game/TextNotificationsManager.cs @@ -0,0 +1,51 @@ +#region Copyright & License Information +/* + * Copyright 2007-2021 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using OpenRA.Primitives; +using OpenRA.Widgets; + +namespace OpenRA +{ + public static class TextNotificationsManager + { + static Color systemMessageColor = Color.White; + static Color chatMessageColor = Color.White; + static string systemMessageLabel; + + static TextNotificationsManager() + { + ChromeMetrics.TryGet("ChatMessageColor", out chatMessageColor); + ChromeMetrics.TryGet("SystemMessageColor", out systemMessageColor); + if (!ChromeMetrics.TryGet("SystemMessageLabel", out systemMessageLabel)) + systemMessageLabel = "Battlefield Control"; + } + + public static void AddSystemLine(string text) + { + AddSystemLine(systemMessageLabel, text); + } + + public static void AddSystemLine(string name, string text) + { + Game.OrderManager.AddChatLine(name, systemMessageColor, text, systemMessageColor); + } + + public static void AddChatLine(string name, Color nameColor, string text) + { + Game.OrderManager.AddChatLine(name, nameColor, text, chatMessageColor); + } + + public static void Debug(string s, params object[] args) + { + AddSystemLine("Debug", string.Format(s, args)); + } + } +} diff --git a/OpenRA.Game/WAngle.cs b/OpenRA.Game/WAngle.cs index f96f62c1e2..3a08f371eb 100644 --- a/OpenRA.Game/WAngle.cs +++ b/OpenRA.Game/WAngle.cs @@ -226,7 +226,7 @@ namespace OpenRA if (right.TryGetClrValue(out int c)) { - Game.Debug("Support for facing calculations mixing Angle with integers is deprecated. Make sure all facing calculations use Angle"); + TextNotificationsManager.Debug("Support for facing calculations mixing Angle with integers is deprecated. Make sure all facing calculations use Angle"); return new LuaCustomClrObject(a + FromFacing(c)); } @@ -243,7 +243,7 @@ namespace OpenRA if (right.TryGetClrValue(out int c)) { - Game.Debug("Support for facing calculations mixing Angle with integers is deprecated. Make sure all facing calculations use Angle"); + TextNotificationsManager.Debug("Support for facing calculations mixing Angle with integers is deprecated. Make sure all facing calculations use Angle"); return new LuaCustomClrObject(a - FromFacing(c)); } diff --git a/OpenRA.Game/WDist.cs b/OpenRA.Game/WDist.cs index 8f6ee8ae89..8e20f1be4e 100644 --- a/OpenRA.Game/WDist.cs +++ b/OpenRA.Game/WDist.cs @@ -143,7 +143,7 @@ namespace OpenRA switch (key.ToString()) { case "Length": return Length; - case "Range": Game.Debug("WDist.Range is deprecated. Use WDist.Length instead"); return Length; + case "Range": TextNotificationsManager.Debug("WDist.Range is deprecated. Use WDist.Length instead"); return Length; default: throw new LuaException($"WDist does not define a member '{key}'"); } } diff --git a/OpenRA.Mods.Common/AIUtils.cs b/OpenRA.Mods.Common/AIUtils.cs index ac1976c3df..f8cd440f64 100644 --- a/OpenRA.Mods.Common/AIUtils.cs +++ b/OpenRA.Mods.Common/AIUtils.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common public static void BotDebug(string s, params object[] args) { if (Game.Settings.Debug.BotDebug) - Game.Debug(s, args); + TextNotificationsManager.Debug(s, args); } } } diff --git a/OpenRA.Mods.Common/Commands/ChatCommands.cs b/OpenRA.Mods.Common/Commands/ChatCommands.cs index f5757c635e..40efc186a4 100644 --- a/OpenRA.Mods.Common/Commands/ChatCommands.cs +++ b/OpenRA.Mods.Common/Commands/ChatCommands.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Commands if (command.Value != null) command.Value.InvokeCommand(name.ToLowerInvariant(), message.Substring(1 + name.Length).Trim()); else - Game.Debug("{0} is not a valid command.", name); + TextNotificationsManager.Debug("{0} is not a valid command.", name); return false; } diff --git a/OpenRA.Mods.Common/Commands/DevCommands.cs b/OpenRA.Mods.Common/Commands/DevCommands.cs index a3225ad3e0..d3c771be0a 100644 --- a/OpenRA.Mods.Common/Commands/DevCommands.cs +++ b/OpenRA.Mods.Common/Commands/DevCommands.cs @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Commands if (!developerMode.Enabled) { - Game.Debug("Cheats are disabled."); + TextNotificationsManager.Debug("Cheats are disabled."); return; } diff --git a/OpenRA.Mods.Common/Commands/HelpCommand.cs b/OpenRA.Mods.Common/Commands/HelpCommand.cs index c3c7ef635d..1977744402 100644 --- a/OpenRA.Mods.Common/Commands/HelpCommand.cs +++ b/OpenRA.Mods.Common/Commands/HelpCommand.cs @@ -42,14 +42,14 @@ namespace OpenRA.Mods.Common.Commands public void InvokeCommand(string name, string arg) { - Game.Debug("Here are the available commands:"); + TextNotificationsManager.Debug("Here are the available commands:"); foreach (var key in console.Commands.Keys) { if (!helpDescriptions.TryGetValue(key, out var description)) description = "no description available."; - Game.Debug("{0}: {1}", key, description); + TextNotificationsManager.Debug("{0}: {1}", key, description); } } diff --git a/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs index 3862504f24..4da0c6803a 100644 --- a/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Scripting if (value.TryGetClrValue(out int facing)) { facingInit.Initialize(WAngle.FromFacing(facing)); - Game.Debug("Initializing Facing with integers is deprecated. Use Angle instead."); + TextNotificationsManager.Debug("Initializing Facing with integers is deprecated. Use Angle instead."); return facingInit; } } diff --git a/OpenRA.Mods.Common/Scripting/Global/FacingGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/FacingGlobal.cs index 25aabfe23d..5dc6fedfbc 100644 --- a/OpenRA.Mods.Common/Scripting/Global/FacingGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/FacingGlobal.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Scripting.Global void Deprecated() { - Game.Debug("The Facing table is deprecated. Use Angle instead."); + TextNotificationsManager.Debug("The Facing table is deprecated. Use Angle instead."); } public int North { get { Deprecated(); return 0; } } diff --git a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs index 76f1498760..d86669d3e4 100644 --- a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs @@ -194,7 +194,7 @@ namespace OpenRA.Mods.Common.Scripting return; var c = color.HasValue ? color.Value : Color.White; - Game.AddChatLine(prefix, c, text); + TextNotificationsManager.AddChatLine(prefix, c, text); } [Desc("Display a system message to the player. If 'prefix' is nil the default system prefix is used.")] @@ -204,9 +204,9 @@ namespace OpenRA.Mods.Common.Scripting return; if (string.IsNullOrEmpty(prefix)) - Game.AddSystemLine(text); + TextNotificationsManager.AddSystemLine(text); else - Game.AddSystemLine(prefix, text); + TextNotificationsManager.AddSystemLine(prefix, text); } [Desc("Displays a debug message to the player, if \"Show Map Debug Messages\" is checked in the settings.")] @@ -215,7 +215,7 @@ namespace OpenRA.Mods.Common.Scripting if (string.IsNullOrEmpty(text) || !Game.Settings.Debug.LuaDebug) return; - Game.Debug(text); + TextNotificationsManager.Debug(text); } [Desc("Display a text message at the specified location.")] diff --git a/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs index edb977ae69..5812e35c5a 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs @@ -36,14 +36,14 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Activate the actor's Airstrike Power. DEPRECATED! Will be removed.")] public void SendAirstrike(WPos target, bool randomize = true, int facing = 0) { - Game.Debug("SendAirstrike is deprecated. Use TargetAirstrike instead."); + TextNotificationsManager.Debug("SendAirstrike is deprecated. Use TargetAirstrike instead."); ap.SendAirstrike(Self, target, randomize ? (WAngle?)null : WAngle.FromFacing(facing)); } [Desc("Activate the actor's Airstrike Power. DEPRECATED! Will be removed.")] public void SendAirstrikeFrom(CPos from, CPos to) { - Game.Debug("SendAirstrikeFrom is deprecated. Use TargetAirstrike instead."); + TextNotificationsManager.Debug("SendAirstrikeFrom is deprecated. Use TargetAirstrike instead."); var i = Self.World.Map.CenterOfCell(from); var j = Self.World.Map.CenterOfCell(to); diff --git a/OpenRA.Mods.Common/Scripting/Properties/ParatroopersProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/ParatroopersProperties.cs index ace63ba0fa..ff6074c8bb 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/ParatroopersProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/ParatroopersProperties.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Activate the actor's Paratroopers Power. Returns the aircraft that will drop the reinforcements. DEPRECATED! Will be removed.")] public Actor[] ActivateParatroopers(WPos target, int facing = -1) { - Game.Debug("SendParatroopersFrom is deprecated. Use TargetParatroopers instead."); + TextNotificationsManager.Debug("SendParatroopersFrom is deprecated. Use TargetParatroopers instead."); var actors = pp.SendParatroopers(Self, target, facing == -1 ? (WAngle?)null : WAngle.FromFacing(facing)); return actors.Aircraft; } diff --git a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs index 6411412ba7..be9c133f73 100644 --- a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs @@ -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) diff --git a/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs b/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs index f7777e88f8..c7302e09b2 100644 --- a/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs +++ b/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs @@ -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; diff --git a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs index 5db6cacea4..539bf7d8f0 100644 --- a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs @@ -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) diff --git a/OpenRA.Mods.Common/Traits/Player/TimeLimitManager.cs b/OpenRA.Mods.Common/Traits/Player/TimeLimitManager.cs index c3b09e87ee..6a1cbc0594 100644 --- a/OpenRA.Mods.Common/Traits/Player/TimeLimitManager.cs +++ b/OpenRA.Mods.Common/Traits/Player/TimeLimitManager.cs @@ -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."); } } } diff --git a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs index c54f08b6fc..f091c30eca 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs @@ -252,7 +252,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic } catch (Exception ex) { - Game.Debug("Failed to delete save file '{0}'. See the logs for details.", savePath); + TextNotificationsManager.Debug("Failed to delete save file '{0}'. See the logs for details.", savePath); Log.Write("debug", ex.ToString()); return; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs index 29aeba1099..707f15dbbf 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs @@ -320,7 +320,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic } catch (Exception ex) { - Game.Debug("Failed to delete map '{0}'. See the debug.log file for details.", map); + TextNotificationsManager.Debug("Failed to delete map '{0}'. See the debug.log file for details.", map); Log.Write("debug", ex.ToString()); } diff --git a/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs index 533b78b9f5..0af36a1f1c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs @@ -29,12 +29,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (Game.Settings.Sound.Mute) { Game.Sound.MuteAudio(); - Game.AddSystemLine("Audio muted"); + TextNotificationsManager.AddSystemLine("Audio muted"); } else { Game.Sound.UnmuteAudio(); - Game.AddSystemLine("Audio unmuted"); + TextNotificationsManager.AddSystemLine("Audio unmuted"); } return true; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index 6a194c4557..ddaa0a1e8e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -499,7 +499,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic } catch (Exception ex) { - Game.Debug("Failed to delete replay file '{0}'. See the logs for details.", replay.FilePath); + TextNotificationsManager.Debug("Failed to delete replay file '{0}'. See the logs for details.", replay.FilePath); Log.Write("debug", ex.ToString()); return; } diff --git a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs index 3c7a92c8d5..b7fb4f0433 100644 --- a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs @@ -261,12 +261,12 @@ namespace OpenRA.Mods.Common.Widgets // Check if selecting actors on the screen has selected new units if (ownUnitsOnScreen.Count > World.Selection.Actors.Count()) - Game.AddSystemLine("Selected across screen"); + TextNotificationsManager.AddSystemLine("Selected across screen"); else { // Select actors in the world that have highest selection priority ownUnitsOnScreen = SelectActorsInWorld(World, null, eligiblePlayers).SubsetWithHighestSelectionPriority(e.Modifiers).ToList(); - Game.AddSystemLine("Selected across map"); + TextNotificationsManager.AddSystemLine("Selected across map"); } World.Selection.Combine(World, ownUnitsOnScreen, false, false); @@ -293,12 +293,12 @@ namespace OpenRA.Mods.Common.Widgets // Check if selecting actors on the screen has selected new units if (newSelection.Count > World.Selection.Actors.Count()) - Game.AddSystemLine("Selected across screen"); + TextNotificationsManager.AddSystemLine("Selected across screen"); else { // Select actors in the world that have the same selection class as one of the already selected actors newSelection = SelectActorsInWorld(World, selectedClasses, eligiblePlayers).ToList(); - Game.AddSystemLine("Selected across map"); + TextNotificationsManager.AddSystemLine("Selected across map"); } World.Selection.Combine(World, newSelection, true, false);