Skip to content

Commit

Permalink
SHERLOCK: Fix talk dialog buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Apr 25, 2015
1 parent 3cf1afb commit 55404f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions engines/sherlock/talk.cpp
Expand Up @@ -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, "~");
Expand Down Expand Up @@ -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;

Expand All @@ -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);
}
}
Expand Down
12 changes: 6 additions & 6 deletions engines/sherlock/user_interface.cpp
Expand Up @@ -1791,23 +1791,23 @@ 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,
SHERLOCK_SCREEN_HEIGHT - 1), INV_BACKGROUND);
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);
Expand Down

0 comments on commit 55404f0

Please sign in to comment.