diff options
author | Martin Kiewitz | 2016-01-30 20:22:18 +0100 |
---|---|---|
committer | Martin Kiewitz | 2016-01-30 20:22:18 +0100 |
commit | 7737f2f049588ed12e17d466d9e8616583ef12be (patch) | |
tree | d07f59b6af5734888ae0b27536ca4d2d655c7553 | |
parent | 33cedb65fa05e05e5467aa5f80338cd19bec5e34 (diff) | |
download | scummvm-rg350-7737f2f049588ed12e17d466d9e8616583ef12be.tar.gz scummvm-rg350-7737f2f049588ed12e17d466d9e8616583ef12be.tar.bz2 scummvm-rg350-7737f2f049588ed12e17d466d9e8616583ef12be.zip |
SHERLOCK: SS: button code cleanup
Change the default for the optional parameter "textContainsHotkey"
to true, because it's needed almost all of the time.
-rw-r--r-- | engines/sherlock/scalpel/scalpel_inventory.cpp | 48 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_journal.cpp | 86 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_saveload.cpp | 52 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_screen.cpp | 23 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_screen.h | 6 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.cpp | 40 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_user_interface.cpp | 52 | ||||
-rw-r--r-- | engines/sherlock/scalpel/settings.cpp | 32 |
8 files changed, 166 insertions, 173 deletions
diff --git a/engines/sherlock/scalpel/scalpel_inventory.cpp b/engines/sherlock/scalpel/scalpel_inventory.cpp index ec1ab3cde4..19e0b95f7c 100644 --- a/engines/sherlock/scalpel/scalpel_inventory.cpp +++ b/engines/sherlock/scalpel/scalpel_inventory.cpp @@ -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; @@ -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 } } diff --git a/engines/sherlock/scalpel/scalpel_journal.cpp b/engines/sherlock/scalpel/scalpel_journal.cpp index 904a5cfca0..d6f8021e5b 100644 --- a/engines/sherlock/scalpel/scalpel_journal.cpp +++ b/engines/sherlock/scalpel/scalpel_journal.cpp @@ -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() { @@ -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) { @@ -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 @@ -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) { @@ -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) { @@ -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) { @@ -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 { @@ -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)); @@ -554,8 +547,7 @@ 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; @@ -563,8 +555,7 @@ int ScalpelJournal::getSearchString(bool printError) { } 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; @@ -572,8 +563,7 @@ int ScalpelJournal::getSearchString(bool printError) { } 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); diff --git a/engines/sherlock/scalpel/scalpel_saveload.cpp b/engines/sherlock/scalpel/scalpel_saveload.cpp index 88450921d1..90eab5930c 100644 --- a/engines/sherlock/scalpel/scalpel_saveload.cpp +++ b/engines/sherlock/scalpel/scalpel_saveload.cpp @@ -94,23 +94,23 @@ void ScalpelSaveManager::drawInterface() { screen._backBuffer1.fillRect(Common::Rect(2, CONTROLS_Y + 10, SHERLOCK_SCREEN_WIDTH - 2, SHERLOCK_SCREEN_HEIGHT - 2), INV_BACKGROUND); screen.makeButton(Common::Rect(ENV_POINTS[0][0], CONTROLS_Y, ENV_POINTS[0][1], CONTROLS_Y + 10), - ENV_POINTS[0][2], _fixedTextExit, true); + ENV_POINTS[0][2], _fixedTextExit); screen.makeButton(Common::Rect(ENV_POINTS[1][0], CONTROLS_Y, ENV_POINTS[1][1], CONTROLS_Y + 10), - ENV_POINTS[1][2], _fixedTextLoad, true); + ENV_POINTS[1][2], _fixedTextLoad); screen.makeButton(Common::Rect(ENV_POINTS[2][0], CONTROLS_Y, ENV_POINTS[2][1], CONTROLS_Y + 10), - ENV_POINTS[2][2], _fixedTextSave, true); + ENV_POINTS[2][2], _fixedTextSave); screen.makeButton(Common::Rect(ENV_POINTS[3][0], CONTROLS_Y, ENV_POINTS[3][1], CONTROLS_Y + 10), - ENV_POINTS[3][2], _fixedTextUp, true); + ENV_POINTS[3][2], _fixedTextUp); screen.makeButton(Common::Rect(ENV_POINTS[4][0], CONTROLS_Y, ENV_POINTS[4][1], CONTROLS_Y + 10), - ENV_POINTS[4][2], _fixedTextDown, true); + ENV_POINTS[4][2], _fixedTextDown); screen.makeButton(Common::Rect(ENV_POINTS[5][0], CONTROLS_Y, ENV_POINTS[5][1], CONTROLS_Y + 10), - ENV_POINTS[5][2], _fixedTextQuit, true); + ENV_POINTS[5][2], _fixedTextQuit); if (!_savegameIndex) - screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_NULL, 0, _fixedTextUp, true); + screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_NULL, 0, _fixedTextUp); if (_savegameIndex == MAX_SAVEGAME_SLOTS - ONSCREEN_FILES_COUNT) - screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_NULL, 0, _fixedTextDown, true); + screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_NULL, 0, _fixedTextDown); for (int idx = _savegameIndex; idx < _savegameIndex + ONSCREEN_FILES_COUNT; ++idx) { screen.gPrint(Common::Point(6, CONTROLS_Y + 11 + (idx - _savegameIndex) * 10), @@ -144,31 +144,31 @@ void ScalpelSaveManager::highlightButtons(int btnIndex) { ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen; byte color = (btnIndex == 0) ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[0][2], CONTROLS_Y), color, 1, _fixedTextExit, true); + screen.buttonPrint(Common::Point(ENV_POINTS[0][2], CONTROLS_Y), color, 1, _fixedTextExit); if ((btnIndex == 1) || ((_envMode == SAVEMODE_LOAD) && (btnIndex != 2))) - screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextLoad, true); + screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextLoad); else - screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextLoad, true); + screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextLoad); if ((btnIndex == 2) || ((_envMode == SAVEMODE_SAVE) && (btnIndex != 1))) - screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextSave, true); + screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextSave); else - screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextSave, true); + screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextSave); if (btnIndex == 3 && _savegameIndex) - screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextUp, true); + screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextUp); else if (_savegameIndex) - screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextUp, true); + screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextUp); if ((btnIndex == 4) && (_savegameIndex < MAX_SAVEGAME_SLOTS - 5)) - screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextDown, true); + screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextDown); else if (_savegameIndex < (MAX_SAVEGAME_SLOTS - 5)) - screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextDown, true); + screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextDown); color = (btnIndex == 5) ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[5][2], CONTROLS_Y), color, 1, _fixedTextQuit, true); + screen.buttonPrint(Common::Point(ENV_POINTS[5][2], CONTROLS_Y), color, 1, _fixedTextQuit); } bool ScalpelSaveManager::checkGameOnScreen(int slot) { @@ -191,10 +191,10 @@ bool ScalpelSaveManager::checkGameOnScreen(int slot) { screen.slamRect(Common::Rect(3, CONTROLS_Y + 11, 318, SHERLOCK_SCREEN_HEIGHT)); byte color = !_savegameIndex ? COMMAND_NULL : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), color, 1, _fixedTextUp, true); + screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), color, 1, _fixedTextUp); color = (_savegameIndex == (MAX_SAVEGAME_SLOTS - 5)) ? COMMAND_NULL : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), color, 1, _fixedTextDown, true); + screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), color, 1, _fixedTextDown); return true; } @@ -210,12 +210,12 @@ bool ScalpelSaveManager::promptForDescription(int slot) { int xp, yp; bool flag = false; - screen.buttonPrint(Common::Point(ENV_POINTS[0][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextExit, true); - screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextLoad, true); - screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextSave, true); - screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextUp, true); - screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextDown, true); - screen.buttonPrint(Common::Point(ENV_POINTS[5][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextQuit, true); + screen.buttonPrint(Common::Point(ENV_POINTS[0][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextExit); + screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextLoad); + screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextSave); + screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextUp); + screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextDown); + screen.buttonPrint(Common::Point(ENV_POINTS[5][2], CONTROLS_Y), COMMAND_NULL, true, _fixedTextQuit); Common::String saveName = _savegames[slot]; if (isSlotEmpty(slot)) { diff --git a/engines/sherlock/scalpel/scalpel_screen.cpp b/engines/sherlock/scalpel/scalpel_screen.cpp index 18aa56fe38..197a2a2634 100644 --- a/engines/sherlock/scalpel/scalpel_screen.cpp +++ b/engines/sherlock/scalpel/scalpel_screen.cpp @@ -31,7 +31,7 @@ ScalpelScreen::ScalpelScreen(SherlockEngine *vm) : Screen(vm) { } void ScalpelScreen::makeButton(const Common::Rect &bounds, int textX, - const Common::String &str, bool textContainsHotkey) { + const Common::String &buttonText, bool textContainsHotkey) { Surface &bb = *_backBuffer; bb.fillRect(Common::Rect(bounds.left, bounds.top, bounds.right, bounds.top + 1), BUTTON_TOP); @@ -40,28 +40,29 @@ void ScalpelScreen::makeButton(const Common::Rect &bounds, int textX, bb.fillRect(Common::Rect(bounds.left + 1, bounds.bottom - 1, bounds.right, bounds.bottom), BUTTON_BOTTOM); bb.fillRect(Common::Rect(bounds.left + 1, bounds.top + 1, bounds.right - 1, bounds.bottom - 1), BUTTON_MIDDLE); - buttonPrint(Common::Point(textX, bounds.top), COMMAND_FOREGROUND, false, str, textContainsHotkey); + buttonPrint(Common::Point(textX, bounds.top), COMMAND_FOREGROUND, false, buttonText, textContainsHotkey); } +// ButtonText is supposed to have its hotkey as a prefix. The hotkey will get highlighted. void ScalpelScreen::buttonPrint(const Common::Point &pt, uint color, bool slamIt, - const Common::String &str, bool textContainsHotkey) { + const Common::String &buttonText, bool textContainsHotkey) { int xStart = pt.x; int skipTextOffset = textContainsHotkey ? +1 : 0; // skip first char in case text contains hotkey // Center text around given x-coordinate if (textContainsHotkey) { - xStart -= (stringWidth(Common::String(str.c_str() + 1)) / 2); + xStart -= (stringWidth(Common::String(buttonText.c_str() + 1)) / 2); } else { - xStart -= (stringWidth(str) / 2); + xStart -= (stringWidth(buttonText) / 2); } if (color == COMMAND_FOREGROUND) { uint16 prefixOffsetX = 0; - byte hotkey = str[0]; + byte hotkey = buttonText[0]; // Hotkey needs to be highlighted if (textContainsHotkey) { - Common::String prefixText = Common::String(str.c_str() + 1); + Common::String prefixText = Common::String(buttonText.c_str() + 1); uint16 prefixTextLen = prefixText.size(); uint16 prefixTextPos = 0; @@ -87,17 +88,17 @@ void ScalpelScreen::buttonPrint(const Common::Point &pt, uint color, bool slamIt if (slamIt) { print(Common::Point(xStart, pt.y + 1), - COMMAND_FOREGROUND, "%s", str.c_str() + skipTextOffset); + COMMAND_FOREGROUND, "%s", buttonText.c_str() + skipTextOffset); print(Common::Point(xStart + prefixOffsetX, pt.y + 1), COMMAND_HIGHLIGHTED, "%c", hotkey); } else { gPrint(Common::Point(xStart, pt.y), - COMMAND_FOREGROUND, "%s", str.c_str() + skipTextOffset); + COMMAND_FOREGROUND, "%s", buttonText.c_str() + skipTextOffset); gPrint(Common::Point(xStart + prefixOffsetX, pt.y), COMMAND_HIGHLIGHTED, "%c", hotkey); } } else if (slamIt) { - print(Common::Point(xStart, pt.y + 1), color, "%s", str.c_str() + skipTextOffset); + print(Common::Point(xStart, pt.y + 1), color, "%s", buttonText.c_str() + skipTextOffset); } else { - gPrint(Common::Point(xStart, pt.y), color, "%s", str.c_str() + skipTextOffset); + gPrint(Common::Point(xStart, pt.y), color, "%s", buttonText.c_str() + skipTextOffset); } } diff --git a/engines/sherlock/scalpel/scalpel_screen.h b/engines/sherlock/scalpel/scalpel_screen.h index ff294f6bfc..cee33b8c6c 100644 --- a/engines/sherlock/scalpel/scalpel_screen.h +++ b/engines/sherlock/scalpel/scalpel_screen.h @@ -38,14 +38,16 @@ public: /** * Draws a button for use in the inventory, talk, and examine dialogs. + * ButtonText is supposed to have its hotkey as a prefix. The hotkey will get highlighted. */ - void makeButton(const Common::Rect &bounds, int textX, const Common::String &str, bool textContainsHotkey = false); + void makeButton(const Common::Rect &bounds, int textX, const Common::String &buttonText, bool textContainsHotkey = true); /** * Prints an interface command with the first letter highlighted to indicate * what keyboard shortcut is associated with it + * ButtonText is supposed to have its hotkey as a prefix. The hotkey will get highlighted. */ - void buttonPrint(const Common::Point &pt, uint color, bool slamIt, const Common::String &str, bool textContainsHotkey = false); + void buttonPrint(const Common::Point &pt, uint color, bool slamIt, const Common::String &buttonText, bool textContainsHotkey = true); /** * Draw a panel in the back buffer with a raised area effect around the edges diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index c921c1ee9b..be2baf9184 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -205,9 +205,9 @@ void ScalpelTalk::talkInterface(const byte *&str) { drawInterface(); if (_talkTo != -1) { - screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowExit, true); - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowUp, true); - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowExit); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowUp); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowDown); } } @@ -523,9 +523,9 @@ OpcodeReturn ScalpelTalk::cmdSummonWindow(const byte *&str) { _noTextYet = false; if (_speaker != -1) { - screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowExit, true); - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowUp, true); - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowExit); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowUp); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowDown); } return RET_SUCCESS; @@ -701,16 +701,16 @@ void ScalpelTalk::drawInterface() { Common::String fixedText_Down = FIXED(Window_Down); screen.makeButton(Common::Rect(99, CONTROLS_Y, 139, CONTROLS_Y + 10), - 119, fixedText_Exit, true); + 119, fixedText_Exit); screen.makeButton(Common::Rect(140, CONTROLS_Y, 180, CONTROLS_Y + 10), - 159, fixedText_Up, true); + 159, fixedText_Up); screen.makeButton(Common::Rect(181, CONTROLS_Y, 221, CONTROLS_Y + 10), - 200, fixedText_Down, true); + 200, fixedText_Down); } else { Common::String fixedText_PressKeyToContinue = FIXED(PressKey_ToContinue); screen.makeButton(Common::Rect(46, CONTROLS_Y, 273, CONTROLS_Y + 10), - 160, fixedText_PressKeyToContinue, true); + 160, fixedText_PressKeyToContinue); } } @@ -735,17 +735,17 @@ bool ScalpelTalk::displayTalk(bool slamIt) { if (_moreTalkUp) { if (slamIt) { screen.print(Common::Point(5, CONTROLS_Y + 13), INV_FOREGROUND, "~"); - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextWindowUp, true); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextWindowUp); } else { screen.gPrint(Common::Point(5, CONTROLS_Y + 12), INV_FOREGROUND, "~"); - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_FOREGROUND, false, _fixedTextWindowUp, true); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_FOREGROUND, false, _fixedTextWindowUp); } } else { if (slamIt) { - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, true, _fixedTextWindowUp, true); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, true, _fixedTextWindowUp); screen.vgaBar(Common::Rect(5, CONTROLS_Y + 11, 15, CONTROLS_Y + 22), INV_BACKGROUND); } else { - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowUp, true); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowUp); screen._backBuffer1.fillRect(Common::Rect(5, CONTROLS_Y + 11, 15, CONTROLS_Y + 22), INV_BACKGROUND); } @@ -780,17 +780,17 @@ bool ScalpelTalk::displayTalk(bool slamIt) { if (slamIt) { screen.print(Common::Point(5, 190), INV_FOREGROUND, "|"); - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_FOREGROUND, true, _fixedTextWindowDown); } else { screen.gPrint(Common::Point(5, 189), INV_FOREGROUND, "|"); - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_FOREGROUND, false, _fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_FOREGROUND, false, _fixedTextWindowDown); } } else { if (slamIt) { - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, true, _fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, true, _fixedTextWindowDown); screen.vgaBar(Common::Rect(5, 189, 16, 199), INV_BACKGROUND); } else { - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, false, _fixedTextWindowDown); screen._backBuffer1.fillRect(Common::Rect(5, 189, 16, 199), INV_BACKGROUND); } } @@ -909,9 +909,9 @@ void ScalpelTalk::showTalk() { // If the window is already open, simply draw. Otherwise, do it // to the back buffer and then summon the window if (ui._windowOpen) { - screen.buttonPrint(Common::Point(119, CONTROLS_Y), color, true, _fixedTextWindowExit, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), color, true, _fixedTextWindowExit); } else { - screen.buttonPrint(Common::Point(119, CONTROLS_Y), color, false, _fixedTextWindowExit, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), color, false, _fixedTextWindowExit); if (!ui._slideWindows) { screen.slamRect(Common::Rect(0, CONTROLS_Y, diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index 6292f3b7e1..221555ae99 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -858,9 +858,9 @@ void ScalpelUserInterface::doEnvControl() { screen.slamRect(Common::Rect(3, CONTROLS_Y + 11, SHERLOCK_SCREEN_WIDTH - 2, SHERLOCK_SCREEN_HEIGHT)); color = !saves._savegameIndex ? COMMAND_NULL : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), color, true, saves._fixedTextUp, true); + screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), color, true, saves._fixedTextUp); color = (saves._savegameIndex == MAX_SAVEGAME_SLOTS - ONSCREEN_FILES_COUNT) ? COMMAND_NULL : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), color, true, saves._fixedTextDown, true); + screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), color, true, saves._fixedTextDown); // Check whether there are more pending U keys pressed moreKeys = false; @@ -893,10 +893,10 @@ void ScalpelUserInterface::doEnvControl() { screen.slamRect(Common::Rect(3, CONTROLS_Y + 11, SHERLOCK_SCREEN_WIDTH - 2, SHERLOCK_SCREEN_HEIGHT)); color = (!saves._savegameIndex) ? COMMAND_NULL : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), color, true, saves._fixedTextUp, true); + screen.buttonPrint(Common::Point(ENV_POINTS[3][2], CONTROLS_Y), color, true, saves._fixedTextUp); color = (saves._savegameIndex == MAX_SAVEGAME_SLOTS - ONSCREEN_FILES_COUNT) ? COMMAND_NULL : COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), color, true, saves._fixedTextDown, true); + screen.buttonPrint(Common::Point(ENV_POINTS[4][2], CONTROLS_Y), color, true, saves._fixedTextDown); // Check whether there are more pending D keys pressed moreKeys = false; @@ -912,8 +912,8 @@ void ScalpelUserInterface::doEnvControl() { screen.print(Common::Point(0, CONTROLS_Y + 20), INV_FOREGROUND, saves._fixedTextQuitGameQuestion.c_str()); screen.vgaBar(Common::Rect(0, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH, CONTROLS_Y + 10), BORDER_COLOR); - screen.makeButton(Common::Rect(112, CONTROLS_Y, 160, CONTROLS_Y + 10), 136, saves._fixedTextQuitGameYes, true); - screen.makeButton(Common::Rect(161, CONTROLS_Y, 209, CONTROLS_Y + 10), 184, saves._fixedTextQuitGameNo, true); + screen.makeButton(Common::Rect(112, CONTROLS_Y, 160, CONTROLS_Y + 10), 136, saves._fixedTextQuitGameYes); + screen.makeButton(Common::Rect(161, CONTROLS_Y, 209, CONTROLS_Y + 10), 184, saves._fixedTextQuitGameNo); screen.slamArea(112, CONTROLS_Y, 97, 10); do { @@ -952,13 +952,13 @@ void ScalpelUserInterface::doEnvControl() { color = COMMAND_HIGHLIGHTED; else color = COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(136, CONTROLS_Y), color, true, saves._fixedTextQuitGameYes, true); + screen.buttonPrint(Common::Point(136, CONTROLS_Y), color, true, saves._fixedTextQuitGameYes); if (mousePos.x > 161 && mousePos.x < 208 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 9)) color = COMMAND_HIGHLIGHTED; else color = COMMAND_FOREGROUND; - screen.buttonPrint(Common::Point(184, CONTROLS_Y), color, true, saves._fixedTextQuitGameNo, true); + screen.buttonPrint(Common::Point(184, CONTROLS_Y), color, true, saves._fixedTextQuitGameNo); } if (mousePos.x > 112 && mousePos.x < 159 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 9) && events._released) @@ -973,7 +973,7 @@ void ScalpelUserInterface::doEnvControl() { events.pollEvents(); return; } else { - screen.buttonPrint(Common::Point(184, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, saves._fixedTextQuitGameNo, true); + screen.buttonPrint(Common::Point(184, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, saves._fixedTextQuitGameNo); banishWindow(1); _windowBounds.top = CONTROLS_Y1; _key = -1; @@ -1043,12 +1043,12 @@ void ScalpelUserInterface::doInvControl() { if (found != -1) // If a slot highlighted, set its color colors[found] = COMMAND_HIGHLIGHTED; - screen.buttonPrint(Common::Point(INVENTORY_POINTS[0][2], CONTROLS_Y1), colors[0], true, inv._fixedTextExit, true); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[0][2], CONTROLS_Y1), colors[0], true, inv._fixedTextExit); if (found >= 0 && found <= 3) { - screen.buttonPrint(Common::Point(INVENTORY_POINTS[1][2], CONTROLS_Y1), colors[1], true, inv._fixedTextLook, true); - screen.buttonPrint(Common::Point(INVENTORY_POINTS[2][2], CONTROLS_Y1), colors[2], true, inv._fixedTextUse, true); - screen.buttonPrint(Common::Point(INVENTORY_POINTS[3][2], CONTROLS_Y1), colors[3], true, inv._fixedTextGive, true); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[1][2], CONTROLS_Y1), colors[1], true, inv._fixedTextLook); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[2][2], CONTROLS_Y1), colors[2], true, inv._fixedTextUse); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[3][2], CONTROLS_Y1), colors[3], true, inv._fixedTextGive); inv._invMode = (InvMode)found; _selector = -1; } @@ -1591,19 +1591,19 @@ void ScalpelUserInterface::doTalkControl() { // Handle button printing if (mousePos.x > 99 && mousePos.x < 138 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 10) && !_endKeyActive) - screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, talk._fixedTextWindowExit, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, talk._fixedTextWindowExit); else if (_endKeyActive) - screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowExit, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowExit); if (mousePos.x > 140 && mousePos.x < 170 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 10) && talk._moreTalkUp) - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, talk._fixedTextWindowUp, true); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, talk._fixedTextWindowUp); else if (talk._moreTalkUp) - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowUp, true); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowUp); if (mousePos.x > 181&& mousePos.x < 220 && mousePos.y > CONTROLS_Y && mousePos.y < (CONTROLS_Y + 10) && talk._moreTalkDown) - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, talk._fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_HIGHLIGHTED, true, talk._fixedTextWindowDown); else if (talk._moreTalkDown) - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowDown); bool found = false; for (_selector = talk._talkIndex; _selector < (int)talk._statements.size() && !found; ++_selector) { @@ -1688,9 +1688,9 @@ void ScalpelUserInterface::doTalkControl() { screen.slamRect(Common::Rect(5, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH - 5, SHERLOCK_SCREEN_HEIGHT - 2)); } else if (_selector != -1) { - screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowExit, true); - screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowUp, true); - screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowDown, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowExit); + screen.buttonPrint(Common::Point(159, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowUp); + screen.buttonPrint(Common::Point(200, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowDown); // If the reply is new, add it to the journal if (!talk._talkHistory[talk._converseNum][_selector]) { @@ -1784,9 +1784,9 @@ void ScalpelUserInterface::doTalkControl() { !talk._statements[select]._statement.hasPrefix("^")) { // Not a reply first file, so display the new selections if (_endKeyActive) - screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowExit, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_FOREGROUND, true, talk._fixedTextWindowExit); else - screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowExit, true); + screen.buttonPrint(Common::Point(119, CONTROLS_Y), COMMAND_NULL, true, talk._fixedTextWindowExit); talk.displayTalk(true); events.setCursor(ARROW); @@ -2012,13 +2012,13 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first Common::String fixedText_PressKeyForMore = FIXED(PressKey_ForMore); screen.makeButton(Common::Rect(46, CONTROLS_Y, 272, CONTROLS_Y + 10), - SHERLOCK_SCREEN_WIDTH / 2, fixedText_PressKeyForMore, true); + SHERLOCK_SCREEN_WIDTH / 2, fixedText_PressKeyForMore); _descStr = msgP; } else { Common::String fixedText_PressKeyToContinue = FIXED(PressKey_ToContinue); screen.makeButton(Common::Rect(46, CONTROLS_Y, 272, CONTROLS_Y + 10), - SHERLOCK_SCREEN_WIDTH / 2, fixedText_PressKeyToContinue, true); + SHERLOCK_SCREEN_WIDTH / 2, fixedText_PressKeyToContinue); _descStr = ""; } diff --git a/engines/sherlock/scalpel/settings.cpp b/engines/sherlock/scalpel/settings.cpp index ad67dc08ee..a061e40397 100644 --- a/engines/sherlock/scalpel/settings.cpp +++ b/engines/sherlock/scalpel/settings.cpp @@ -69,7 +69,7 @@ void Settings::drawInterface(bool flag) { tempStr = FIXED(Settings_Exit); _hotkeyExit = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[0][0], SETUP_POINTS[0][1], SETUP_POINTS[0][2], SETUP_POINTS[0][1] + 10), - SETUP_POINTS[0][3], tempStr, true); + SETUP_POINTS[0][3], tempStr); if (music._musicOn) { tempStr = FIXED(Settings_MusicOn); @@ -78,7 +78,7 @@ void Settings::drawInterface(bool flag) { } _hotkeyMusic = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[1][0], SETUP_POINTS[1][1], SETUP_POINTS[1][2], SETUP_POINTS[1][1] + 10), - SETUP_POINTS[1][3], tempStr, true); + SETUP_POINTS[1][3], tempStr); if (people._portraitsOn) { tempStr = FIXED(Settings_PortraitsOn); @@ -87,18 +87,18 @@ void Settings::drawInterface(bool flag) { } _hotkeyPortraits = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[10][0], SETUP_POINTS[10][1], SETUP_POINTS[10][2], SETUP_POINTS[10][1] + 10), - SETUP_POINTS[10][3], tempStr, true); + SETUP_POINTS[10][3], tempStr); // WORKAROUND: We don't support the joystick in ScummVM, so draw the next two buttons as disabled tempStr = FIXED(Settings_JoystickOff); screen.makeButton(Common::Rect(SETUP_POINTS[6][0], SETUP_POINTS[6][1], SETUP_POINTS[6][2], SETUP_POINTS[6][1] + 10), - SETUP_POINTS[6][3], tempStr, true); - screen.buttonPrint(Common::Point(SETUP_POINTS[6][3], SETUP_POINTS[6][1]), COMMAND_NULL, false, tempStr, true); + SETUP_POINTS[6][3], tempStr); + screen.buttonPrint(Common::Point(SETUP_POINTS[6][3], SETUP_POINTS[6][1]), COMMAND_NULL, false, tempStr); tempStr = FIXED(Settings_NewFontStyle); _hotkeyNewFontStyle = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[5][0], SETUP_POINTS[5][1], SETUP_POINTS[5][2], SETUP_POINTS[5][1] + 10), - SETUP_POINTS[5][3], tempStr, true); + SETUP_POINTS[5][3], tempStr); if (sound._digitized) { tempStr = FIXED(Settings_SoundEffectsOn); @@ -107,7 +107,7 @@ void Settings::drawInterface(bool flag) { } _hotkeySoundEffects = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[3][0], SETUP_POINTS[3][1], SETUP_POINTS[3][2], SETUP_POINTS[3][1] + 10), - SETUP_POINTS[3][3], tempStr, true); + SETUP_POINTS[3][3], tempStr); if (ui._slideWindows) { tempStr = FIXED(Settings_WindowsSlide); @@ -116,12 +116,12 @@ void Settings::drawInterface(bool flag) { } _hotkeyWindows = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[9][0], SETUP_POINTS[9][1], SETUP_POINTS[9][2], SETUP_POINTS[9][1] + 10), - SETUP_POINTS[9][3], tempStr, true); + SETUP_POINTS[9][3], tempStr); tempStr = FIXED(Settings_CalibrateJoystick); screen.makeButton(Common::Rect(SETUP_POINTS[7][0], SETUP_POINTS[7][1], SETUP_POINTS[7][2], SETUP_POINTS[7][1] + 10), - SETUP_POINTS[7][3], tempStr, true); - screen.buttonPrint(Common::Point(SETUP_POINTS[7][3], SETUP_POINTS[7][1]), COMMAND_NULL, false, tempStr, true); + SETUP_POINTS[7][3], tempStr); + screen.buttonPrint(Common::Point(SETUP_POINTS[7][3], SETUP_POINTS[7][1]), COMMAND_NULL, false, tempStr); if (ui._helpStyle) { tempStr = FIXED(Settings_AutoHelpRight); @@ -130,7 +130,7 @@ void Settings::drawInterface(bool flag) { } _hotkeyAutoHelp = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[4][0], SETUP_POINTS[4][1], SETUP_POINTS[4][2], SETUP_POINTS[4][1] + 10), - SETUP_POINTS[4][3], tempStr, true); + SETUP_POINTS[4][3], tempStr); if (sound._voices) { tempStr = FIXED(Settings_VoicesOn); @@ -139,7 +139,7 @@ void Settings::drawInterface(bool flag) { } _hotkeyVoices = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[2][0], SETUP_POINTS[2][1], SETUP_POINTS[2][2], SETUP_POINTS[2][1] + 10), - SETUP_POINTS[2][3], tempStr, true); + SETUP_POINTS[2][3], tempStr); if (screen._fadeStyle) { tempStr = FIXED(Settings_FadeByPixel); @@ -148,12 +148,12 @@ void Settings::drawInterface(bool flag) { } _hotkeyFade = toupper(tempStr.firstChar()); screen.makeButton(Common::Rect(SETUP_POINTS[8][0], SETUP_POINTS[8][1], SETUP_POINTS[8][2], SETUP_POINTS[8][1] + 10), - SETUP_POINTS[8][3], tempStr, true); + SETUP_POINTS[8][3], tempStr); tempStr = FIXED(Settings_KeyPadSlow); screen.makeButton(Common::Rect(SETUP_POINTS[11][0], SETUP_POINTS[11][1], SETUP_POINTS[11][2], SETUP_POINTS[11][1] + 10), - SETUP_POINTS[11][3], tempStr, true); - screen.buttonPrint(Common::Point(SETUP_POINTS[11][3], SETUP_POINTS[11][1]), COMMAND_NULL, false, tempStr, true); + SETUP_POINTS[11][3], tempStr); + screen.buttonPrint(Common::Point(SETUP_POINTS[11][3], SETUP_POINTS[11][1]), COMMAND_NULL, false, tempStr); _hotkeysIndexed[0] = _hotkeyExit; _hotkeysIndexed[1] = _hotkeyMusic; @@ -269,7 +269,7 @@ int Settings::drawButtons(const Common::Point &pt, int _key) { default: continue; } - screen.buttonPrint(Common::Point(SETUP_POINTS[idx][3], SETUP_POINTS[idx][1]), color, true, tempStr, true); + screen.buttonPrint(Common::Point(SETUP_POINTS[idx][3], SETUP_POINTS[idx][1]), color, true, tempStr); } return found; |