diff options
author | Matthew Hoops | 2007-09-20 20:50:38 +0000 |
---|---|---|
committer | Matthew Hoops | 2007-09-20 20:50:38 +0000 |
commit | f3175861ba23318520a9044d8c35c33a083847cc (patch) | |
tree | 38b5ba0fb889b8d4a436d46bdb0880616e92adb8 /engines/scumm/dialogs.cpp | |
parent | 14b89bcf466acc2c4c9267f4986082c7dcf7ac1f (diff) | |
download | scummvm-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.cpp | 26 |
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 |