diff options
author | Max Horn | 2007-06-30 12:43:53 +0000 |
---|---|---|
committer | Max Horn | 2007-06-30 12:43:53 +0000 |
commit | c7fa7baf1f424d6e003473879d8d015067817fe7 (patch) | |
tree | a30e2ce1e1e249467ae8bb42df7344661c6e288a | |
parent | 45aea284d1673f56fa45d796af6da647630ccb2b (diff) | |
download | scummvm-rg350-c7fa7baf1f424d6e003473879d8d015067817fe7.tar.gz scummvm-rg350-c7fa7baf1f424d6e003473879d8d015067817fe7.tar.bz2 scummvm-rg350-c7fa7baf1f424d6e003473879d8d015067817fe7.zip |
Added global support for the (so far undocumented) confirm_exit config key
svn-id: r27788
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | backends/events/default/default-events.cpp | 12 | ||||
-rw-r--r-- | engines/scumm/input.cpp | 5 |
3 files changed, 16 insertions, 7 deletions
@@ -1575,6 +1575,8 @@ The following keywords are recognized: super2xsai, supereagle, advmame2x, advmame3x, hq2x, hq3x, tv2x, dotmatrix) + confirm_exit bool Ask for confirmation by the user before quitting + (SDL backend only). cdrom number Number of CD-ROM unit to use for audio. If negative, don't even try to access the CD-ROM. joystick_num number Number of joystick device to use for input @@ -1600,8 +1602,8 @@ The following keywords are recognized: midi_gain number The MIDI gain (0-1000) (default: 100) (Only supported by some MIDI drivers.) - copy_protection bool Enable copy protection in SCUMM games, when - ScummVM disables it by default. + copy_protection bool Enable copy protection in certain games, in those + cases where ScummVM disables it by default. demo_mode bool Start demo in Maniac Mansion alt_intro bool Use alternative intro for CD versions of Beneath a Steel Sky and Flight of the Amazon diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index ad21b09070..14f4249b42 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -26,8 +26,10 @@ #if !defined(DISABLE_DEFAULT_EVENTMANAGER) #include "common/stdafx.h" +#include "common/config-manager.h" #include "common/system.h" #include "backends/events/default/default-events.h" +#include "gui/message.h" DefaultEventManager::DefaultEventManager(OSystem *boss) : _boss(boss), @@ -93,7 +95,15 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { break; case Common::EVENT_QUIT: - _shouldQuit = true; + if (ConfMan.getBool("confirm_exit")) { + GUI::MessageDialog alert("Do you really want to quit?", "Yes", "No"); + if (alert.runModal() == GUI::kMessageOK) + _shouldQuit = true; + else + result = false; + + } else + _shouldQuit = true; break; default: diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index b6b1ec33c7..ffcb7d03f2 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -188,10 +188,7 @@ void ScummEngine::parseEvents() { break; case Common::EVENT_QUIT: - if (ConfMan.getBool("confirm_exit")) - confirmExitDialog(); - else - _quit = true; + _quit = true; break; default: |