aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/dialogs.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2007-09-20 20:50:38 +0000
committerMatthew Hoops2007-09-20 20:50:38 +0000
commitf3175861ba23318520a9044d8c35c33a083847cc (patch)
tree38b5ba0fb889b8d4a436d46bdb0880616e92adb8 /engines/scumm/dialogs.cpp
parent14b89bcf466acc2c4c9267f4986082c7dcf7ac1f (diff)
downloadscummvm-rg350-f3175861ba23318520a9044d8c35c33a083847cc.tar.gz
scummvm-rg350-f3175861ba23318520a9044d8c35c33a083847cc.tar.bz2
scummvm-rg350-f3175861ba23318520a9044d8c35c33a083847cc.zip
implement o72_debugInput (with some help from Kirben)
svn-id: r28988
Diffstat (limited to 'engines/scumm/dialogs.cpp')
-rw-r--r--engines/scumm/dialogs.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 828c665c5f..a2b68a5f8d 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -960,4 +960,30 @@ void Indy3IQPointsDialog::handleKeyDown(Common::KeyState state) {
ScummDialog::handleKeyDown(state);
}
+DebugInputDialog::DebugInputDialog(ScummEngine *scumm, char* text)
+ : InfoDialog(scumm, text) {
+ mainText = text;
+ done = 0;
+}
+
+void DebugInputDialog::handleKeyDown(Common::KeyState state) {
+ if (state.keycode == Common::KEYCODE_BACKSPACE && buffer.size() > 0) {
+ buffer.deleteLastChar();
+ Common::String total = mainText + ' ' + buffer;
+ setInfoText(total);
+ draw();
+ reflowLayout();
+ } else if (state.keycode == Common::KEYCODE_RETURN) {
+ done = 1;
+ close();
+ return;
+ } else if ((state.ascii >= '0' && state.ascii <= '9') || (state.ascii >= 'A' && state.ascii <= 'Z') || (state.ascii >= 'a' && state.ascii <= 'z') || state.ascii == '.' || state.ascii == ' ') {
+ buffer += state.ascii;
+ Common::String total = mainText + ' ' + buffer;
+ draw();
+ reflowLayout();
+ setInfoText(total);
+ }
+}
+
} // End of namespace Scumm