aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorKostas Nakos2007-06-02 06:53:52 +0000
committerKostas Nakos2007-06-02 06:53:52 +0000
commit26971aa6ab5109eaa68befe0973f0d8b22474c13 (patch)
tree3d479072b8168484907e385f2f837551df0f03e3 /engines/agi
parenta7fb55c028dd71cf79baa9402337912ae6252a34 (diff)
downloadscummvm-rg350-26971aa6ab5109eaa68befe0973f0d8b22474c13.tar.gz
scummvm-rg350-26971aa6ab5109eaa68befe0973f0d8b22474c13.tar.bz2
scummvm-rg350-26971aa6ab5109eaa68befe0973f0d8b22474c13.zip
kill misplaced cursor, refresh only when necessary, add some (cheap) visual feedback on keypress
svn-id: r27046
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/predictive.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 5e086de2bb..2c13941d6e 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -110,7 +110,7 @@ void AgiEngine::insertSearchNode(const char *word) {
}
bool AgiEngine::predictiveDialog(void) {
- int key, active = 0;
+ int key = 0, active = -1, lastactive = -1;
bool rc = false;
int x;
int y;
@@ -158,8 +158,6 @@ bool AgiEngine::predictiveDialog(void) {
_gfx->drawRectangle(62, 54, 249, 66, MSG_BOX_TEXT);
_gfx->flushBlock(62, 54, 249, 66);
- _gfx->printCharacter(3, 11, _game.cursorChar, MSG_BOX_COLOUR, MSG_BOX_TEXT);
-
bx[15] = 73; // Zero/space
by[15] = 120;
bx[9] = 120; // next
@@ -234,6 +232,14 @@ bool AgiEngine::predictiveDialog(void) {
printText(temp, 0, 8, 7, MAXWORDLEN, 15, 0);
_gfx->flushBlock(62, 54, 249, 66);
}
+
+ if (active >= 0 && key != 9) {
+ active = -1;
+ needRefresh = true;
+ } else
+ needRefresh = false;
+
+ _gfx->doUpdate();
}
_gfx->pollTimer(); /* msdos driver -> does nothing */
@@ -249,7 +255,7 @@ bool AgiEngine::predictiveDialog(void) {
for (int i = 0; buttons[i]; i++) {
if (_gfx->testButton(bx[i], by[i], buttons[i])) {
needRefresh = true;
- active = i;
+ lastactive = active = i;
if (active == 15 && mode != kModeNum) { // Space
strncpy(temp, _currentWord.c_str(), _currentCode.size());
@@ -304,12 +310,11 @@ bool AgiEngine::predictiveDialog(void) {
break;
case 0x09: /* Tab */
debugC(3, kDebugLevelText, "Focus change");
- active++;
+ lastactive = active = lastactive + 1;
active %= ARRAYSIZE(buttons) - 1;
needRefresh = true;
break;
}
- _gfx->doUpdate();
}
press: