aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2007-05-30 16:40:11 +0000
committerMax Horn2007-05-30 16:40:11 +0000
commitc9bee38839c83282b8b55890901e1f4076535c57 (patch)
tree6c28f19764df6a08e4b488c20cf7b34d0eeed0ab /engines/scumm
parent5aeb9d8b3e902eeedaa6a85f1f38afff06f85ac9 (diff)
downloadscummvm-rg350-c9bee38839c83282b8b55890901e1f4076535c57.tar.gz
scummvm-rg350-c9bee38839c83282b8b55890901e1f4076535c57.tar.bz2
scummvm-rg350-c9bee38839c83282b8b55890901e1f4076535c57.zip
Modified version of patch #1727045 INDY3: IQ Points Dialog
svn-id: r27012
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/dialogs.cpp9
-rw-r--r--engines/scumm/dialogs.h8
-rw-r--r--engines/scumm/input.cpp20
3 files changed, 37 insertions, 0 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index a95aeacdad..13babc181f 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -910,7 +910,16 @@ void ValueDisplayDialog::open() {
_timer = getMillis() + kDisplayDelay;
}
+Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)
+ : InfoDialog(scumm, text) {
+}
+void Indy3IQPointsDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
+ if (ascii == 'i')
+ close();
+ else
+ ScummDialog::handleKeyDown(ascii, keycode, modifiers);
+}
} // End of namespace Scumm
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index bfcdaf2960..03e8783b3d 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -232,6 +232,14 @@ protected:
uint32 _timer;
};
+
+//The Indy IQ dialog
+class Indy3IQPointsDialog : public InfoDialog {
+public:
+ Indy3IQPointsDialog(ScummEngine *scumm, char* text);
+ virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
+};
+
} // End of namespace Scumm
#endif
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index d31d3afd85..eed52f5154 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -496,6 +496,26 @@ void ScummEngine_v3::processKeyboard(int lastKeyHit) {
// Fall back to default behavior
ScummEngine::processKeyboard(lastKeyHit);
}
+
+ // i brings up an IQ dialog in Indy3
+
+ if (lastKeyHit == 'i' && _game.id == GID_INDY3) {
+ // SCUMM var 244 is the episode score
+ // and var 245 is the series score
+ char text[50];
+
+ // FIXME: Currently, the series score does not work properly
+ // This workaround just sets it equal to the episode score
+ // However, at the end of the game, it does show the episode
+ // score by itself
+ int a = _scummVars[245];
+ if (!a)
+ a = _scummVars[244];
+
+ sprintf(text, "IQ Points: Episode = %d, Series = %d", _scummVars[244], a);
+ Indy3IQPointsDialog indy3IQPointsDialog(this, text);
+ runDialog(indy3IQPointsDialog);
+ }
}
void ScummEngine::processKeyboard(int lastKeyHit) {