diff options
author | Eric Fry | 2018-04-30 20:17:10 +1000 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | a7d78df98cdd0399d338c0077efc474d02678643 (patch) | |
tree | f8f741af710ab551c004bd8a465eef66d4521b04 /engines/illusions/menusystem.cpp | |
parent | 39798c63d1d6a7153527a726acfa3c1cf837760f (diff) | |
download | scummvm-rg350-a7d78df98cdd0399d338c0077efc474d02678643.tar.gz scummvm-rg350-a7d78df98cdd0399d338c0077efc474d02678643.tar.bz2 scummvm-rg350-a7d78df98cdd0399d338c0077efc474d02678643.zip |
ILLUSIONS: Fix clang warnings. Work on menu keyboard control
Fix some warnings while compiling with clang.
Add up/down key support in game menus.
Diffstat (limited to 'engines/illusions/menusystem.cpp')
-rw-r--r-- | engines/illusions/menusystem.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp index 391cded739..878dacf0df 100644 --- a/engines/illusions/menusystem.cpp +++ b/engines/illusions/menusystem.cpp @@ -465,15 +465,22 @@ void BaseMenuSystem::update(Control *cursorControl) { handleClick(_activeMenu->_defaultMenuItemIndex, mousePos); } else if (_vm->_input->pollEvent(kEventUp)) { // TODO handleUpKey(); - if (_hoveredMenuItemIndex > 0) { - setMouseCursorToMenuItem(--_hoveredMenuItemIndex); - _hoveredMenuItemIndex2 = _hoveredMenuItemIndex; - updateActorHoverBackground(); + if (_hoveredMenuItemIndex == 1) { + _hoveredMenuItemIndex = _activeMenu->getMenuItemsCount(); + } else { + _hoveredMenuItemIndex--; } - + setMouseCursorToMenuItem(_hoveredMenuItemIndex); + _hoveredMenuItemIndex2 = _hoveredMenuItemIndex; + updateActorHoverBackground(); } else if (_vm->_input->pollEvent(kEventDown)) { // TODO handleDownKey(); - setMouseCursorToMenuItem(++_hoveredMenuItemIndex); + if (_hoveredMenuItemIndex == _activeMenu->getMenuItemsCount()) { + _hoveredMenuItemIndex = 1; + } else { + _hoveredMenuItemIndex++; + } + setMouseCursorToMenuItem(_hoveredMenuItemIndex); _hoveredMenuItemIndex2 = _hoveredMenuItemIndex; updateActorHoverBackground(); } |