diff options
author | johndoe123 | 2015-12-01 13:10:28 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | d16ebff3901b3731ec48d6dfda6b91acbdb11ff5 (patch) | |
tree | 4a1fad92cb102f55c56fa703230b4da4f0a48abf /engines/illusions/menusystem.cpp | |
parent | f692e0acfbe1e0a2266502348da7576a0c4f89a1 (diff) | |
download | scummvm-rg350-d16ebff3901b3731ec48d6dfda6b91acbdb11ff5.tar.gz scummvm-rg350-d16ebff3901b3731ec48d6dfda6b91acbdb11ff5.tar.bz2 scummvm-rg350-d16ebff3901b3731ec48d6dfda6b91acbdb11ff5.zip |
ILLUSIONS: DUCKMAN: Implement special opcode 160012 and related code
Diffstat (limited to 'engines/illusions/menusystem.cpp')
-rw-r--r-- | engines/illusions/menusystem.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp index f26a461223..01b92208d8 100644 --- a/engines/illusions/menusystem.cpp +++ b/engines/illusions/menusystem.cpp @@ -105,6 +105,8 @@ void BaseMenuSystem::playSoundEffect14() { } void BaseMenuSystem::selectMenuChoiceIndex(uint choiceIndex) { + debug("choiceIndex: %d", choiceIndex); + debug("_menuChoiceOffset: %p", (void*)_menuChoiceOffset); if (choiceIndex > 0 && _menuChoiceOffset) { *_menuChoiceOffset = _menuChoiceOffsets[choiceIndex - 1]; debug(0, "*_menuChoiceOffset: %04X", *_menuChoiceOffset); @@ -211,7 +213,7 @@ bool BaseMenuSystem::calcMenuItemIndexAtPoint(Common::Point pt, uint &menuItemIn } void BaseMenuSystem::setMousePos(Common::Point &mousePos) { - _vm->_input->setCursorPosition(mousePos); + //TODO Strange behavior _vm->_input->setCursorPosition(mousePos); Control *mouseCursor = _vm->getObjectControl(0x40004); mouseCursor->_actor->_position = mousePos; } @@ -372,6 +374,7 @@ void BaseMenuSystem::closeMenu() { } void BaseMenuSystem::handleClick(uint menuItemIndex, const Common::Point &mousePos) { + debug("BaseMenuSystem::handleClick() menuItemIndex: %d", menuItemIndex); if (menuItemIndex == 0) { playSoundEffect14(); @@ -439,15 +442,17 @@ void BaseMenuSystem::update(Control *cursorControl) { uint newHoveredMenuItemIndex; bool resetTimeOut = false; - if (calcMenuItemIndexAtPoint(mousePos, newHoveredMenuItemIndex) && newHoveredMenuItemIndex != _hoveredMenuItemIndex) { - if (_hoveredMenuItemIndex == 0) - initActor318(); - _hoveredMenuItemIndex = newHoveredMenuItemIndex; - _hoveredMenuItemIndex2 = newHoveredMenuItemIndex; - setMenuCursorNum(2); - updateActor318(); - resetTimeOut = true; - } else if (_hoveredMenuItemIndex == 0) { + if (calcMenuItemIndexAtPoint(mousePos, newHoveredMenuItemIndex)) { + if (newHoveredMenuItemIndex != _hoveredMenuItemIndex) { + if (_hoveredMenuItemIndex == 0) + initActor318(); + _hoveredMenuItemIndex = newHoveredMenuItemIndex; + _hoveredMenuItemIndex2 = newHoveredMenuItemIndex; + setMenuCursorNum(2); + updateActor318(); + resetTimeOut = true; + } + } else if (_hoveredMenuItemIndex != 0) { setMenuCursorNum(1); hideActor318(); _hoveredMenuItemIndex = 0; @@ -511,12 +516,9 @@ void BaseMenuSystem::updateTimeOut(bool resetTimeOut) { _timeOutStartTime = getCurrentTime(); _timeOutEndTime = _timeOutDuration + _timeOutStartTime; } else if (isTimerExpired(_timeOutStartTime, _timeOutEndTime)) { + debug("timeout reached"); _isTimeOutEnabled = false; selectMenuChoiceIndex(_timeOutMenuChoiceIndex); - // TODO *_menuChoiceOffset = *((_WORD *)&_menuCallerThreadId + _timeOutMenuChoiceIndex + 1); - //_vm->_threads->notifyId(_menuCallerThreadId); - //_menuCallerThreadId = 0; - //closeMenu(); } } |