diff options
author | Paul Gilbert | 2011-09-11 15:29:43 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-09-11 15:29:43 +1000 |
commit | 7b73ae590c548de3006de3a720adabf2bcdf7025 (patch) | |
tree | af35850d17e7ed5308869ed3f1c27aeb97da78c6 /engines/tsage/blue_force/blueforce_dialogs.cpp | |
parent | d8aaf40090ff32acf80e2433df57f7c74d126ab4 (diff) | |
download | scummvm-rg350-7b73ae590c548de3006de3a720adabf2bcdf7025.tar.gz scummvm-rg350-7b73ae590c548de3006de3a720adabf2bcdf7025.tar.bz2 scummvm-rg350-7b73ae590c548de3006de3a720adabf2bcdf7025.zip |
TSAGE: Implemented Scene 60 - Motorcycle
Diffstat (limited to 'engines/tsage/blue_force/blueforce_dialogs.cpp')
-rw-r--r-- | engines/tsage/blue_force/blueforce_dialogs.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/engines/tsage/blue_force/blueforce_dialogs.cpp b/engines/tsage/blue_force/blueforce_dialogs.cpp index f71d3d7393..e074f8884d 100644 --- a/engines/tsage/blue_force/blueforce_dialogs.cpp +++ b/engines/tsage/blue_force/blueforce_dialogs.cpp @@ -365,6 +365,70 @@ void AmmoBeltDialog::draw() { } } +/*--------------------------------------------------------------------------*/ + +RadioConvDialog::RadioConvDialog() : ModalDialog() { + int idx; + + // Set up the list of buttons + int maxWidth = 0; + for (idx = 0; idx < 8; ++idx) { + _buttons[idx].setText(RADIO_BTN_LIST[idx]); + maxWidth = MAX(maxWidth, (int)_buttons[idx]._bounds.width()); + + add(&_buttons[idx]); + } + + // Set up the button positions and add them to the dialog + for (idx = 0; idx < 8; ++idx) { + _buttons[idx]._bounds.moveTo((idx % 2) * maxWidth + 2, + idx / 2 * _buttons[idx]._bounds.height() + 2); + _buttons[idx]._bounds.setWidth(maxWidth); + + add(&_buttons[idx]); + } + + // Set the dialog size and position + setDefaults(); + setTopLeft(8, 92); + + BF_GLOBALS._events.setCursor(CURSOR_ARROW); +} + +RadioConvDialog::~RadioConvDialog() { + BF_GLOBALS._events.setCursor(CURSOR_WALK); +} + +int RadioConvDialog::execute() { + GfxButton *btn = ModalDialog::execute(); + + // Get which button was pressed + int btnIndex = -1; + for (int idx = 0; idx < 8; ++idx) { + if (btn == &_buttons[idx]) { + btnIndex = idx; + break; + } + } + + return btnIndex; +} + +int RadioConvDialog::show() { + // Show the dialog + RadioConvDialog *dlg = new RadioConvDialog(); + dlg->draw(); + + int btnIndex = dlg->execute(); + + // Close the dialog + dlg->remove(); + delete dlg; + + return btnIndex; +} + + } // End of namespace BlueForce } // End of namespace TsAGE |