1 | Index: dialogs.cpp
|
---|
2 | ===================================================================
|
---|
3 | RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
|
---|
4 | retrieving revision 1.40
|
---|
5 | diff -r1.40 dialogs.cpp
|
---|
6 | 649a650,653
|
---|
7 | > ConfirmExitDialog::ConfirmExitDialog(NewGui *gui, Scumm *scumm)
|
---|
8 | > : InfoDialog(gui, scumm, "Are you sure you want to quit? (Y/N)") {
|
---|
9 | > }
|
---|
10 | >
|
---|
11 | Index: dialogs.h
|
---|
12 | ===================================================================
|
---|
13 | RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v
|
---|
14 | retrieving revision 1.17
|
---|
15 | diff -r1.17 dialogs.h
|
---|
16 | 139a140,160
|
---|
17 | > class ConfirmExitDialog : public InfoDialog {
|
---|
18 | > public:
|
---|
19 | > ConfirmExitDialog(NewGui *gui, Scumm *scumm);
|
---|
20 | > virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers)
|
---|
21 | > {
|
---|
22 | > if (tolower(ascii) == 'n') { // Close exit dialog if n key is pressed
|
---|
23 | > result = ascii;
|
---|
24 | > close();
|
---|
25 | > }
|
---|
26 | > if (tolower(ascii) == 'y') { // Quit engine if y key is pressed
|
---|
27 | > result = ascii;
|
---|
28 | > close();
|
---|
29 | > }
|
---|
30 | > else
|
---|
31 | > ScummDialog::handleKeyDown(ascii, keycode, modifiers);
|
---|
32 | > }
|
---|
33 | > int getResult() {return result;};
|
---|
34 | > private:
|
---|
35 | > int result;
|
---|
36 | > };
|
---|
37 | >
|
---|
38 | Index: scumm.h
|
---|
39 | ===================================================================
|
---|
40 | RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
|
---|
41 | retrieving revision 1.160
|
---|
42 | diff -r1.160 scumm.h
|
---|
43 | 356a357
|
---|
44 | > Dialog *_confirmExitDialog;
|
---|
45 | 363a365
|
---|
46 | > void confirmexitDialog();
|
---|
47 | 923a928
|
---|
48 | > bool _confirm;
|
---|
49 | Index: scummvm.cpp
|
---|
50 | ===================================================================
|
---|
51 | RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
|
---|
52 | retrieving revision 2.67
|
---|
53 | diff -r2.67 scummvm.cpp
|
---|
54 | 192a193
|
---|
55 | > _confirm = detector->_confirm;
|
---|
56 | 1192a1194,1205
|
---|
57 | > void Scumm::confirmexitDialog() {
|
---|
58 | > if (!_confirmExitDialog)
|
---|
59 | > _confirmExitDialog = new ConfirmExitDialog(_newgui, this);
|
---|
60 | > runDialog(_confirmExitDialog);
|
---|
61 | >
|
---|
62 | > if (tolower(((ConfirmExitDialog*)_confirmExitDialog)->getResult()) == 'y')
|
---|
63 | > {
|
---|
64 | > shutDown(0);
|
---|
65 | > _system->quit(); // TODO: Remove this when shutDown is implemented
|
---|
66 | > }
|
---|
67 | > }
|
---|
68 | >
|
---|
69 | 1557a1571,1577
|
---|
70 | > else if (event.kbd.keycode == 'z')
|
---|
71 | > {
|
---|
72 | > if(_confirm)
|
---|
73 | > confirmexitDialog();
|
---|
74 | > else
|
---|
75 | > _system->quit(); // TODO: change to shutDown() when implemented
|
---|
76 | > }
|
---|
77 | 1559a1580,1584
|
---|
78 | > } else if (event.kbd.flags == OSystem::KBD_ALT && event.kbd.keycode == 'x') {
|
---|
79 | > if(_confirm)
|
---|
80 | > confirmexitDialog();
|
---|
81 | > else
|
---|
82 | > _system->quit(); // TODO: change to shutDown() when implemented
|
---|
83 | Index: gameDetector.cpp
|
---|
84 | ===================================================================
|
---|
85 | RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
|
---|
86 | retrieving revision 1.86
|
---|
87 | diff -r1.86 gameDetector.cpp
|
---|
88 | 74a75
|
---|
89 | > "\t-i - confirm exit before quitting (default: false)\n"
|
---|
90 | 150a153
|
---|
91 | > _confirm = false;
|
---|
92 | 225a229,230
|
---|
93 | > _confirm = g_config->getBool("confirm_exit", _confirm ? true : false);
|
---|
94 | >
|
---|
95 | 327a333,337
|
---|
96 | > case 'i':
|
---|
97 | > CHECK_OPTION();
|
---|
98 | > _confirm = (c == 'i');
|
---|
99 | > g_config->setBool("confirm_exit", _confirm);
|
---|
100 | > break;
|
---|
101 | Index: gameDetector.h
|
---|
102 | ===================================================================
|
---|
103 | RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.h,v
|
---|
104 | retrieving revision 1.35
|
---|
105 | diff -r1.35 gameDetector.h
|
---|
106 | 164a165
|
---|
107 | > bool _confirm;
|
---|
108 | Index: sdl/sdl-common.cpp
|
---|
109 | ===================================================================
|
---|
110 | RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
|
---|
111 | retrieving revision 1.42
|
---|
112 | diff -r1.42 sdl-common.cpp
|
---|
113 | 523,524c523,529
|
---|
114 | < if ((b == KBD_CTRL && ev.key.keysym.sym=='z') || (b == KBD_ALT && ev.key.keysym.sym=='x')) {
|
---|
115 | < quit();
|
---|
116 | ---
|
---|
117 | > if ((b == KBD_CTRL && ev.key.keysym.sym=='z') ||
|
---|
118 | > (b == KBD_ALT && ev.key.keysym.sym=='x')) {
|
---|
119 | > event->event_code = EVENT_KEYDOWN;
|
---|
120 | > event->kbd.flags = b;
|
---|
121 | > event->kbd.keycode = ev.key.keysym.sym;
|
---|
122 | > return true;
|
---|
123 | > //quit();
|
---|
124 | 531c536,540
|
---|
125 | < quit();
|
---|
126 | ---
|
---|
127 | > event->event_code = EVENT_KEYDOWN;
|
---|
128 | > event->kbd.flags = KBD_ALT;
|
---|
129 | > event->kbd.keycode = 'x';
|
---|
130 | > return true;
|
---|
131 | > //quit();
|
---|