1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-02 09:17:19 -04:00

escape menu hotkeys

This commit is contained in:
M. Sz 2020-12-14 19:01:27 +01:00
parent 22ef2c3a85
commit caa4b2fc11

View File

@ -398,26 +398,16 @@ 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()
}
}
// SetOnCloseCb sets the callback that is run when close() is called
func (m *EscapeMenu) SetOnCloseCb(cb func()) {