Resets chat text field in lobby when Esc is pressed.

This commit is contained in:
deniz1a
2015-07-24 23:21:37 +03:00
parent 7337afcfeb
commit f5b4befc75

View File

@@ -523,9 +523,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
chatLabel = lobby.Get<LabelWidget>("LABEL_CHATTYPE");
var chatTextField = lobby.Get<TextFieldWidget>("CHAT_TEXTFIELD");
chatTextField.TakeKeyboardFocus();
chatTextField.OnEnterKey = () =>
{
if (chatTextField.Text.Length == 0)
@@ -538,6 +536,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
chatTextField.Text = "";
return true;
};
chatTextField.OnTabKey = () =>
{
var previousText = chatTextField.Text;
@@ -550,6 +549,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
return true;
};
chatTextField.OnEscKey = () => { chatTextField.Text = ""; return true; };
chatPanel = lobby.Get<ScrollPanelWidget>("CHAT_DISPLAY");
chatTemplate = chatPanel.Get("CHAT_TEMPLATE");
chatPanel.RemoveChildren();