diff options
author | Paul Gilbert | 2016-05-01 09:46:25 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:37:59 -0400 |
commit | 21f98fff46e48e79d3e977d4f20edf90022a825a (patch) | |
tree | eda28f9980211f0ba47be754d5def1cf168655a8 /engines/titanic/pet_control | |
parent | 6b97394ebd577326c8818cfa02b08c119beab8c0 (diff) | |
download | scummvm-rg350-21f98fff46e48e79d3e977d4f20edf90022a825a.tar.gz scummvm-rg350-21f98fff46e48e79d3e977d4f20edf90022a825a.tar.bz2 scummvm-rg350-21f98fff46e48e79d3e977d4f20edf90022a825a.zip |
TITANIC: Fix cursor and entering text in PET Conversations area
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r-- | engines/titanic/pet_control/pet_conversations.cpp | 15 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_text.cpp | 2 |
2 files changed, 6 insertions, 11 deletions
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp index d4298dada1..eb2f9716b6 100644 --- a/engines/titanic/pet_control/pet_conversations.cpp +++ b/engines/titanic/pet_control/pet_conversations.cpp @@ -465,17 +465,12 @@ bool CPetConversations::handleKey(const Common::KeyState &keyState) { case Common::KEYCODE_KP1: scrollToBottom(); break; - case Common::KEYCODE_BACKSPACE: - // Erase key in text input - _textInput.handleKey((char)Common::KEYCODE_BACKSPACE); - case Common::KEYCODE_RETURN: - case Common::KEYCODE_KP_ENTER: - // Text line finished - textLineEntered(_textInput.getText()); - return true; default: - if (keyState.ascii >= 32 && keyState.ascii) - _textInput.handleKey(keyState.ascii); + if (keyState.ascii > 0 && keyState.ascii) { + if (_textInput.handleKey(keyState.ascii)) + // Text line finished, so process line + textLineEntered(_textInput.getText()); + } return true; } diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp index 1065e6f825..1d2740249f 100644 --- a/engines/titanic/pet_control/pet_text.cpp +++ b/engines/titanic/pet_control/pet_text.cpp @@ -192,7 +192,7 @@ void CPetText::resize(uint count) { CString CPetText::getText() const { CString result = ""; - for (int idx = 0; idx < _lineCount; ++idx) + for (int idx = 0; idx <= _lineCount; ++idx) result += _array[idx]._line; return result; |