From ec4a240b502f7be2c67582382b4af4f0451aa035 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 2 Aug 2007 01:56:45 +0000 Subject: The help screens in the IHNM demo are shown a bit more correctly now, though they're still buggy svn-id: r28399 --- engines/saga/scene.cpp | 1 + engines/saga/script.h | 1 + engines/saga/sfuncs.cpp | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 4510bcc24c..3ae0e9c950 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -1424,6 +1424,7 @@ void Scene::showPsychicProfile(const char *text) { textEntry.flags = (FontEffectFlags)(kFontCentered); textEntry.text = text; + _vm->_scene->_textList.clear(); TextListEntry *_psychicProfileTextEntry = _vm->_scene->_textList.addEntry(textEntry); event.type = kEvTOneshot; diff --git a/engines/saga/script.h b/engines/saga/script.h index 74f26142bd..1c05182647 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -444,6 +444,7 @@ private: int _stickyVerb; int _leftButtonVerb; int _rightButtonVerb; + int _ihnmDemoCurrentY; public: uint16 _pendingObject[2]; diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 8a5b52fd25..0efbef0ca2 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -2001,6 +2001,7 @@ void Script::sfScriptEndVideo(SCRIPTFUNC_PARAMS) { void Script::sfShowIHNMDemoHelp(SCRIPTFUNC_PARAMS) { thread->wait(kWaitTypePlacard); + _ihnmDemoCurrentY = 0; _vm->_scene->showPsychicProfile(NULL); } @@ -2011,9 +2012,6 @@ void Script::sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS) { stringId = thread->pop(); - // FIXME: This is called multiple times in a row, one for each page of the help screens. We should wait - // somehow before showing the next page - textHeight = _vm->_font->getHeight(kKnownFontVerb, thread->_strings->getString(stringId), 226, kFontCentered); textEntry.knownColor = kKnownColorBlack; @@ -2021,11 +2019,14 @@ void Script::sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS) { textEntry.rect.left = 245; textEntry.rect.setHeight(210 + 76); textEntry.rect.setWidth(226); - textEntry.rect.top = 210 - textHeight; + textEntry.rect.top = 76 + _ihnmDemoCurrentY; textEntry.font = kKnownFontVerb; textEntry.flags = (FontEffectFlags)(kFontCentered); textEntry.text = thread->_strings->getString(stringId); + if (_ihnmDemoCurrentY == 0) + _vm->_scene->_textList.clear(); + TextListEntry *_psychicProfileTextEntry = _vm->_scene->_textList.addEntry(textEntry); event.type = kEvTOneshot; @@ -2034,16 +2035,22 @@ void Script::sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS) { event.data = _psychicProfileTextEntry; _vm->_events->queue(&event); + + _ihnmDemoCurrentY += 10; } void Script::sfClearIHNMDemoHelpText(SCRIPTFUNC_PARAMS) { thread->wait(kWaitTypePlacard); + warning("TODO: sfClearIHNMDemoHelpText"); + // This is called a while after the psychic profile is // opened in the IHNM demo, to flip through the help system pages - _vm->_scene->clearPsychicProfile(); + _vm->_scene->clearPlacard(); // FIXME: The demo uses mode 8 when changing pages //_vm->_interface->setMode(8); + _vm->_interface->setMode(7); + _ihnmDemoCurrentY = 0; } void Script::sfVstopFX(SCRIPTFUNC_PARAMS) { -- cgit v1.2.3