Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 4a09798

Browse files
authored
Merge pull request #245 from cortex-command-community/options-esc
Pressing escape at various main menu screens no longer quits the game.
2 parents 2d1dc63 + 3c48aaf commit 4a09798

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
256256

257257
- The "woosh" sound played when switching actors from a distance will now take scene wrapping into account. Additionally, attempting to switch to previous or next actor with only one actor will play the more correct "error" sound.
258258

259+
- Pressing escape at the options, mod manager, game editors and credits screens no longer quits the game.
260+
259261
### Removed
260262

261263
- Removed the ability to remove scripts from objects with Lua. This is no longer needed cause of code efficiency increases.

Menus/MainMenuGUI.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,28 @@ void MainMenuGUI::Update()
635635
return;
636636

637637
// If esc pressed, show quit dialog if applicable
638-
if (g_UInputMan.KeyPressed(KEY_ESC))
639-
QuitLogic();
638+
if (g_UInputMan.KeyPressed(KEY_ESC)) {
639+
if (m_MenuScreen == OPTIONSSCREEN || m_MenuScreen == MODMANAGERSCREEN || m_MenuScreen == EDITORSCREEN || m_MenuScreen == CREDITSSCREEN) {
640+
HideAllScreens();
641+
m_MainMenuButtons[BACKTOMAIN]->SetVisible(false);
642+
m_MenuScreen = MAINSCREEN;
643+
m_ScreenChange = true;
644+
g_GUISound.BackButtonPressSound()->Play();
645+
646+
if (m_MenuScreen == OPTIONSSCREEN) {
647+
g_SettingsMan.SetFlashOnBrainDamage(m_aOptionsCheckbox[FLASHONBRAINDAMAGE]->GetCheck());
648+
g_SettingsMan.SetBlipOnRevealUnseen(m_aOptionsCheckbox[BLIPONREVEALUNSEEN]->GetCheck());
649+
g_SettingsMan.SetShowForeignItems(m_aOptionsCheckbox[SHOWFOREIGNITEMS]->GetCheck());
650+
g_SettingsMan.SetShowToolTips(m_aOptionsCheckbox[SHOWTOOLTIPS]->GetCheck());
651+
g_SettingsMan.SetPreciseCollisions(m_aOptionsCheckbox[PRECISECOLLISIONS]->GetCheck());
652+
g_SettingsMan.UpdateSettingsFile();
653+
} else if (m_MenuScreen == MODMANAGERSCREEN) {
654+
g_SettingsMan.UpdateSettingsFile();
655+
}
656+
} else {
657+
QuitLogic();
658+
}
659+
}
640660

641661
////////////////////////////////////////////////////////////////////////
642662
// Animate the menu into and out of view if enabled or disabled

0 commit comments

Comments
 (0)