Only in ./scummvmdiff/backends/PalmOS: Obj
Only in ./scummvmdiff/backends/gp32: h
Only in ./scummvmdiff/backends: mac
diff -rub ./scummvm/common/gameDetector.cpp ./scummvmdiff/common/gameDetector.cpp
old
|
new
|
|
192 | 192 | _save_slot = 0; |
193 | 193 | |
194 | 194 | _saveconfig = false; |
| 195 | _confirmExit = false; |
195 | 196 | |
196 | 197 | #ifndef _WIN32_WCE |
197 | 198 | _gfx_mode = GFX_DOUBLESIZE; |
… |
… |
|
300 | 301 | _gameTempo = strtol(val, NULL, 0); |
301 | 302 | |
302 | 303 | _talkSpeed = g_config->getInt("talkspeed", _talkSpeed); |
| 304 | |
| 305 | _confirmExit = g_config->getBool("confirmExit", _confirmExit ? true : false); |
303 | 306 | |
304 | 307 | _multi_midi = g_config->getBool ("multi_midi", _multi_midi); |
305 | 308 | _native_mt32 = g_config->getBool ("native_mt32", _native_mt32); |
diff -rub ./scummvm/common/gameDetector.h ./scummvmdiff/common/gameDetector.h
old
|
new
|
|
148 | 148 | int _save_slot; |
149 | 149 | |
150 | 150 | bool _saveconfig; |
| 151 | bool _confirmExit; |
151 | 152 | |
152 | 153 | public: |
153 | 154 | OSystem *createSystem(); |
diff -rub ./scummvm/scumm/dialogs.cpp ./scummvmdiff/scumm/dialogs.cpp
old
|
new
|
|
695 | 695 | : InfoDialog(gui, scumm, 10) { |
696 | 696 | } |
697 | 697 | |
| 698 | ConfirmExitDialog::ConfirmExitDialog(NewGui *gui, Scumm *scumm) |
| 699 | : InfoDialog(gui, scumm, "Are you sure you want to quit (y/n)?") { |
| 700 | } |
| 701 | |
698 | 702 | #ifdef _WIN32_WCE |
699 | 703 | |
700 | 704 | #pragma mark - |
diff -rub ./scummvm/scumm/dialogs.h ./scummvmdiff/scumm/dialogs.h
old
|
new
|
|
171 | 171 | } |
172 | 172 | }; |
173 | 173 | |
| 174 | class ConfirmExitDialog : public InfoDialog { |
| 175 | public: |
| 176 | ConfirmExitDialog(NewGui *gui, Scumm *scumm); |
| 177 | virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers) { |
| 178 | if (tolower(ascii) == 'n') { // Close exit dialog if n key is pressed |
| 179 | setResult(ascii); |
| 180 | close(); |
| 181 | } |
| 182 | if (tolower(ascii) == 'y') { // Quit engine if y key is pressed |
| 183 | setResult(ascii); |
| 184 | close(); |
| 185 | } |
| 186 | else |
| 187 | ScummDialog::handleKeyDown(ascii, keycode, modifiers); |
| 188 | } |
| 189 | }; |
| 190 | |
174 | 191 | #ifdef _WIN32_WCE |
175 | 192 | |
176 | 193 | class KeysDialog : public ScummDialog { |
diff -rub ./scummvm/scumm/scumm.h ./scummvmdiff/scumm/scumm.h
old
|
new
|
|
390 | 390 | Dialog *_pauseDialog; |
391 | 391 | Dialog *_optionsDialog; |
392 | 392 | Dialog *_saveLoadDialog; |
| 393 | Dialog *_confirmExitDialog; |
393 | 394 | // Debugger access this one, too... |
394 | 395 | ConsoleDialog *_debuggerDialog; |
395 | 396 | |
… |
… |
|
397 | 398 | void pauseDialog(); |
398 | 399 | void saveloadDialog(); |
399 | 400 | void optionsDialog(); |
| 401 | void confirmexitDialog(); |
400 | 402 | char displayError(bool showCancel, const char *message, ...); |
401 | 403 | |
402 | 404 | protected: |
… |
… |
|
1059 | 1061 | |
1060 | 1062 | public: |
1061 | 1063 | bool _noSubtitles; // Whether to skip all subtitles |
| 1064 | bool _confirmExit; |
1062 | 1065 | protected: |
1063 | 1066 | |
1064 | 1067 | void initCharset(int charset); |
diff -rub ./scummvm/scumm/scummvm.cpp ./scummvmdiff/scumm/scummvm.cpp
old
|
new
|
|
232 | 232 | _pauseDialog = NULL; |
233 | 233 | _optionsDialog = NULL; |
234 | 234 | _saveLoadDialog = NULL; |
| 235 | _confirmExitDialog = NULL; |
235 | 236 | _debuggerDialog = NULL; |
236 | 237 | _fastMode = 0; |
237 | 238 | memset(&_rnd, 0, sizeof(RandomSource)); |
… |
… |
|
394 | 395 | _charsetBufPos = 0; |
395 | 396 | memset(_charsetBuffer, 0, sizeof(_charsetBuffer)); |
396 | 397 | _noSubtitles = false; |
| 398 | _confirmExit = false; |
397 | 399 | _numInMsgStack = 0; |
398 | 400 | _msgPtrToAdd = NULL; |
399 | 401 | _messagePtr = NULL; |
… |
… |
|
545 | 547 | setFeatures(detector->_game.features); |
546 | 548 | |
547 | 549 | _noSubtitles = detector->_noSubtitles; |
| 550 | _confirmExit = detector->_confirmExit; |
548 | 551 | _defaultTalkDelay = detector->_talkSpeed; |
549 | 552 | _use_adlib = detector->_use_adlib; |
550 | 553 | _language = detector->_language; |
… |
… |
|
709 | 712 | delete _pauseDialog; |
710 | 713 | delete _optionsDialog; |
711 | 714 | delete _saveLoadDialog; |
| 715 | delete _confirmExitDialog; |
712 | 716 | |
713 | 717 | delete _sound; |
714 | 718 | delete _imuse; |
… |
… |
|
1461 | 1465 | break; |
1462 | 1466 | |
1463 | 1467 | case OSystem::EVENT_QUIT: |
| 1468 | if(_confirmExit) |
| 1469 | confirmexitDialog(); |
| 1470 | else |
1464 | 1471 | _quit = true; |
1465 | 1472 | break; |
1466 | 1473 | |
… |
… |
|
2295 | 2302 | if (!_optionsDialog) |
2296 | 2303 | _optionsDialog = new OptionsDialog(_newgui, this); |
2297 | 2304 | runDialog(_optionsDialog); |
| 2305 | } |
| 2306 | |
| 2307 | void Scumm::confirmexitDialog() { |
| 2308 | if (!_confirmExitDialog) |
| 2309 | _confirmExitDialog = new ConfirmExitDialog(_newgui, this); |
| 2310 | |
| 2311 | if (tolower(runDialog(_confirmExitDialog)) == 'y') { |
| 2312 | _quit = true; |
| 2313 | } |
2298 | 2314 | } |
2299 | 2315 | |
2300 | 2316 | char Scumm::displayError(bool showCancel, const char *message, ...) { |