aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2011-06-04 16:29:20 +1000
committerPaul Gilbert2011-06-04 16:29:20 +1000
commit06166e03b09a6c6becb216928fe52d5198d0da9e (patch)
tree1b9567f3257c843cc7dad1f12152dcd00576ac6b /engines
parenta3ff8b5de6026a623c673ed2c4ad1ca8892c5ddc (diff)
downloadscummvm-rg350-06166e03b09a6c6becb216928fe52d5198d0da9e.tar.gz
scummvm-rg350-06166e03b09a6c6becb216928fe52d5198d0da9e.tar.bz2
scummvm-rg350-06166e03b09a6c6becb216928fe52d5198d0da9e.zip
TSAGE: Bugfixes for displaying thick borders on default buttons
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/dialogs.cpp6
-rw-r--r--engines/tsage/globals.cpp4
-rw-r--r--engines/tsage/ringworld_demo.cpp12
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();
}