diff options
author | Max Horn | 2003-07-28 01:36:16 +0000 |
---|---|---|
committer | Max Horn | 2003-07-28 01:36:16 +0000 |
commit | d592095fb942e961773e8177056d973eb1cff092 (patch) | |
tree | a5b0889b20ec589d56fc17c2c6edd3ad01150743 /scumm/dialogs.cpp | |
parent | e87bc6d89e260afd6e116c7eace991876cfa4acf (diff) | |
download | scummvm-rg350-d592095fb942e961773e8177056d973eb1cff092.tar.gz scummvm-rg350-d592095fb942e961773e8177056d973eb1cff092.tar.bz2 scummvm-rg350-d592095fb942e961773e8177056d973eb1cff092.zip |
Patch #715991: Quit Confirmation Dialog (feature request #642721) with some tweaks by me
svn-id: r9210
Diffstat (limited to 'scumm/dialogs.cpp')
-rw-r--r-- | scumm/dialogs.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index e7f6fe8d54..bdaef6383e 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -681,6 +681,21 @@ PauseDialog::PauseDialog(NewGui *gui, Scumm *scumm) : InfoDialog(gui, scumm, 10) { } +ConfirmExitDialog::ConfirmExitDialog(NewGui *gui, Scumm *scumm) + : InfoDialog(gui, scumm, "Do you really want to quit (y/n)?") { +} + +void ConfirmExitDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { + if (tolower(ascii) == 'n') { // Close exit dialog if n key is pressed + setResult(0); + close(); + } else if (tolower(ascii) == 'y') { // Quit if y key is pressed + setResult(1); + close(); + } else + ScummDialog::handleKeyDown(ascii, keycode, modifiers); +} + #ifdef _WIN32_WCE #pragma mark - |