diff options
author | Filippos Karapetis | 2009-12-21 14:05:36 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-12-21 14:05:36 +0000 |
commit | e86a16a64196fdca4a5522282a23969271aebd9a (patch) | |
tree | a066099383c0b316472ddccdc00d8d6f29106e2e /engines | |
parent | ba51f8750ed1898d591cee7a60ccbec915f6c88d (diff) | |
download | scummvm-rg350-e86a16a64196fdca4a5522282a23969271aebd9a.tar.gz scummvm-rg350-e86a16a64196fdca4a5522282a23969271aebd9a.tar.bz2 scummvm-rg350-e86a16a64196fdca4a5522282a23969271aebd9a.zip |
Fixed menus in multilingual SCI01 games
svn-id: r46460
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kmenu.cpp | 2 | ||||
-rw-r--r-- | engines/sci/gui/gui_menu.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index d78eb585b8..4074e81ba0 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -38,7 +38,7 @@ namespace Sci { reg_t kAddMenu(EngineState *s, int argc, reg_t *argv) { - Common::String title = s->_segMan->getString(argv[0]); + Common::String title = s->strSplit(s->_segMan->getString(argv[0]).c_str()); Common::String content = s->_segMan->getString(argv[1]); s->_gui->menuAdd(title, content, argv[1]); diff --git a/engines/sci/gui/gui_menu.cpp b/engines/sci/gui/gui_menu.cpp index 0f171106d8..5358f340a6 100644 --- a/engines/sci/gui/gui_menu.cpp +++ b/engines/sci/gui/gui_menu.cpp @@ -184,7 +184,8 @@ void SciGuiMenu::add(Common::String title, Common::String content, reg_t content if (separatorCount == tempPos - beginPos) { itemEntry->separatorLine = true; } else { - itemEntry->text = Common::String(content.c_str() + beginPos, tempPos - beginPos); + EngineState *s = ((SciEngine *)g_engine)->getEngineState(); // HACK: needed for strSplit() + itemEntry->text = s->strSplit(Common::String(content.c_str() + beginPos, tempPos - beginPos).c_str()); } itemEntry->textVmPtr = contentVmPtr; itemEntry->textVmPtr.offset += beginPos; @@ -229,6 +230,7 @@ GuiMenuItemEntry *SciGuiMenu::findItem(uint16 menuId, uint16 itemId) { } void SciGuiMenu::setAttribute(uint16 menuId, uint16 itemId, uint16 attributeId, reg_t value) { + EngineState *s = ((SciEngine *)g_engine)->getEngineState(); // HACK: needed for strSplit() GuiMenuItemEntry *itemEntry = findItem(menuId, itemId); if (!itemEntry) error("Tried to setAttribute() on non-existant menu-item %d:%d", menuId, itemId); @@ -240,7 +242,7 @@ void SciGuiMenu::setAttribute(uint16 menuId, uint16 itemId, uint16 attributeId, itemEntry->saidVmPtr = value; break; case SCI_MENU_ATTRIBUTE_TEXT: - itemEntry->text = _segMan->getString(value); + itemEntry->text = s->strSplit(_segMan->getString(value).c_str()); itemEntry->textVmPtr = value; // We assume here that no script ever creates a separatorLine dynamically break; |