From 2ef3f5e6957ce072f9bb5df0fe3f65da578b836c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 8 Jul 2012 15:58:50 +0300 Subject: 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 --- engines/sci/engine/kgraphics.cpp | 6 ++++-- engines/sci/engine/klists.cpp | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index ec8e0dbf1b..5b483eb4a2 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -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)); } diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index 15d18eb4bb..342fa95eda 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -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; } -- cgit v1.2.3