Skip to content

Commit

Permalink
SHERLOCK: SS: button code cleanup
Browse files Browse the repository at this point in the history
Change the default for the optional parameter "textContainsHotkey"
to true, because it's needed almost all of the time.
  • Loading branch information
Martin Kiewitz committed Jan 30, 2016
1 parent 33cedb6 commit 7737f2f
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 173 deletions.
48 changes: 24 additions & 24 deletions engines/sherlock/scalpel/scalpel_inventory.cpp
Expand Up @@ -88,21 +88,21 @@ void ScalpelInventory::drawInventory(InvNewMode mode) {

// Draw the buttons
screen.makeButton(Common::Rect(INVENTORY_POINTS[0][0], CONTROLS_Y1, INVENTORY_POINTS[0][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[0][2], _fixedTextExit, true);
CONTROLS_Y1 + 10), INVENTORY_POINTS[0][2], _fixedTextExit);
screen.makeButton(Common::Rect(INVENTORY_POINTS[1][0], CONTROLS_Y1, INVENTORY_POINTS[1][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[1][2], _fixedTextLook, true);
CONTROLS_Y1 + 10), INVENTORY_POINTS[1][2], _fixedTextLook);
screen.makeButton(Common::Rect(INVENTORY_POINTS[2][0], CONTROLS_Y1, INVENTORY_POINTS[2][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[2][2], _fixedTextUse, true);
CONTROLS_Y1 + 10), INVENTORY_POINTS[2][2], _fixedTextUse);
screen.makeButton(Common::Rect(INVENTORY_POINTS[3][0], CONTROLS_Y1, INVENTORY_POINTS[3][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[3][2], _fixedTextGive, true);
CONTROLS_Y1 + 10), INVENTORY_POINTS[3][2], _fixedTextGive);
screen.makeButton(Common::Rect(INVENTORY_POINTS[4][0], CONTROLS_Y1, INVENTORY_POINTS[4][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[4][2] + 8, "^^"); // 2 arrows pointing to the left
CONTROLS_Y1 + 10), INVENTORY_POINTS[4][2] + 8, "^^", false); // 2 arrows pointing to the left
screen.makeButton(Common::Rect(INVENTORY_POINTS[5][0], CONTROLS_Y1, INVENTORY_POINTS[5][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[5][2] + 4, "^"); // 1 arrow pointing to the left
CONTROLS_Y1 + 10), INVENTORY_POINTS[5][2] + 4, "^", false); // 1 arrow pointing to the left
screen.makeButton(Common::Rect(INVENTORY_POINTS[6][0], CONTROLS_Y1, INVENTORY_POINTS[6][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[6][2] + 4, "_"); // 1 arrow pointing to the right
CONTROLS_Y1 + 10), INVENTORY_POINTS[6][2] + 4, "_", false); // 1 arrow pointing to the right
screen.makeButton(Common::Rect(INVENTORY_POINTS[7][0], CONTROLS_Y1, INVENTORY_POINTS[7][1],
CONTROLS_Y1 + 10), INVENTORY_POINTS[7][2] + 8, "__"); // 2 arrows pointing to the right
CONTROLS_Y1 + 10), INVENTORY_POINTS[7][2] + 8, "__", false); // 2 arrows pointing to the right

if (tempMode == INVENTORY_DONT_DISPLAY)
mode = LOOK_INVENTORY_MODE;
Expand Down Expand Up @@ -142,55 +142,55 @@ void ScalpelInventory::invCommands(bool slamIt) {
if (slamIt) {
screen.buttonPrint(Common::Point(INVENTORY_POINTS[0][2], CONTROLS_Y1),
_invMode == INVMODE_EXIT ? COMMAND_HIGHLIGHTED :COMMAND_FOREGROUND,
true, _fixedTextExit, true);
true, _fixedTextExit);
screen.buttonPrint(Common::Point(INVENTORY_POINTS[1][2], CONTROLS_Y1),
_invMode == INVMODE_LOOK ? COMMAND_HIGHLIGHTED :COMMAND_FOREGROUND,
true, _fixedTextLook, true);
true, _fixedTextLook);
screen.buttonPrint(Common::Point(INVENTORY_POINTS[2][2], CONTROLS_Y1),
_invMode == INVMODE_USE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND,
true, _fixedTextUse, true);
true, _fixedTextUse);
screen.buttonPrint(Common::Point(INVENTORY_POINTS[3][2], CONTROLS_Y1),
_invMode == INVMODE_GIVE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND,
true, _fixedTextGive, true);
true, _fixedTextGive);
screen.print(Common::Point(INVENTORY_POINTS[4][2], CONTROLS_Y1 + 1),
_invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND,
"^^"); // 2 arrows pointing to the left
"^^", false); // 2 arrows pointing to the left
screen.print(Common::Point(INVENTORY_POINTS[5][2], CONTROLS_Y1 + 1),
_invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND,
"^"); // 2 arrows pointing to the left
"^", false); // 2 arrows pointing to the left
screen.print(Common::Point(INVENTORY_POINTS[6][2], CONTROLS_Y1 + 1),
(_holdings - _invIndex <= 6) ? COMMAND_NULL : COMMAND_FOREGROUND,
"_"); // 1 arrow pointing to the right
"_", false); // 1 arrow pointing to the right
screen.print(Common::Point(INVENTORY_POINTS[7][2], CONTROLS_Y1 + 1),
(_holdings - _invIndex <= 6) ? COMMAND_NULL : COMMAND_FOREGROUND,
"__"); // 2 arrows pointing to the right
"__", false); // 2 arrows pointing to the right
if (_invMode != INVMODE_LOOK)
ui.clearInfo();
} else {
screen.buttonPrint(Common::Point(INVENTORY_POINTS[0][2], CONTROLS_Y1),
_invMode == INVMODE_EXIT ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND,
false, _fixedTextExit, true);
false, _fixedTextExit);
screen.buttonPrint(Common::Point(INVENTORY_POINTS[1][2], CONTROLS_Y1),
_invMode == INVMODE_LOOK ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND,
false, _fixedTextLook, true);
false, _fixedTextLook);
screen.buttonPrint(Common::Point(INVENTORY_POINTS[2][2], CONTROLS_Y1),
_invMode == INVMODE_USE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND,
false, _fixedTextUse, true);
false, _fixedTextUse);
screen.buttonPrint(Common::Point(INVENTORY_POINTS[3][2], CONTROLS_Y1),
_invMode == INVMODE_GIVE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND,
false, _fixedTextGive, true);
false, _fixedTextGive);
screen.gPrint(Common::Point(INVENTORY_POINTS[4][2], CONTROLS_Y1),
_invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND,
"^^"); // 2 arrows pointing to the left
"^^", false); // 2 arrows pointing to the left
screen.gPrint(Common::Point(INVENTORY_POINTS[5][2], CONTROLS_Y1),
_invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND,
"^"); // 1 arrow pointing to the left
"^", false); // 1 arrow pointing to the left
screen.gPrint(Common::Point(INVENTORY_POINTS[6][2], CONTROLS_Y1),
(_holdings - _invIndex < 7) ? COMMAND_NULL : COMMAND_FOREGROUND,
"_"); // 1 arrow pointing to the right
"_", false); // 1 arrow pointing to the right
screen.gPrint(Common::Point(INVENTORY_POINTS[7][2], CONTROLS_Y1),
(_holdings - _invIndex < 7) ? COMMAND_NULL : COMMAND_FOREGROUND,
"__"); // 2 arrows pointing to the right
"__", false); // 2 arrows pointing to the right
}
}

Expand Down
86 changes: 38 additions & 48 deletions engines/sherlock/scalpel/scalpel_journal.cpp
Expand Up @@ -182,35 +182,35 @@ void ScalpelJournal::drawFrame() {
// Draw the buttons
screen.makeButton(Common::Rect(JOURNAL_POINTS[0][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[0][1], JOURNAL_BUTTONS_Y + 10),
JOURNAL_POINTS[0][2], _fixedTextExit, true);
JOURNAL_POINTS[0][2], _fixedTextExit);
screen.makeButton(Common::Rect(JOURNAL_POINTS[1][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[1][1], JOURNAL_BUTTONS_Y + 10),
JOURNAL_POINTS[1][2], _fixedTextBack10, true);
JOURNAL_POINTS[1][2], _fixedTextBack10);
screen.makeButton(Common::Rect(JOURNAL_POINTS[2][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[2][1], JOURNAL_BUTTONS_Y + 10),
JOURNAL_POINTS[2][2], _fixedTextUp, true);
JOURNAL_POINTS[2][2], _fixedTextUp);
screen.makeButton(Common::Rect(JOURNAL_POINTS[3][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[3][1], JOURNAL_BUTTONS_Y + 10),
JOURNAL_POINTS[3][2], _fixedTextDown, true);
JOURNAL_POINTS[3][2], _fixedTextDown);
screen.makeButton(Common::Rect(JOURNAL_POINTS[4][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[4][1], JOURNAL_BUTTONS_Y + 10),
JOURNAL_POINTS[4][2], _fixedTextAhead10, true);
JOURNAL_POINTS[4][2], _fixedTextAhead10);
screen.makeButton(Common::Rect(JOURNAL_POINTS[5][0], JOURNAL_BUTTONS_Y + 11,
JOURNAL_POINTS[5][1], JOURNAL_BUTTONS_Y + 21),
JOURNAL_POINTS[5][2], _fixedTextSearch, true);
JOURNAL_POINTS[5][2], _fixedTextSearch);
screen.makeButton(Common::Rect(JOURNAL_POINTS[6][0], JOURNAL_BUTTONS_Y + 11,
JOURNAL_POINTS[6][1], JOURNAL_BUTTONS_Y + 21),
JOURNAL_POINTS[6][2], _fixedTextFirstPage, true);
JOURNAL_POINTS[6][2], _fixedTextFirstPage);
screen.makeButton(Common::Rect(JOURNAL_POINTS[7][0], JOURNAL_BUTTONS_Y + 11,
JOURNAL_POINTS[7][1], JOURNAL_BUTTONS_Y + 21),
JOURNAL_POINTS[7][2], _fixedTextLastPage, true);
JOURNAL_POINTS[7][2], _fixedTextLastPage);

// WORKAROUND: Draw Print Text button as disabled, since we don't support it in ScummVM
screen.makeButton(Common::Rect(JOURNAL_POINTS[8][0], JOURNAL_BUTTONS_Y + 11,
JOURNAL_POINTS[8][1], JOURNAL_BUTTONS_Y + 21),
JOURNAL_POINTS[8][2], _fixedTextPrintText, true);
JOURNAL_POINTS[8][2], _fixedTextPrintText);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11),
COMMAND_NULL, false, _fixedTextPrintText, true);
COMMAND_NULL, false, _fixedTextPrintText);
}

void ScalpelJournal::drawInterface() {
Expand All @@ -235,20 +235,20 @@ void ScalpelJournal::doArrows() {
byte color;

color = (_page > 1) ? COMMAND_FOREGROUND : COMMAND_NULL;
screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextBack10, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextUp, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextBack10);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextUp);

color = _down ? COMMAND_FOREGROUND : COMMAND_NULL;
screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextDown, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextAhead10, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, false, _fixedTextLastPage, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextDown);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), color, false, _fixedTextAhead10);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, false, _fixedTextLastPage);

color = _journal.size() > 0 ? COMMAND_FOREGROUND : COMMAND_NULL;
screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), color, false, _fixedTextSearch, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), COMMAND_NULL, false, _fixedTextPrintText, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), color, false, _fixedTextSearch);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), COMMAND_NULL, false, _fixedTextPrintText);

color = _page > 1 ? COMMAND_FOREGROUND : COMMAND_NULL;
screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, false, _fixedTextFirstPage, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, false, _fixedTextFirstPage);
}

JournalButton ScalpelJournal::getHighlightedButton(const Common::Point &pt) {
Expand Down Expand Up @@ -303,34 +303,34 @@ bool ScalpelJournal::handleEvents(int key) {
if (events._pressed || events._released) {
// Exit button
color = (btn == BTN_EXIT) ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND;
screen.buttonPrint(Common::Point(JOURNAL_POINTS[0][2], JOURNAL_BUTTONS_Y), color, true, _fixedTextExit, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[0][2], JOURNAL_BUTTONS_Y), color, true, _fixedTextExit);

// Back 10 button
if (btn == BTN_BACK10) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextBack10, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextBack10);
} else if (_page > 1) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextBack10, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextBack10);
}

// Up button
if (btn == BTN_UP) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextUp, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextUp);
} else if (_up) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextUp, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextUp);
}

// Down button
if (btn == BTN_DOWN) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextDown, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextDown);
} else if (_down) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextDown, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextDown);
}

// Ahead 10 button
if (btn == BTN_AHEAD110) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextAhead10, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextAhead10);
} else if (_down) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextAhead10, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextAhead10);
}

// Search button
Expand All @@ -341,7 +341,7 @@ bool ScalpelJournal::handleEvents(int key) {
} else {
color = COMMAND_FOREGROUND;
}
screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextSearch, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextSearch);

// First Page button
if (btn == BTN_FIRST_PAGE) {
Expand All @@ -351,7 +351,7 @@ bool ScalpelJournal::handleEvents(int key) {
} else {
color = COMMAND_NULL;
}
screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextFirstPage, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextFirstPage);

// Last Page button
if (btn == BTN_LAST_PAGE) {
Expand All @@ -361,10 +361,10 @@ bool ScalpelJournal::handleEvents(int key) {
} else {
color = COMMAND_NULL;
}
screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextLastPage, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextLastPage);

// Print Text button
screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), COMMAND_NULL, true, _fixedTextPrintText, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), COMMAND_NULL, true, _fixedTextPrintText);
}

if (btn == BTN_EXIT && events._released) {
Expand Down Expand Up @@ -404,7 +404,7 @@ bool ScalpelJournal::handleEvents(int key) {
screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);

} else if (((btn == BTN_SEARCH && events._released) || key == _hotkeySearch) && !_journal.empty()) {
screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), COMMAND_FOREGROUND, true, _fixedTextSearch, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), COMMAND_FOREGROUND, true, _fixedTextSearch);
bool notFound = false;

do {
Expand Down Expand Up @@ -477,18 +477,11 @@ int ScalpelJournal::getSearchString(bool printError) {
// Draw search panel
screen.makePanel(Common::Rect(6, 171, 313, 199));
screen.makeButton(Common::Rect(SEARCH_POINTS[0][0], yp, SEARCH_POINTS[0][1], yp + 10),
SEARCH_POINTS[0][2], _fixedTextSearchExit, true);
SEARCH_POINTS[0][2], _fixedTextSearchExit);
screen.makeButton(Common::Rect(SEARCH_POINTS[1][0], yp, SEARCH_POINTS[1][1], yp + 10),
SEARCH_POINTS[1][2], _fixedTextSearchBackward, true);
SEARCH_POINTS[1][2], _fixedTextSearchBackward);
screen.makeButton(Common::Rect(SEARCH_POINTS[2][0], yp, SEARCH_POINTS[2][1], yp + 10),
SEARCH_POINTS[2][2], _fixedTextSearchForward, true);

// screen.gPrint(Common::Point(SEARCH_POINTS[0][2] - screen.stringWidth(fixedText_Exit) / 2, yp),
// COMMAND_HIGHLIGHTED, "%c", _fixedTextSearchfixedText_Exit[0]);
// screen.gPrint(Common::Point(SEARCH_POINTS[1][2] - screen.stringWidth(fixedText_Backward) / 2, yp),
// COMMAND_HIGHLIGHTED, "%c", fixedText_Backward[0]);
// screen.gPrint(Common::Point(SEARCH_POINTS[2][2] - screen.stringWidth(fixedText_Forward) / 2, yp),
// COMMAND_HIGHLIGHTED, "%c", fixedText_Forward[0]);
SEARCH_POINTS[2][2], _fixedTextSearchForward);

screen.makeField(Common::Rect(12, 185, 307, 196));

Expand Down Expand Up @@ -554,26 +547,23 @@ int ScalpelJournal::getSearchString(bool printError) {
} else {
color = COMMAND_FOREGROUND;
}
screen.buttonPrint(Common::Point(SEARCH_POINTS[0][0], SEARCH_POINTS[0][2]), color, false, _fixedTextSearchExit, true);
//screen.print(Common::Point(SEARCH_POINTS[0][2] - screen.stringWidth(fixedText_Exit) / 2, 175), color, "%s", fixedText_Exit.c_str());
screen.buttonPrint(Common::Point(SEARCH_POINTS[0][0], SEARCH_POINTS[0][2]), color, false, _fixedTextSearchExit);

if (pt.x > SEARCH_POINTS[1][0] && pt.x < SEARCH_POINTS[1][1] && pt.y > 174 && pt.y < 183) {
found = BTN_BACKWARD;
color = COMMAND_HIGHLIGHTED;
} else {
color = COMMAND_FOREGROUND;
}
screen.buttonPrint(Common::Point(SEARCH_POINTS[1][0], SEARCH_POINTS[1][2]), color, false, _fixedTextSearchBackward, true);
//screen.print(Common::Point(SEARCH_POINTS[1][2] - screen.stringWidth(fixedText_Backward) / 2, 175), color, "%s", fixedText_Backward.c_str());
screen.buttonPrint(Common::Point(SEARCH_POINTS[1][0], SEARCH_POINTS[1][2]), color, false, _fixedTextSearchBackward);

if (pt.x > SEARCH_POINTS[2][0] && pt.x < SEARCH_POINTS[2][1] && pt.y > 174 && pt.y < 183) {
found = BTN_FORWARD;
color = COMMAND_HIGHLIGHTED;
} else {
color = COMMAND_FOREGROUND;
}
screen.buttonPrint(Common::Point(SEARCH_POINTS[2][0], SEARCH_POINTS[2][2]), color, false, _fixedTextSearchForward, true);
//screen.print(Common::Point(SEARCH_POINTS[2][2] - screen.stringWidth(fixedText_Forward) / 2, 175), color, "%s", fixedText_Forward.c_str());
screen.buttonPrint(Common::Point(SEARCH_POINTS[2][0], SEARCH_POINTS[2][2]), color, false, _fixedTextSearchForward);
}

events.wait(2);
Expand Down

0 comments on commit 7737f2f

Please sign in to comment.