diff options
author | Eugene Sandulenko | 2016-01-13 22:29:54 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-01-13 22:29:54 +0100 |
commit | 0299f5c5800371b2ea5291ec9c3ee084ab1cb0c8 (patch) | |
tree | 507862ef6efb76f12a4d87192d3a7be2e7174fa1 /engines/wage | |
parent | c196d5fa7e4e1254510937fd8b8b58b14be396a7 (diff) | |
download | scummvm-rg350-0299f5c5800371b2ea5291ec9c3ee084ab1cb0c8.tar.gz scummvm-rg350-0299f5c5800371b2ea5291ec9c3ee084ab1cb0c8.tar.bz2 scummvm-rg350-0299f5c5800371b2ea5291ec9c3ee084ab1cb0c8.zip |
WAGE: Support for disabled submenu items
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/menu.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp index 61c4788b18..aa59e51735 100644 --- a/engines/wage/menu.cpp +++ b/engines/wage/menu.cpp @@ -108,23 +108,24 @@ struct MenuData { const char *title; int action; byte shortcut; + bool enabled; } menuSubItems[] = { - { 1, "New", kMenuActionNew, 0 }, - { 1, "Open...", kMenuActionOpen, 0 }, - { 1, "Close", kMenuActionClose, 0 }, - { 1, "Save", kMenuActionSave, 0 }, - { 1, "Save as...", kMenuActionSaveAs, 0 }, - { 1, "Revert", kMenuActionRevert, 0 }, - { 1, "Quit", kMenuActionQuit, 0 }, - - { 2, "Undo", kMenuActionUndo, 'Z' }, - { 2, NULL, 0, 0 }, - { 2, "Cut", kMenuActionCut, 'K' }, - { 2, "Copy", kMenuActionCopy, 'C' }, - { 2, "Paste", kMenuActionPaste, 'V' }, - { 2, "Clear", kMenuActionClear, 'B' }, - - { 0, NULL, 0, 0 } + { 1, "New", kMenuActionNew, 0, false }, + { 1, "Open...", kMenuActionOpen, 0, false }, + { 1, "Close", kMenuActionClose, 0, true }, + { 1, "Save", kMenuActionSave, 0, true }, + { 1, "Save as...", kMenuActionSaveAs, 0, true }, + { 1, "Revert", kMenuActionRevert, 0, true }, + { 1, "Quit", kMenuActionQuit, 0, true }, + + { 2, "Undo", kMenuActionUndo, 'Z', false }, + { 2, NULL, 0, 0, false }, + { 2, "Cut", kMenuActionCut, 'K', false }, + { 2, "Copy", kMenuActionCopy, 'C', false }, + { 2, "Paste", kMenuActionPaste, 'V', false }, + { 2, "Clear", kMenuActionClear, 'B', false }, + + { 0, NULL, 0, 0, false } }; Menu::Menu(Gui *gui) : _gui(gui) { @@ -144,7 +145,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, 0, m->shortcut)); + _items[m->menunum]->subitems.push_back(new MenuSubItem(m->title, m->action, 0, m->shortcut, m->enabled)); } MenuItem *commands = new MenuItem("Commands"); @@ -294,7 +295,7 @@ void Menu::renderSubmenu(MenuItem *menu) { } int color = kColorBlack; - if (i == _activeSubItem && text.size()) { + if (i == _activeSubItem && text.size() && menu->subitems[i]->enabled) { color = kColorWhite; Common::Rect trect(r->left, y - (_gui->_builtInFonts ? 1 : 0), r->right, y + _font->getFontHeight()); |