diff options
author | Paul Gilbert | 2015-04-24 20:59:30 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-04-24 20:59:30 -0500 |
commit | 55404f01d60fb4bb454ceb8e9289debbadda8470 (patch) | |
tree | dded3042af9a11ab19236d0dba244f159fc533f2 | |
parent | 3cf1afb459e29747461e21ba7db971a9c72fc9ff (diff) | |
download | scummvm-rg350-55404f01d60fb4bb454ceb8e9289debbadda8470.tar.gz scummvm-rg350-55404f01d60fb4bb454ceb8e9289debbadda8470.tar.bz2 scummvm-rg350-55404f01d60fb4bb454ceb8e9289debbadda8470.zip |
SHERLOCK: Fix talk dialog buttons
-rw-r--r-- | engines/sherlock/talk.cpp | 8 | ||||
-rw-r--r-- | engines/sherlock/user_interface.cpp | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 9be2b035d4..2ad70dabed 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -698,13 +698,13 @@ bool Talk::displayTalk(bool slamIt) { } if (_talkIndex) { - for (uint idx = 0; idx < _statements.size(); ++idx) { + for (int idx = 0; idx < _talkIndex && !_moreTalkUp; ++idx) { if (_statements[idx]._talkMap != -1) _moreTalkUp = true; } } - // Display the up arrow if the first option is scrolled off-screen + // Display the up arrow and enable Up button if the first option is scrolled off-screen if (_moreTalkUp) { if (slamIt) { screen.print(Common::Point(5, CONTROLS_Y + 13), INV_FOREGROUND, "~"); @@ -747,7 +747,7 @@ bool Talk::displayTalk(bool slamIt) { } } - // Display the down arrow if there are more statements available + // Display the down arrow and enable down button if there are more statements available down off-screen if (lineY == -1 || lineY == SHERLOCK_SCREEN_HEIGHT) { _moreTalkDown = true; @@ -763,7 +763,7 @@ bool Talk::displayTalk(bool slamIt) { screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, true, "Down"); screen.vgaBar(Common::Rect(5, 189, 16, 199), INV_BACKGROUND); } else { - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_FOREGROUND, false, "Down"); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, false, "Down"); screen._backBuffer1.fillRect(Common::Rect(5, 189, 16, 199), INV_BACKGROUND); } } diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp index 12af04d608..176b1bc42b 100644 --- a/engines/sherlock/user_interface.cpp +++ b/engines/sherlock/user_interface.cpp @@ -1791,14 +1791,14 @@ void UserInterface::doTalkControl() { } if (events._released || _keyboardInput) { - if (_endKeyActive && ((mousePos.x > 99 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 10) - && talk._moreTalkUp && events._released) || _key == 'E')) { + if (((Common::Rect(99, CONTROLS_Y, 138, CONTROLS_Y + 10).contains(mousePos) && events._released) + || _key == 'E') && _endKeyActive) { talk.freeTalkVars(); talk.pullSequence(); banishWindow(); _windowBounds.top = CONTROLS_Y1; - } else if ((mousePos.x > 140 && mousePos.x < 179 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 10) - && talk._moreTalkUp && events._released) || (talk._moreTalkUp && _key == 'U')) { + } else if (((Common::Rect(140, CONTROLS_Y, 179, CONTROLS_Y + 10).contains(mousePos) && events._released) + || _key == 'U') && talk._moreTalkUp) { while (talk._statements[--talk._talkIndex]._talkMap == -1) ; screen._backBuffer1.fillRect(Common::Rect(5, CONTROLS_Y + 11, SHERLOCK_SCREEN_WIDTH - 2, @@ -1806,8 +1806,8 @@ void UserInterface::doTalkControl() { talk.displayTalk(false); screen.slamRect(Common::Rect(5, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH - 5, SHERLOCK_SCREEN_HEIGHT - 2)); - } else if ((mousePos.x > 181 && mousePos.x < 220 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 10) - && talk._moreTalkDown && events._released) || (talk._moreTalkDown && _key == 'D')) { + } else if (((Common::Rect(181, CONTROLS_Y, 220, CONTROLS_Y + 10).contains(mousePos) && events._released) + || _key == 'D') && talk._moreTalkDown) { do { ++talk._talkIndex; } while (talk._talkIndex < (int)talk._statements.size() && talk._statements[talk._talkIndex]._talkMap == -1); |