From 62c66bc67a202694229a46e09d6881eea4ebd77f Mon Sep 17 00:00:00 2001 From: Andrei Prykhodko Date: Sun, 22 Jul 2018 20:37:44 +0300 Subject: GRAPHICS: MACGUI: added unicode submenu rendering --- graphics/macgui/macmenu.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'graphics') diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index 6d0f0fede2..427f605614 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -504,17 +504,21 @@ void MacMenu::renderSubmenu(MacMenuItem *menu) { for (uint i = 0; i < menu->subitems.size(); i++) { Common::String text(menu->subitems[i]->text); Common::String acceleratorText(getAcceleratorString(menu->subitems[i], "")); + + Common::U32String unicodeText(menu->subitems[i]->unicodeText); + // add unicode accelerator + int accelX = r->right - 25; int color = _wm->_colorBlack; - if (i == (uint)_activeSubItem && !text.empty() && menu->subitems[i]->enabled) { + if (i == (uint)_activeSubItem && (!text.empty() || !unicodeText.empty()) && menu->subitems[i]->enabled) { color = _wm->_colorWhite; Common::Rect trect(r->left, y - (_wm->_fontMan->hasBuiltInFonts() ? 1 : 0), r->right, y + _font->getFontHeight()); _screen.fillRect(trect, _wm->_colorBlack); } - if (!text.empty()) { + if (!text.empty() || !unicodeText.empty()) { ManagedSurface *s = &_screen; int tx = x, ty = y; @@ -527,7 +531,10 @@ void MacMenu::renderSubmenu(MacMenuItem *menu) { _tempSurface.clear(kColorGreen); } - _font->drawString(s, text, tx, ty, r->width(), color); + if (menu->subitems[i]->unicode) + _font->drawString(s, unicodeText, tx, ty, r->width(), color); + else + _font->drawString(s, text, tx, ty, r->width(), color); if (!acceleratorText.empty()) _font->drawString(s, acceleratorText, accelX, ty, r->width(), color); -- cgit v1.2.3