diff options
author | Alyssa Milburn | 2011-07-07 09:24:10 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-07-07 09:24:10 +0200 |
commit | 66e81d633f987310f12038147ae01b8ce4f640f7 (patch) | |
tree | 6035a7124789c3e6cdff5f603e9933529b7efdc7 /engines/kyra/gui_lok.cpp | |
parent | affaa1f4d6cf5f27f654029133b1aec7b9eca4b5 (diff) | |
parent | 72da8ef5adf82d8a65da299207f30af5058ca8a9 (diff) | |
download | scummvm-rg350-66e81d633f987310f12038147ae01b8ce4f640f7.tar.gz scummvm-rg350-66e81d633f987310f12038147ae01b8ce4f640f7.tar.bz2 scummvm-rg350-66e81d633f987310f12038147ae01b8ce4f640f7.zip |
Merge remote-tracking branch 'origin/master' into soltys_wip2
Diffstat (limited to 'engines/kyra/gui_lok.cpp')
-rw-r--r-- | engines/kyra/gui_lok.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index eac82ec2c5..eba2f8f279 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -576,6 +576,15 @@ void GUI_LoK::setupSavegames(Menu &menu, int num) { if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header))) { Common::strlcpy(_savegameNames[i], header.description.c_str(), ARRAYSIZE(_savegameNames[0])); + // Trim long GMM save descriptions to fit our save slots + _screen->_charWidth = -2; + int fC = _screen->getTextWidth(_savegameNames[i]); + while (_savegameNames[i][0] && (fC > 240 )) { + _savegameNames[i][strlen(_savegameNames[i]) - 1] = 0; + fC = _screen->getTextWidth(_savegameNames[i]); + } + _screen->_charWidth = 0; + Util::convertISOToDOS(_savegameNames[i]); menu.item[i].itemString = _savegameNames[i]; @@ -693,12 +702,15 @@ void GUI_LoK::updateSavegameString() { if (_keyPressed.keycode) { length = strlen(_savegameName); + _screen->_charWidth = -2; + int width = _screen->getTextWidth(_savegameName) + 7; + _screen->_charWidth = 0; char inputKey = _keyPressed.ascii; Util::convertISOToDOS(inputKey); if ((uint8)inputKey > 31 && (uint8)inputKey < (_vm->gameFlags().lang == Common::JA_JPN ? 128 : 226)) { - if (length < ARRAYSIZE(_savegameName)-1) { + if ((length < ARRAYSIZE(_savegameName)-1) && (width <= 240)) { _savegameName[length] = inputKey; _savegameName[length+1] = 0; redrawTextfield(); |