diff options
-rw-r--r-- | engines/kyra/gui_hof.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/gui_lok.cpp | 13 | ||||
-rw-r--r-- | engines/kyra/gui_v2.cpp | 21 |
3 files changed, 31 insertions, 9 deletions
diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index ddeae2f5ba..7a7f7c1c84 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -95,7 +95,11 @@ const char *GUI_HoF::getMenuItemTitle(const MenuItem &menuItem) { if (!menuItem.itemId) return 0; - return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 1); + // Strings 41-45 are menu labels, those must be handled uncompressed! + if (menuItem.itemId >= 41 && menuItem.itemId <= 45) + return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 0); + else + return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 1); } const char *GUI_HoF::getMenuItemLabel(const MenuItem &menuItem) { diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index 43c1247f68..c3258b0882 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -31,6 +31,7 @@ #include "kyra/sound.h" #include "kyra/gui_lok.h" #include "kyra/timer.h" +#include "kyra/util.h" #include "common/config-manager.h" #include "common/savefile.h" @@ -538,6 +539,9 @@ void GUI_LoK::setupSavegames(Menu &menu, int num) { if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header))) { strncpy(savenames[i], header.description.c_str(), ARRAYSIZE(savenames[0])); savenames[i][34] = 0; + + Util::convertISOToDOS(savenames[i]); + menu.item[i].itemString = savenames[i]; menu.item[i].enabled = 1; menu.item[i].saveSlot = _saveSlots[i + _savegameOffset]; @@ -654,9 +658,12 @@ void GUI_LoK::updateSavegameString() { if (_keyPressed.keycode) { length = strlen(_savegameName); - if (_keyPressed.ascii > 31 && _keyPressed.ascii < 127) { + char inputKey = _keyPressed.ascii; + Util::convertISOToDOS(inputKey); + + if ((uint8)inputKey > 31 && (uint8)inputKey < 226) { if (length < ARRAYSIZE(_savegameName)-1) { - _savegameName[length] = _keyPressed.ascii; + _savegameName[length] = inputKey; _savegameName[length+1] = 0; redrawTextfield(); } @@ -715,6 +722,8 @@ int GUI_LoK::saveGame(Button *button) { if (_savegameOffset == 0 && _vm->_gameToLoad == 0) _vm->_gameToLoad = getNextSavegameSlot(); if (_vm->_gameToLoad > 0) { + Util::convertDOSToISO(_savegameName); + Graphics::Surface thumb; createScreenThumbnail(thumb); _vm->saveGameState(_vm->_gameToLoad, _savegameName, &thumb); diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index ec2b2d9aac..e5c8637fb5 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -27,6 +27,7 @@ #include "kyra/kyra_v2.h" #include "kyra/screen_v2.h" #include "kyra/text.h" +#include "kyra/util.h" #include "common/savefile.h" @@ -455,8 +456,11 @@ void GUI_v2::setupSavegameNames(Menu &menu, int num) { Common::InSaveFile *in; for (int i = startSlot; i < num && uint(_savegameOffset + i) < _saveSlots.size(); ++i) { if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header)) != 0) { - strncpy(getTableString(menu.item[i].itemId), header.description.c_str(), 80); - getTableString(menu.item[i].itemId)[79] = 0; + char *s = getTableString(menu.item[i].itemId); + strncpy(s, header.description.c_str(), 80); + s[79] = 0; + Util::convertISOToDOS(s); + menu.item[i].saveSlot = _saveSlots[i + _savegameOffset]; menu.item[i].enabled = true; delete in; @@ -621,6 +625,7 @@ int GUI_v2::saveMenu(Button *caller) { Graphics::Surface thumb; createScreenThumbnail(thumb); + Util::convertDOSToISO(_saveDescription); _vm->saveGameState(_saveSlot, _saveDescription, &thumb); thumb.free(); @@ -751,6 +756,10 @@ const char *GUI_v2::nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8 while (running && !_vm->shouldQuit()) { checkTextfieldInput(); processHighlights(_savenameMenu); + + char inputKey = _keyPressed.ascii; + Util::convertISOToDOS(inputKey); + if (_keyPressed.keycode == Common::KEYCODE_RETURN || _keyPressed.keycode == Common::KEYCODE_KP_ENTER || _finishNameInput) { if (checkSavegameDescription(buffer, curPos)) { buffer[curPos] = 0; @@ -768,12 +777,12 @@ const char *GUI_v2::nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8 drawTextfieldBlock(x2, y2, c3); _screen->updateScreen(); _lastScreenUpdate = _vm->_system->getMillis(); - } else if (_keyPressed.ascii > 31 && _keyPressed.ascii < 127 && curPos < bufferSize) { - if (x2 + getCharWidth(_keyPressed.ascii) + 7 < 0x11F) { - buffer[curPos] = _keyPressed.ascii; + } else if ((uint8)inputKey > 31 && (uint8)inputKey < 226 && curPos < bufferSize) { + if (x2 + getCharWidth(inputKey) + 7 < 0x11F) { + buffer[curPos] = inputKey; const char text[2] = { buffer[curPos], 0 }; _text->printText(text, x2, y2, c1, c2, c2); - x2 += getCharWidth(_keyPressed.ascii); + x2 += getCharWidth(inputKey); drawTextfieldBlock(x2, y2, c3); ++curPos; _screen->updateScreen(); |