diff options
author | Eugene Sandulenko | 2016-01-15 11:57:20 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:12:45 +0100 |
commit | 402a9cf8efe6e040b5892cf80b613d907ed01931 (patch) | |
tree | cb180d0bf37de4ead21a53860d72e2125d5665af /engines/wage | |
parent | 5a887808aba3d3a496828549201f563f9ad70c6e (diff) | |
download | scummvm-rg350-402a9cf8efe6e040b5892cf80b613d907ed01931.tar.gz scummvm-rg350-402a9cf8efe6e040b5892cf80b613d907ed01931.tar.bz2 scummvm-rg350-402a9cf8efe6e040b5892cf80b613d907ed01931.zip |
WAGE: Implemented getAboutMenuItemName()
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/world.cpp | 29 | ||||
-rw-r--r-- | engines/wage/world.h | 1 |
2 files changed, 24 insertions, 6 deletions
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index ca1e585440..640feed0f0 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -265,10 +265,13 @@ bool World::loadWorld(Common::MacResManager *resMan) { res = resMan->getResource(MKTAG('M','E','N','U'), 2001); if (res != NULL) { - readMenu(res); - warning("STUB: aboutMenu"); - //String aboutMenuItemName = appleMenu[1].split(";")[0]; - //world.setAboutMenuItemName(aboutMenuItemName); + Common::StringArray *menu = readMenu(res); + _aboutMenuItemName = ""; + Common::String string = menu->operator[](0); + + for (int i = 0; i < string.size() && string[i] != ';'; i++) // Read token + _aboutMenuItemName += string[i]; + delete res; } res = resMan->getResource(MKTAG('M','E','N','U'), 2004); @@ -485,9 +488,23 @@ bool World::scenesAreConnected(Scene *scene1, Scene *scene2) { } const char *World::getAboutMenuItemName() { - warning("STUB: getAboutMenuItemName"); + static char menu[256]; + + *menu = '\0'; + + if (_aboutMenuItemName.size() == 0) { + sprintf(menu, "About %s...", _name.c_str()); + } else { // Replace '@' with name + const char *str = _aboutMenuItemName.c_str(); + char *pos = strchr(str, '@'); + if (pos) { + strncat(menu, str, (pos - str)); + strcat(menu, _name.c_str()); + strcat(menu, pos + 1); + } + } - return "About"; + return menu; } } // End of namespace Wage diff --git a/engines/wage/world.h b/engines/wage/world.h index 2d2a16de41..ba1aa164c1 100644 --- a/engines/wage/world.h +++ b/engines/wage/world.h @@ -95,6 +95,7 @@ public: Common::String *_saveBeforeCloseMessage; Common::String *_revertMessage; + Common::String _aboutMenuItemName; Common::String _commandsMenuName; Common::String _commandsMenu; Common::String _weaponsMenuName; |