SCI: Update the virtual file selected in the QFG4 character import screen

This makes the character import screen in QFG4 functional, as the virtual
file index was never updated
This commit is contained in:
Filippos Karapetis 2012-07-08 15:58:50 +03:00
parent 4c43d6d85d
commit 2ef3f5e695
2 changed files with 9 additions and 2 deletions

View File

@ -950,8 +950,8 @@ reg_t kDrawControl(EngineState *s, int argc, reg_t *argv) {
}
}
if (objName == "savedHeros") {
// Import of QfG character files dialog is shown
// display additional popup information before letting user use it
// Import of QfG character files dialog is shown.
// display additional popup information before letting user use it.
reg_t changeDirButton = s->_segMan->findObjectByName("changeDirItem");
if (!changeDirButton.isNull()) {
// check if checkDirButton is still enabled, in that case we are called the first time during that room
@ -964,6 +964,8 @@ reg_t kDrawControl(EngineState *s, int argc, reg_t *argv) {
"for Quest for Glory 2. Example: 'qfg2-thief.sav'.");
}
}
// For the SCI32 version of this, check kListAt().
s->_chosenQfGImportItem = readSelectorValue(s->_segMan, controlObject, SELECTOR(mark));
}

View File

@ -506,6 +506,11 @@ reg_t kListAt(EngineState *s, int argc, reg_t *argv) {
curIndex++;
}
// Update the virtual file selected in the character import screen of QFG4.
// For the SCI0-SCI1.1 version of this, check kDrawControl().
if (g_sci->inQfGImportRoom() && !strcmp(s->_segMan->getObjectName(curObject), "SelectorDText"))
s->_chosenQfGImportItem = listIndex;
return curObject;
}