diff --git a/d2game/d2player/escape_menu.go b/d2game/d2player/escape_menu.go index 2609da1f..0625add1 100644 --- a/d2game/d2player/escape_menu.go +++ b/d2game/d2player/escape_menu.go @@ -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