diff --git a/OpenRA.Game/Widgets/ChatDisplayWidget.cs b/OpenRA.Game/Widgets/ChatDisplayWidget.cs index 8c8e22eba8..affee3f5ad 100644 --- a/OpenRA.Game/Widgets/ChatDisplayWidget.cs +++ b/OpenRA.Game/Widgets/ChatDisplayWidget.cs @@ -91,7 +91,7 @@ namespace OpenRA.Widgets return; // This takes advantage of the fact that recentLines is ordered by expiration, from sooner to later - while (recentLines.Count > 0 && totalTicks >= recentLines [0].Expiration) + while (recentLines.Count > 0 && totalTicks >= recentLines[0].Expiration) recentLines.RemoveAt(0); } } diff --git a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs index 3a0d3c541f..54734050bc 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs @@ -146,8 +146,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic template.Bounds.Height += dh; } + bool scrolledToBottom = chatScrollPanel.ScrolledToBottom; chatScrollPanel.AddChild(template); - chatScrollPanel.ScrollToBottom(); + if (scrolledToBottom) + chatScrollPanel.ScrollToBottom(); + Sound.PlayNotification(null, "Sounds", "ChatLine", null); } }