Trigger a button sound when saving a game with enter
This commit is contained in:
committed by
Matthias Mailänder
parent
f99db8d754
commit
54547a11d0
@@ -117,17 +117,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
saveButton.IsVisible = () => true;
|
saveButton.IsVisible = () => true;
|
||||||
|
|
||||||
var saveWidgets = panel.Get("SAVE_WIDGETS");
|
var saveWidgets = panel.Get("SAVE_WIDGETS");
|
||||||
saveTextField = saveWidgets.Get<TextFieldWidget>("SAVE_TEXTFIELD");
|
|
||||||
gameList.Bounds.Height -= saveWidgets.Bounds.Height;
|
gameList.Bounds.Height -= saveWidgets.Bounds.Height;
|
||||||
saveWidgets.IsVisible = () => true;
|
saveWidgets.IsVisible = () => true;
|
||||||
|
|
||||||
saveTextField.OnEnterKey = _ =>
|
saveTextField = saveWidgets.Get<TextFieldWidget>("SAVE_TEXTFIELD");
|
||||||
{
|
saveTextField.OnEnterKey = input => saveButton.HandleKeyPress(input);
|
||||||
if (!string.IsNullOrWhiteSpace(saveTextField.Text))
|
|
||||||
Save(world);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user