diff options
Diffstat (limited to 'graphics/macgui/macmenu.cpp')
-rw-r--r-- | graphics/macgui/macmenu.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index c22e3a0860..81208c0c35 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -276,9 +276,33 @@ MacMenu *MacMenu::createMenuFromPEexe(Common::PEResources &exe, MacWindowManager } } delete menuData; + + menu->printMenu(); + return menu; } +void MacMenu::printMenu(int level, MacMenuSubMenu *submenu) { + if (!level) { + for (int i = 0; i < _items.size(); i++) { + debug("%s", _items[i]->unicode ? convertFromU32String(_items[i]->unicodeName).c_str() : _items[i]->name.c_str()); + + if (_items[i]->submenu != nullptr) + printMenu(level + 1, _items[i]->submenu); + } + } else { + for (int j = 0; j < level; j++) + debugN(" "); + + for (int i = 0; i < submenu->subitems.size(); i++) { + debug("%s", submenu->subitems[i]->unicode ? convertFromU32String(submenu->subitems[i]->unicodeText).c_str() : submenu->subitems[i]->text.c_str()); + + if (submenu->subitems[i]->submenu != nullptr) + printMenu(level + 1, submenu->subitems[i]->submenu); + } + } +} + void MacMenu::addStaticMenus(const MacMenuData *data) { MacMenuItem *about = new MacMenuItem(_wm->_fontMan->hasBuiltInFonts() ? "\xa9" : "\xf0"); // (c) Symbol as the most resembling apple _items.push_back(about); |