Resets chat text field in lobby when Esc is pressed.
This commit is contained in:
@@ -523,9 +523,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
chatLabel = lobby.Get<LabelWidget>("LABEL_CHATTYPE");
|
chatLabel = lobby.Get<LabelWidget>("LABEL_CHATTYPE");
|
||||||
var chatTextField = lobby.Get<TextFieldWidget>("CHAT_TEXTFIELD");
|
var chatTextField = lobby.Get<TextFieldWidget>("CHAT_TEXTFIELD");
|
||||||
|
|
||||||
chatTextField.TakeKeyboardFocus();
|
chatTextField.TakeKeyboardFocus();
|
||||||
|
|
||||||
chatTextField.OnEnterKey = () =>
|
chatTextField.OnEnterKey = () =>
|
||||||
{
|
{
|
||||||
if (chatTextField.Text.Length == 0)
|
if (chatTextField.Text.Length == 0)
|
||||||
@@ -538,6 +536,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
chatTextField.Text = "";
|
chatTextField.Text = "";
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
chatTextField.OnTabKey = () =>
|
chatTextField.OnTabKey = () =>
|
||||||
{
|
{
|
||||||
var previousText = chatTextField.Text;
|
var previousText = chatTextField.Text;
|
||||||
@@ -550,6 +549,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
chatTextField.OnEscKey = () => { chatTextField.Text = ""; return true; };
|
||||||
|
|
||||||
chatPanel = lobby.Get<ScrollPanelWidget>("CHAT_DISPLAY");
|
chatPanel = lobby.Get<ScrollPanelWidget>("CHAT_DISPLAY");
|
||||||
chatTemplate = chatPanel.Get("CHAT_TEMPLATE");
|
chatTemplate = chatPanel.Get("CHAT_TEMPLATE");
|
||||||
chatPanel.RemoveChildren();
|
chatPanel.RemoveChildren();
|
||||||
|
|||||||
Reference in New Issue
Block a user