diff options
-rw-r--r-- | engines/tsage/dialogs.cpp | 6 | ||||
-rw-r--r-- | engines/tsage/globals.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/ringworld_demo.cpp | 12 |
3 files changed, 6 insertions, 16 deletions
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index 759deebbef..1d129a8a3e 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -54,7 +54,6 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String if (!btn2Message.empty()) { // Set up the second button - _defaultButton = &_btn2; add(&_btn2); _btn2.setText(btn2Message); _btn2._bounds.moveTo(_msg._bounds.right - _btn2._bounds.width(), _msg._bounds.bottom); @@ -82,8 +81,9 @@ int MessageDialog::show2(const Common::String &message, const Common::String &bt MessageDialog *dlg = new MessageDialog(message, btn1Message, btn2Message); dlg->draw(); - GfxButton *selectedButton = dlg->execute(); - int result = (selectedButton == &dlg->_btn1) ? 0 : 1; + GfxButton *defaultButton = !btn2Message.empty() ? &dlg->_btn2 : &dlg->_btn1; + GfxButton *selectedButton = dlg->execute(defaultButton); + int result = (selectedButton == defaultButton) ? 1 : 0; delete dlg; return result; diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index bc34c59673..863f1458b1 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -60,8 +60,8 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _gfxFontNumber = 0; _gfxColors.background = 6; _gfxColors.foreground = 0; - _fontColors.background = 0; - _fontColors.foreground = 0; + _fontColors.background = 255; + _fontColors.foreground = 6; _dialogCenter.y = 80; // Workaround in order to use later version of the engine _unkColor1 = _gfxColors.foreground; diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp index 3ad414fa20..de8dbf8c12 100644 --- a/engines/tsage/ringworld_demo.cpp +++ b/engines/tsage/ringworld_demo.cpp @@ -40,17 +40,7 @@ Scene *RingworldDemoGame::createScene(int sceneNumber) { } void RingworldDemoGame::quitGame() { - _globals->_events.setCursor(CURSOR_ARROW); - MessageDialog *dlg = new MessageDialog(DEMO_EXIT_MSG, EXIT_BTN_STRING, DEMO_BTN_STRING); - dlg->draw(); - - GfxButton *selectedButton = dlg->execute(&dlg->_btn2); - bool exitFlag = selectedButton != &dlg->_btn2; - - delete dlg; - _globals->_events.hideCursor(); - - if (exitFlag) + if (MessageDialog::show(DEMO_EXIT_MSG, EXIT_BTN_STRING, DEMO_BTN_STRING) == 0) _vm->quitGame(); } |