From 71f6a7e8553f722926ad9277ca870b1f95b482b3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 10 Apr 2008 08:27:09 +0000 Subject: Allow the predictive dialog to be shown when ego cannot be moved (i.e. when _game.playerControl is 0), since in those cases it is possible to enter text in the input area. Should fix bugs #1935844 - "PQ1: Predictive Text does not load" and #1936374 - "LSL1: No predictive input at age verification page" svn-id: r31462 --- engines/agi/agi.cpp | 2 +- engines/agi/keyboard.cpp | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 0a5ef71f0e..58d6eba8cf 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -69,7 +69,7 @@ void AgiEngine::processEvents() { case Common::EVENT_PREDICTIVE_DIALOG: if (_predictiveDialogRunning) break; - if (_game.playerControl && predictiveDialog()) { + if (predictiveDialog()) { if (_game.inputMode == INPUT_NORMAL) { strcpy((char *)_game.inputBuffer, _predictiveResult); handleKeys(KEY_ENTER); diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index c4532941d6..aa917b6e90 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -135,6 +135,17 @@ int AgiEngine::handleController(int key) { } } + // Show predictive dialog if the user clicks on input area + if (key == BUTTON_LEFT && + (int)g_mouse.y >= _game.lineUserInput * CHAR_LINES && + (int)g_mouse.y <= (_game.lineUserInput + 1) * CHAR_LINES) { + if (predictiveDialog()) { + strcpy((char *)_game.inputBuffer, _predictiveResult); + handleKeys(KEY_ENTER); + } + return true; + } + if (_game.playerControl) { int d = 0; @@ -167,16 +178,6 @@ int AgiEngine::handleController(int key) { } } - if (key == BUTTON_LEFT && - (int)g_mouse.y >= _game.lineUserInput * CHAR_LINES && - (int)g_mouse.y <= (_game.lineUserInput + 1) * CHAR_LINES) { - if (predictiveDialog()) { - strcpy((char *)_game.inputBuffer, _predictiveResult); - handleKeys(KEY_ENTER); - } - return true; - } - if (!(getFeatures() & GF_AGIMOUSE)) { /* Handle mouse button events */ if (key == BUTTON_LEFT) { -- cgit v1.2.3