diff options
author | Eugene Sandulenko | 2016-01-13 19:54:01 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-01-13 19:54:01 +0100 |
commit | 0476f0ea36709562574b7dd2411d1b0921ec2920 (patch) | |
tree | 9e220bfd2e5b96b569bceaa834100a4eb592a24e | |
parent | f9412921f4869080ab85342b30fcfd548f7d53ef (diff) | |
download | scummvm-rg350-0476f0ea36709562574b7dd2411d1b0921ec2920.tar.gz scummvm-rg350-0476f0ea36709562574b7dd2411d1b0921ec2920.tar.bz2 scummvm-rg350-0476f0ea36709562574b7dd2411d1b0921ec2920.zip |
WAGE: Highlight submenu items
-rw-r--r-- | engines/wage/menu.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp index a75924f18a..a906c9c030 100644 --- a/engines/wage/menu.cpp +++ b/engines/wage/menu.cpp @@ -287,7 +287,15 @@ void Menu::renderSubmenu(MenuItem *menu) { if (acceleratorText.size()) { text += acceleratorText; } - _font->drawString(&_gui->_screen, text, x, y, r->width(), kColorBlack); + + int color = kColorBlack; + if (i == _activeSubItem) { + color = kColorWhite; + Common::Rect trect(r->left, y, r->right, y + kMenuDropdownItemHeight); + + Design::drawFilledRect(&_gui->_screen, trect, kColorBlack, _patterns, 1); + } + _font->drawString(&_gui->_screen, text, x, y, r->width(), color); y += kMenuDropdownItemHeight; } @@ -320,6 +328,15 @@ bool Menu::mouseClick(int x, int y) { return true; } + } else if (_menuActivated && _items[_activeItem]->subbbox.contains(x, y)) { + MenuItem *it = _items[_activeItem]; + int numSubItem = (y - it->subbbox.top) / kMenuDropdownItemHeight; + + if (numSubItem != _activeSubItem) { + _activeSubItem = numSubItem; + + renderSubmenu(_items[_activeItem]); + } } return false; |