aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-01-13 19:34:27 +0100
committerEugene Sandulenko2016-01-13 19:34:27 +0100
commitf9412921f4869080ab85342b30fcfd548f7d53ef (patch)
tree51c367e67f46de85d5c82f177ead30b74e37179b
parenta6cf96853384d1e6aafd8e4ced76eac1fd6026f0 (diff)
downloadscummvm-rg350-f9412921f4869080ab85342b30fcfd548f7d53ef.tar.gz
scummvm-rg350-f9412921f4869080ab85342b30fcfd548f7d53ef.tar.bz2
scummvm-rg350-f9412921f4869080ab85342b30fcfd548f7d53ef.zip
WAGE: Show accelerator keys for submenus
-rw-r--r--engines/wage/menu.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp
index 5dc761b82c..a75924f18a 100644
--- a/engines/wage/menu.cpp
+++ b/engines/wage/menu.cpp
@@ -137,7 +137,7 @@ Menu::Menu(Gui *gui) : _gui(gui) {
for (int i = 0; menuSubItems[i].menunum; i++) {
MenuData *m = &menuSubItems[i];
- _items[m->menunum]->subitems.push_back(new MenuSubItem(m->title, m->action, m->shortcut));
+ _items[m->menunum]->subitems.push_back(new MenuSubItem(m->title, m->action, 0, m->shortcut));
}
MenuItem *commands = new MenuItem("Commands");
@@ -200,7 +200,7 @@ const char *Menu::getAcceleratorString(MenuSubItem *item) {
*res = 0;
if (item->shortcut != 0)
- sprintf(res, " \u2318%c", item->shortcut);
+ sprintf(res, " \x11%c", item->shortcut);
return res;
}
@@ -282,7 +282,12 @@ void Menu::renderSubmenu(MenuItem *menu) {
int x = r->left + kMenuDropdownPadding;
int y = r->top;
for (int i = 0; i < menu->subitems.size(); i++) {
- _font->drawString(&_gui->_screen, menu->subitems[i]->text, x, y, r->width(), kColorBlack);
+ Common::String text(menu->subitems[i]->text);
+ Common::String acceleratorText(getAcceleratorString(menu->subitems[i]));
+ if (acceleratorText.size()) {
+ text += acceleratorText;
+ }
+ _font->drawString(&_gui->_screen, text, x, y, r->width(), kColorBlack);
y += kMenuDropdownItemHeight;
}