mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-04 07:37:48 -05:00
escape menu hotkeys
This commit is contained in:
parent
22ef2c3a85
commit
60a3e66c95
@ -398,25 +398,15 @@ func (m *EscapeMenu) OnLoad() {
|
|||||||
|
|
||||||
// OnEscKey is called when the escape key is pressed
|
// OnEscKey is called when the escape key is pressed
|
||||||
func (m *EscapeMenu) OnEscKey() {
|
func (m *EscapeMenu) OnEscKey() {
|
||||||
// note: original D2 returns straight to the game from however deep in the menu we are
|
if m.currentLayout == configureControlsLayoutID {
|
||||||
switch m.currentLayout {
|
|
||||||
case optionsLayoutID:
|
|
||||||
m.setLayout(mainLayoutID)
|
|
||||||
return
|
|
||||||
case soundOptionsLayoutID,
|
|
||||||
videoOptionsLayoutID,
|
|
||||||
automapOptionsLayoutID,
|
|
||||||
configureControlsLayoutID:
|
|
||||||
m.setLayout(optionsLayoutID)
|
m.setLayout(optionsLayoutID)
|
||||||
|
|
||||||
if err := m.keyBindingMenu.Close(); err != nil {
|
if err := m.keyBindingMenu.Close(); err != nil {
|
||||||
m.Errorf("unable to close the configure controls menu: %v", err.Error())
|
m.Errorf("unable to close the configure controls menu: %v", err.Error())
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
return
|
m.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
m.close()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetOnCloseCb sets the callback that is run when close() is called
|
// SetOnCloseCb sets the callback that is run when close() is called
|
||||||
|
Loading…
Reference in New Issue
Block a user