escape menu hotkeys

This commit is contained in:
M. Sz 2020-12-14 19:01:27 +01:00
parent 22ef2c3a85
commit 60a3e66c95
1 changed files with 3 additions and 13 deletions

View File

@ -398,25 +398,15 @@ func (m *EscapeMenu) OnLoad() {
// OnEscKey is called when the escape key is pressed
func (m *EscapeMenu) OnEscKey() {
// note: original D2 returns straight to the game from however deep in the menu we are
switch m.currentLayout {
case optionsLayoutID:
m.setLayout(mainLayoutID)
return
case soundOptionsLayoutID,
videoOptionsLayoutID,
automapOptionsLayoutID,
configureControlsLayoutID:
if m.currentLayout == configureControlsLayoutID {
m.setLayout(optionsLayoutID)
if err := m.keyBindingMenu.Close(); err != nil {
m.Errorf("unable to close the configure controls menu: %v", err.Error())
}
return
} else {
m.close()
}
m.close()
}
// SetOnCloseCb sets the callback that is run when close() is called