diff options
author | Eugene Sandulenko | 2019-12-11 01:10:41 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-11 01:10:41 +0100 |
commit | ecc7986b0b679ce7cea86290687c22b371ac5624 (patch) | |
tree | 0fdf93979b95caf1c5974518208567fb75c3cafd /engines/director/lingo/lingo-builtins.cpp | |
parent | 521d28a62c4ae55d1f0b9ef1650cddd8fb5ef09e (diff) | |
download | scummvm-rg350-ecc7986b0b679ce7cea86290687c22b371ac5624.tar.gz scummvm-rg350-ecc7986b0b679ce7cea86290687c22b371ac5624.tar.bz2 scummvm-rg350-ecc7986b0b679ce7cea86290687c22b371ac5624.zip |
DIRECTOR: LINGO: Pass menu to MacMenu in installMenu built-in
Diffstat (limited to 'engines/director/lingo/lingo-builtins.cpp')
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 3355ddc0e0..f3b7e377c9 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -1177,7 +1177,9 @@ void Lingo::b_installMenu(int nargs) { Common::String line; int linenum = -1; // We increment it before processing - //Graphics::MacMenu *menu = g_director->_wm->addMenu(); + Graphics::MacMenu *menu = g_director->_wm->addMenu(); + int submenu; + Common::String submenuText; //Graphics::MacMenuSubMenu *submenu = nullptr; for (const byte *s = (const byte *)menuStxt.c_str(); *s; s++) { @@ -1207,10 +1209,14 @@ void Lingo::b_installMenu(int nargs) { while (*p && (*p == ' ' || *p == '\t')) p++; + if (!submenuText.empty()) { + menu->createSubMenuFromString(submenu, submenuText.c_str(), 100); + } + warning("menu: '%s'", Common::toPrintable(p).c_str()); - //menu->addMenuItem(nullptr, Common::String(p)); + submenu = menu->addMenuItem(nullptr, Common::String(p)); - //submenu = menu->addSubMenu(nullptr); + submenuText.clear(); continue; } @@ -1233,6 +1239,15 @@ void Lingo::b_installMenu(int nargs) { command.trim(); warning("text: '%s' command: '%s'", Common::toPrintable(text).c_str(), Common::toPrintable(command).c_str()); + + if (!submenuText.empty()) + submenuText += ';'; + + submenuText += text; + } + + if (!submenuText.empty()) { + menu->createSubMenuFromString(submenu, submenuText.c_str(), 100); } warning("STUB: b_installMenu(%d)", d.u.i); |