aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/keyboard.cpp
diff options
context:
space:
mode:
authorOleksiy Kurochko2012-02-22 17:15:02 +0200
committerEugene Sandulenko2012-03-25 12:21:38 +0300
commitec32ccb6d640439b71e154c4d48daeb8bd10ff92 (patch)
tree64f2738f78efd250b11354d0d6fa8e8bc1cb0314 /engines/agi/keyboard.cpp
parent3b57dc916460537406f2ca60e1a3edb0d156bdea (diff)
downloadscummvm-rg350-ec32ccb6d640439b71e154c4d48daeb8bd10ff92.tar.gz
scummvm-rg350-ec32ccb6d640439b71e154c4d48daeb8bd10ff92.tar.bz2
scummvm-rg350-ec32ccb6d640439b71e154c4d48daeb8bd10ff92.zip
GUI: Move predictive dialog to common gui
Diffstat (limited to 'engines/agi/keyboard.cpp')
-rw-r--r--engines/agi/keyboard.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index a7f15c16fb..b7e52f4dc3 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -133,6 +133,19 @@ int AgiEngine::handleController(int key) {
if (key == BUTTON_LEFT &&
(int)_mouse.y >= _game.lineUserInput * CHAR_LINES &&
(int)_mouse.y <= (_game.lineUserInput + 1) * CHAR_LINES) {
+ GUI::PredictiveDialog _predictiveDialog;
+ _predictiveDialog.runModal();
+ strcpy(_predictiveResult, _predictiveDialog.getResult());
+ if (strcmp(_predictiveResult, "")) {
+ if (_game.inputMode == INPUT_NONE) {
+ for (int n = 0; _predictiveResult[n]; n++)
+ keyEnqueue(_predictiveResult[n]);
+ } else {
+ strcpy((char *)_game.inputBuffer, _predictiveResult);
+ handleKeys(KEY_ENTER);
+ }
+ }
+ /*
if (predictiveDialog()) {
if (_game.inputMode == INPUT_NONE) {
for (int n = 0; _predictiveResult[n]; n++)
@@ -142,6 +155,7 @@ int AgiEngine::handleController(int key) {
handleKeys(KEY_ENTER);
}
}
+ */
return true;
}
@@ -217,6 +231,17 @@ void AgiEngine::handleGetstring(int key) {
case BUTTON_LEFT:
if ((int)_mouse.y >= _stringdata.y * CHAR_LINES &&
(int)_mouse.y <= (_stringdata.y + 1) * CHAR_LINES) {
+ GUI::PredictiveDialog _predictiveDialog;
+ _predictiveDialog.runModal();
+ strcpy(_predictiveResult, _predictiveDialog.getResult());
+ if (strcmp(_predictiveResult, "")) {
+ strcpy(_game.strings[_stringdata.str], _predictiveResult);
+ newInputMode(INPUT_NORMAL);
+ _gfx->printCharacter(_stringdata.x + strlen(_game.strings[_stringdata.str]) + 1,
+ _stringdata.y, ' ', _game.colorFg, _game.colorBg);
+ return;
+ }
+ /*
if (predictiveDialog()) {
strcpy(_game.strings[_stringdata.str], _predictiveResult);
newInputMode(INPUT_NORMAL);
@@ -224,6 +249,7 @@ void AgiEngine::handleGetstring(int key) {
_stringdata.y, ' ', _game.colorFg, _game.colorBg);
return;
}
+ */
}
break;
case KEY_ENTER: