[Scummvm-cvs-logs] scummvm master -> b05127ae8207fa1f7d87631b9a4465c0400d7066

dreammaster dreammaster at scummvm.org
Fri Sep 4 02:58:15 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b05127ae82 SHERLOCK: RT: Fix searching and displaying matches


Commit: b05127ae8207fa1f7d87631b9a4465c0400d7066
    https://github.com/scummvm/scummvm/commit/b05127ae8207fa1f7d87631b9a4465c0400d7066
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-09-03T20:57:36-04:00

Commit Message:
SHERLOCK: RT: Fix searching and displaying matches

Changed paths:
    engines/sherlock/journal.cpp
    engines/sherlock/tattoo/tattoo_journal.cpp



diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 334cc05..e442a3c 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -250,7 +250,7 @@ bool Journal::drawJournal(int direction, int howFar) {
 
 				// Print out the found keyword
 				Common::String lineMatch(matchP, matchP + _find.size());
-				byte fgColor = IS_SERRATED_SCALPEL ? (byte)Scalpel::INV_FOREGROUND : (byte)Tattoo::INV_FOREGROUND;
+				byte fgColor = IS_SERRATED_SCALPEL ? (byte)Scalpel::INV_FOREGROUND : (byte)Tattoo::PEN_HIGHLIGHT_COLOR;
 				screen.gPrint(Common::Point(JOURNAL_LEFT_X + width, yp), fgColor, "%s", lineMatch.c_str());
 				width += screen.stringWidth(lineMatch.c_str());
 
diff --git a/engines/sherlock/tattoo/tattoo_journal.cpp b/engines/sherlock/tattoo/tattoo_journal.cpp
index 3b78f9e..41de828 100644
--- a/engines/sherlock/tattoo/tattoo_journal.cpp
+++ b/engines/sherlock/tattoo/tattoo_journal.cpp
@@ -353,8 +353,8 @@ void TattooJournal::handleButtons() {
 					_savedSub = _sub;
 					_savedPage = _page;
 					
-					if (drawJournal(dir + 2, 1000 * LINES_PER_PAGE) == 0)
-					{
+					bool drawResult = drawJournal(dir + 2, 1000 * LINES_PER_PAGE);
+					if (!drawResult) {
 						_index = _savedIndex;
 						_sub = _savedSub;
 						_page = _savedPage;
@@ -362,12 +362,13 @@ void TattooJournal::handleButtons() {
 						drawFrame();
 						drawJournal(0, 0);
 						notFound = true;
-					} else {
-						break;
 					}
 
 					highlightJournalControls(false);
 					screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
+
+					if (drawResult)
+						break;
 				} else {
 					break;
 				}
@@ -754,6 +755,7 @@ int TattooJournal::getFindName(bool printError) {
 	int cursorX, cursorY;
 	bool blinkFlag = false;
 	int blinkCountdown = 1;
+	enum SearchButtons { SB_CANCEL = 0, SB_BACKWARDS = 1, SB_FORWARDS = 2 };
 
 	Common::Rect r(JOURNAL_BAR_WIDTH, (screen.fontHeight() + 4) * 2 + 9);
 	r.moveTo((SHERLOCK_SCREEN_WIDTH - r.width()) / 2, (SHERLOCK_SCREEN_HEIGHT - r.height()) / 2);
@@ -769,7 +771,8 @@ int TattooJournal::getFindName(bool printError) {
 		r.right - 3, cursorY + screen.fontHeight()));
 
 	if (printError) {
-		screen.gPrint(Common::Point(0, cursorY), INFO_TOP, "%s", FIXED(TextNotFound));
+		screen.gPrint(Common::Point(r.left + (r.width() - screen.stringWidth(FIXED(TextNotFound))) / 2, cursorY),
+			INFO_TOP, "%s", FIXED(TextNotFound));
 	} else {
 		// If there was a name already entered, copy it to name and display it
 		if (!_find.empty()) {
@@ -905,13 +908,13 @@ int TattooJournal::getFindName(bool printError) {
 
 		if (events._released || events._rightReleased) {
 			switch (_selector) {
-			case JH_CLOSE:
+			case SB_CANCEL:
 				done = -1;
 				break;
-			case JH_SEARCH:
+			case SB_BACKWARDS:
 				done = 2;
 				break;
-			case JH_PRINT:
+			case SB_FORWARDS:
 				done = 1;
 				break;
 			default:
@@ -921,6 +924,7 @@ int TattooJournal::getFindName(bool printError) {
 	} while (!done);
 
 	if (done != -1) {
+		// Forwards or backwards search, so save the entered name
 		_find = name;
 		result = done;
 	} else {






More information about the Scummvm-git-logs mailing list