[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.cpp,1.63,1.64 dialogs.h,1.20,1.21 scumm.h,1.274,1.275 scummvm.cpp,2.297,2.298
Max Horn
fingolfin at users.sourceforge.net
Sun Jul 27 18:37:11 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.121,1.122 gameDetector.h,1.49,1.50
- Next message: [Scummvm-cvs-logs] CVS: scummvm/bs2 .cvsignore,NONE,1.1 anims.cpp,NONE,1.1 anims.h,NONE,1.1 build_display.cpp,NONE,1.1 build_display.h,NONE,1.1 console.cpp,NONE,1.1 console.h,NONE,1.1 controls.cpp,NONE,1.1 controls.h,NONE,1.1 credits.h,NONE,1.1 debug.cpp,NONE,1.1 debug.h,NONE,1.1 defs.h,NONE,1.1 events.cpp,NONE,1.1 events.h,NONE,1.1 function.cpp,NONE,1.1 function.h,NONE,1.1 header.h,NONE,1.1 icons.cpp,NONE,1.1 icons.h,NONE,1.1 interpreter.cpp,NONE,1.1 interpreter.h,NONE,1.1 layers.cpp,NONE,1.1 layers.h,NONE,1.1 logic.cpp,NONE,1.1 logic.h,NONE,1.1 maketext.cpp,NONE,1.1 maketext.h,NONE,1.1 mem_view.cpp,NONE,1.1 mem_view.h,NONE,1.1 memory.cpp,NONE,1.1 memory.h,NONE,1.1 module.mk,NONE,1.1 mouse.cpp,NONE,1.1 mouse.h,NONE,1.1 object.h,NONE,1.1 protocol.cpp,NONE,1.1 protocol.h,NONE,1.1 resman.cpp,NONE,1.1 resman.h,NONE,1.1 router.cpp,NONE,1.1 router.h,NONE,1.1 save_rest.cpp,NONE,1.1 save_rest.h,NONE,1.1 scroll.cpp,NONE,1.1 scroll.h,NONE,1.1 sound.cpp,NONE,1.1 sound.h,NONE,1.1 speech.cpp,NONE,1.1 speech.h,NONE,1.1 startup.cpp,NONE,1.1 startup.h,NONE,1.1 sword2.cpp,NONE,1.1 sword2.h,NONE,1.1 sync.cpp,NONE,1.1 sync.h,NONE,1.1 tony_gsdk.cpp,NONE,1.1 tony_gsdk.h,NONE,1.1 walker.cpp,NONE,1.1 walker.h,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv1135/scumm
Modified Files:
dialogs.cpp dialogs.h scumm.h scummvm.cpp
Log Message:
Patch #715991: Quit Confirmation Dialog (feature request #642721) with some tweaks by me
Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- dialogs.cpp 22 Jul 2003 16:05:51 -0000 1.63
+++ dialogs.cpp 28 Jul 2003 01:36:16 -0000 1.64
@@ -681,6 +681,21 @@
: 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 -
Index: dialogs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- dialogs.h 22 Jul 2003 16:05:51 -0000 1.20
+++ dialogs.h 28 Jul 2003 01:36:16 -0000 1.21
@@ -167,6 +167,12 @@
}
};
+class ConfirmExitDialog : public InfoDialog {
+public:
+ ConfirmExitDialog(NewGui *gui, Scumm *scumm);
+ virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
+};
+
#ifdef _WIN32_WCE
class KeysDialog : public ScummDialog {
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.274
retrieving revision 1.275
diff -u -d -r1.274 -r1.275
--- scumm.h 22 Jul 2003 20:53:01 -0000 1.274
+++ scumm.h 28 Jul 2003 01:36:16 -0000 1.275
@@ -387,16 +387,23 @@
// GUI
NewGui *_newgui;
+protected:
Dialog *_pauseDialog;
Dialog *_optionsDialog;
Dialog *_saveLoadDialog;
+ Dialog *_confirmExitDialog;
+public:
// Debugger access this one, too...
ConsoleDialog *_debuggerDialog;
+protected:
int runDialog(Dialog *dialog);
+ void confirmexitDialog();
void pauseDialog();
void saveloadDialog();
- void optionsDialog();
+public:
+ void optionsDialog(); // Used by SaveLoadDialog::handleCommand()
+protected:
char displayError(bool showCancel, const char *message, ...);
protected:
@@ -1060,6 +1067,7 @@
public:
bool _noSubtitles; // Whether to skip all subtitles
+ bool _confirmExit;
protected:
void initCharset(int charset);
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.297
retrieving revision 2.298
diff -u -d -r2.297 -r2.298
--- scummvm.cpp 22 Jul 2003 20:53:01 -0000 2.297
+++ scummvm.cpp 28 Jul 2003 01:36:16 -0000 2.298
@@ -232,6 +232,7 @@
_pauseDialog = NULL;
_optionsDialog = NULL;
_saveLoadDialog = NULL;
+ _confirmExitDialog = NULL;
_debuggerDialog = NULL;
_fastMode = 0;
memset(&_rnd, 0, sizeof(RandomSource));
@@ -394,6 +395,7 @@
_charsetBufPos = 0;
memset(_charsetBuffer, 0, sizeof(_charsetBuffer));
_noSubtitles = false;
+ _confirmExit = false;
_numInMsgStack = 0;
_msgPtrToAdd = NULL;
_messagePtr = NULL;
@@ -545,6 +547,7 @@
setFeatures(detector->_game.features);
_noSubtitles = detector->_noSubtitles;
+ _confirmExit = detector->_confirmExit;
_defaultTalkDelay = detector->_talkSpeed;
_use_adlib = detector->_use_adlib;
_language = detector->_language;
@@ -709,6 +712,7 @@
delete _pauseDialog;
delete _optionsDialog;
delete _saveLoadDialog;
+ delete _confirmExitDialog;
delete _sound;
delete _imuse;
@@ -1459,6 +1463,9 @@
break;
case OSystem::EVENT_QUIT:
+ if(_confirmExit)
+ confirmexitDialog();
+ else
_quit = true;
break;
@@ -2299,6 +2306,15 @@
if (!_optionsDialog)
_optionsDialog = new OptionsDialog(_newgui, this);
runDialog(_optionsDialog);
+}
+
+void Scumm::confirmexitDialog() {
+ if (!_confirmExitDialog)
+ _confirmExitDialog = new ConfirmExitDialog(_newgui, this);
+
+ if (runDialog(_confirmExitDialog)) {
+ _quit = true;
+ }
}
char Scumm::displayError(bool showCancel, const char *message, ...) {
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.121,1.122 gameDetector.h,1.49,1.50
- Next message: [Scummvm-cvs-logs] CVS: scummvm/bs2 .cvsignore,NONE,1.1 anims.cpp,NONE,1.1 anims.h,NONE,1.1 build_display.cpp,NONE,1.1 build_display.h,NONE,1.1 console.cpp,NONE,1.1 console.h,NONE,1.1 controls.cpp,NONE,1.1 controls.h,NONE,1.1 credits.h,NONE,1.1 debug.cpp,NONE,1.1 debug.h,NONE,1.1 defs.h,NONE,1.1 events.cpp,NONE,1.1 events.h,NONE,1.1 function.cpp,NONE,1.1 function.h,NONE,1.1 header.h,NONE,1.1 icons.cpp,NONE,1.1 icons.h,NONE,1.1 interpreter.cpp,NONE,1.1 interpreter.h,NONE,1.1 layers.cpp,NONE,1.1 layers.h,NONE,1.1 logic.cpp,NONE,1.1 logic.h,NONE,1.1 maketext.cpp,NONE,1.1 maketext.h,NONE,1.1 mem_view.cpp,NONE,1.1 mem_view.h,NONE,1.1 memory.cpp,NONE,1.1 memory.h,NONE,1.1 module.mk,NONE,1.1 mouse.cpp,NONE,1.1 mouse.h,NONE,1.1 object.h,NONE,1.1 protocol.cpp,NONE,1.1 protocol.h,NONE,1.1 resman.cpp,NONE,1.1 resman.h,NONE,1.1 router.cpp,NONE,1.1 router.h,NONE,1.1 save_rest.cpp,NONE,1.1 save_rest.h,NONE,1.1 scroll.cpp,NONE,1.1 scroll.h,NONE,1.1 sound.cpp,NONE,1.1 sound.h,NONE,1.1 speech.cpp,NONE,1.1 speech.h,NONE,1.1 startup.cpp,NONE,1.1 startup.h,NONE,1.1 sword2.cpp,NONE,1.1 sword2.h,NONE,1.1 sync.cpp,NONE,1.1 sync.h,NONE,1.1 tony_gsdk.cpp,NONE,1.1 tony_gsdk.h,NONE,1.1 walker.cpp,NONE,1.1 walker.h,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list