Merge pull request #5307 from pavlos256/lobby-chat-scroll

Fixes #3036
This commit is contained in:
Paul Chote
2014-05-14 23:34:56 +12:00

View File

@@ -460,6 +460,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (chatTextField.Text.Length == 0)
return true;
// Always scroll to bottom when we've typed something
chatPanel.ScrollToBottom();
orderManager.IssueOrder(Order.Chat(teamChat, chatTextField.Text));
chatTextField.Text = "";
return true;
@@ -534,8 +537,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
template.Bounds.Height += dh;
}
var scrolledToBottom = chatPanel.ScrolledToBottom;
chatPanel.AddChild(template);
if (scrolledToBottom)
chatPanel.ScrollToBottom();
Sound.PlayNotification(null, "Sounds", "ChatLine", null);
}