GRAPHICS: MACGUI: Added debug printout for MacMenu

This commit is contained in:
Eugene Sandulenko 2019-10-02 12:41:45 +02:00
parent a49fd0dd5e
commit 6dee083352
2 changed files with 26 additions and 0 deletions

View File

@ -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);

View File

@ -107,6 +107,8 @@ private:
void drawSubMenuArrow(ManagedSurface *dst, int x, int y, int color);
void printMenu(int level = 0, MacMenuSubMenu *submenu = nullptr);
Common::Array<MacMenuItem *> _items;
const Font *_font;