aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs_options.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-01-02 15:25:14 -1000
committerPaul Gilbert2015-01-02 15:25:14 -1000
commit9b40bd5c6aa8110e7b3a13eec2550a4c6f201668 (patch)
treed01b3b167be8c90ef338fdb2eabfb8f682ce83f6 /engines/xeen/dialogs_options.cpp
parente1404f127d376225d0c15c43b12f59749689c731 (diff)
downloadscummvm-rg350-9b40bd5c6aa8110e7b3a13eec2550a4c6f201668.tar.gz
scummvm-rg350-9b40bd5c6aa8110e7b3a13eec2550a4c6f201668.tar.bz2
scummvm-rg350-9b40bd5c6aa8110e7b3a13eec2550a4c6f201668.zip
XEEN: More UI loading code, refactored Dialog base to ButtonContainer
Diffstat (limited to 'engines/xeen/dialogs_options.cpp')
-rw-r--r--engines/xeen/dialogs_options.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/engines/xeen/dialogs_options.cpp b/engines/xeen/dialogs_options.cpp
index e85a4af51d..eace67eecd 100644
--- a/engines/xeen/dialogs_options.cpp
+++ b/engines/xeen/dialogs_options.cpp
@@ -81,14 +81,14 @@ void OptionsMenu::execute() {
while (!_vm->shouldQuit()) {
// Show the dialog with a continually animating background
- while (!_vm->shouldQuit() && _key == '\0')
+ while (!_vm->shouldQuit() && !_buttonValue)
showContents(title1Sprites, true);
if (_vm->shouldQuit())
return;
// Handle keypress
- char key = toupper(_key);
- _key = '\0';
+ int key = toupper(_buttonValue);
+ _buttonValue = 0;
if (key == 'C' || key == 'V') {
// Show credits
@@ -218,20 +218,13 @@ void WorldOptionsMenu::showContents(SpriteResource &title1, bool waitFlag) {
screen._windows[28].frame();
screen._windows[28].writeString(OPTIONS_TITLE);
- for (uint btnIndex = 0; btnIndex < _buttons.size(); ++btnIndex) {
- DialogButton &btn = _buttons[btnIndex];
- if (btn._draw) {
- btn._sprites->draw(screen._windows[0], btnIndex * 2,
- Common::Point(btn._bounds.left, btn._bounds.top));
- }
- }
+ drawButtons(&screen._windows[0]);
if (waitFlag) {
screen._windows[0].update();
- while (!_vm->shouldQuit() && _key == Common::KEYCODE_INVALID &&
- events.timeElapsed() < 3) {
- checkEvents();
+ while (!_vm->shouldQuit() && !_buttonValue && events.timeElapsed() < 3) {
+ checkEvents(_vm);
}
}
}