mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-05 19:14:14 -04:00
escape menu hotkeys
This commit is contained in:
parent
22ef2c3a85
commit
caa4b2fc11
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user