Exit game save with escape
This commit is contained in:
committed by
Matthias Mailänder
parent
3c7addcb80
commit
47b6542b1d
@@ -83,7 +83,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
this.isSavePanel = isSavePanel;
|
this.isSavePanel = isSavePanel;
|
||||||
Game.BeforeGameStart += OnGameStart;
|
Game.BeforeGameStart += OnGameStart;
|
||||||
|
|
||||||
panel.Get<ButtonWidget>("CANCEL_BUTTON").OnClick = () =>
|
var cancelButton = panel.Get<ButtonWidget>("CANCEL_BUTTON");
|
||||||
|
cancelButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
Ui.CloseWindow();
|
Ui.CloseWindow();
|
||||||
onExit();
|
onExit();
|
||||||
@@ -122,6 +123,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
saveTextField = saveWidgets.Get<TextFieldWidget>("SAVE_TEXTFIELD");
|
saveTextField = saveWidgets.Get<TextFieldWidget>("SAVE_TEXTFIELD");
|
||||||
saveTextField.OnEnterKey = input => saveButton.HandleKeyPress(input);
|
saveTextField.OnEnterKey = input => saveButton.HandleKeyPress(input);
|
||||||
|
saveTextField.OnEscKey = input => cancelButton.HandleKeyPress(input);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user