diff options
author | uruk | 2013-09-30 12:43:39 +0200 |
---|---|---|
committer | uruk | 2013-09-30 12:44:06 +0200 |
commit | 53f6c2f693755014b0dfe1652e85eeab9cfc18a9 (patch) | |
tree | fc3bf88f220b23b191e1437b5c2509c7a32add73 /engines | |
parent | c2da192e7f9bf836e3abd9e87ab155be9a490770 (diff) | |
download | scummvm-rg350-53f6c2f693755014b0dfe1652e85eeab9cfc18a9.tar.gz scummvm-rg350-53f6c2f693755014b0dfe1652e85eeab9cfc18a9.tar.bz2 scummvm-rg350-53f6c2f693755014b0dfe1652e85eeab9cfc18a9.zip |
AVALANCHE: Implement keyboard control in Dialogs::scrollModeDialogue().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/dialogs.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index 9868c772e1..d991ca7711 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -176,9 +176,6 @@ void Dialogs::scrollModeNormal() { } void Dialogs::scrollModeDialogue() { - warning("STUB: Scrolls::scrollModeDialogue()"); - // It should work with keypresses too! TODO: Implement it! - _vm->_graphics->loadMouse(kCurHand); _vm->_graphics->saveScreen(); @@ -189,13 +186,25 @@ void Dialogs::scrollModeDialogue() { _vm->_graphics->refreshScreen(); _vm->getEvent(event); + Common::Point cursorPos = _vm->getMousePos(); cursorPos.y /= 2; - if (_vm->shouldQuit() || (event.type == Common::EVENT_LBUTTONUP)) { - if ((cursorPos.x >= _shadowBoxX - 65) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX - 5) && (cursorPos.y <= _shadowBoxY - 10)) { + + char inChar = 0; + if (event.type == Common::EVENT_KEYDOWN) { + inChar = (char)event.kbd.ascii; + Common::String temp(inChar); + temp.toUppercase(); + inChar = temp[0]; + } + + if (_vm->shouldQuit() || (event.type == Common::EVENT_LBUTTONUP) || (event.type == Common::EVENT_KEYDOWN)) { + if (((cursorPos.x >= _shadowBoxX - 65) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX - 5) && (cursorPos.y <= _shadowBoxY - 10)) + || (inChar == 'Y') || (inChar == 'J') || (inChar == 'O')) { // Yes, Ja, Oui _scReturn = true; break; - } else if ((cursorPos.x >= _shadowBoxX + 5) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX + 65) && (cursorPos.y <= _shadowBoxY - 10)) { + } else if (((cursorPos.x >= _shadowBoxX + 5) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX + 65) && (cursorPos.y <= _shadowBoxY - 10)) + || (inChar == 'N')){ // No, Non, Nein _scReturn = false; break; } |