From cf5f150d9b4d00ee16b0ee51861a4386b35f9626 Mon Sep 17 00:00:00 2001 From: uruk Date: Mon, 2 Sep 2013 12:53:01 +0200 Subject: AVALANCHE: Upgrade the drop-down menu. --- engines/avalanche/dropdown2.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp index e7db8750aa..4647f5947a 100644 --- a/engines/avalanche/dropdown2.cpp +++ b/engines/avalanche/dropdown2.cpp @@ -842,6 +842,7 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it... do { _vm->updateEvents(); + // We updadte the cursor's picture. cursorPos = _vm->getMousePos(); // Change arrow... if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) @@ -883,13 +884,22 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it... // NOT clicked button... if ((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8) && (cursorPos.y >= 12) && (cursorPos.y <= (ddm_o.fly * 2 + 1)))) { - do { - _vm->updateEvents(); + + // We act only if the button is relased over a menu item. + Common::Event event; + while (!_vm->shouldQuit()) { + cursorPos = _vm->getMousePos(); + ddm_o.lightup(cursorPos); _vm->_graphics->refreshScreen(); - } while (_vm->_lucerna->holdLeftMouse); + + _vm->updateEvents(); + if (!_vm->_lucerna->holdLeftMouse) + break; + } + uint16 which = (cursorPos.y - 26) / 20; ddm_o.select(which); - if (ddm_o.oo[which].valid) + if (ddm_o.oo[which].valid) // If the menu item wasn't active, we do nothing. return; } } -- cgit v1.2.3