diff options
author | uruk | 2013-09-02 12:53:01 +0200 |
---|---|---|
committer | uruk | 2013-09-02 12:53:01 +0200 |
commit | cf5f150d9b4d00ee16b0ee51861a4386b35f9626 (patch) | |
tree | 9aac32a8a33de07e0c62f6371942e8470ef6e75d | |
parent | 5720fa1dba82063409472fad41c0c269f9cb2b49 (diff) | |
download | scummvm-rg350-cf5f150d9b4d00ee16b0ee51861a4386b35f9626.tar.gz scummvm-rg350-cf5f150d9b4d00ee16b0ee51861a4386b35f9626.tar.bz2 scummvm-rg350-cf5f150d9b4d00ee16b0ee51861a4386b35f9626.zip |
AVALANCHE: Upgrade the drop-down menu.
-rw-r--r-- | engines/avalanche/dropdown2.cpp | 18 |
1 files 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; } } |