diff options
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/predictive.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index 731384b5c7..87849af906 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -114,7 +114,7 @@ bool AgiEngine::predictiveDialog(void) { int bx[17], by[17]; String prefix = ""; char temp[MAXWORDLEN + 1]; - + AgiBlock tmpwindow; // FIXME: Move this to a more appropriate place. initAsciiToNumTable(); @@ -146,6 +146,11 @@ bool AgiEngine::predictiveDialog(void) { return false; } + // show the predictive dialog. + // if another window is already in display, save its state into tmpwindow + tmpwindow.active = false; + if (_game.window.active) + memcpy(&tmpwindow, &(_game.window), sizeof(AgiBlock)); drawWindow(50, 40, 269, 159); _gfx->drawRectangle(62, 54, 249, 66, MSG_BOX_TEXT); _gfx->flushBlock(62, 54, 249, 66); @@ -310,7 +315,17 @@ bool AgiEngine::predictiveDialog(void) { _predictiveResult[prefix.size() + _currentCode.size() + 1] = 0; getout: - closeWindow(); + // if another window was shown, bring it up again + if (!tmpwindow.active) + closeWindow(); + else { + _gfx->restoreBlock(_game.window.x1, _game.window.y1, + _game.window.x2, _game.window.y2, _game.window.buffer); + + free(_game.window.buffer); + memcpy(&(_game.window), &tmpwindow, sizeof(AgiBlock)); + _gfx->doUpdate(); + } return rc; } |