[Scummvm-cvs-logs] scummvm master -> 4bff203a3b3ad777c158bfccb7fb3206f9dcd30c

dreammaster dreammaster at scummvm.org
Sat Jul 4 20:57:43 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:
4bff203a3b SHERLOCK: RT: Fix display of journal buttons


Commit: 4bff203a3b3ad777c158bfccb7fb3206f9dcd30c
    https://github.com/scummvm/scummvm/commit/4bff203a3b3ad777c158bfccb7fb3206f9dcd30c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-04T14:56:38-04:00

Commit Message:
SHERLOCK: RT: Fix display of journal buttons

Changed paths:
    engines/sherlock/tattoo/tattoo_fixed_text.cpp
    engines/sherlock/tattoo/tattoo_fixed_text.h
    engines/sherlock/tattoo/tattoo_journal.cpp



diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.cpp b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
index 2be41c8..4ee9e5e 100644
--- a/engines/sherlock/tattoo/tattoo_fixed_text.cpp
+++ b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
@@ -56,7 +56,15 @@ static const char *const FIXED_TEXT_ENGLISH[] = {
 	"Solve",
 	"with",
 	"No effect...",
-	"This person has nothing to say at the moment"
+	"This person has nothing to say at the moment",
+
+	"Close Journal", 
+	"Search Journal",
+	"Save Journal",
+	"Abort Search",
+	"Search Backwards",
+	"Search Forwards",
+	"Text Not Found !"
 };
 
 TattooFixedText::TattooFixedText(SherlockEngine *vm) : FixedText(vm) {
diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.h b/engines/sherlock/tattoo/tattoo_fixed_text.h
index a73f1a5..117888d 100644
--- a/engines/sherlock/tattoo/tattoo_fixed_text.h
+++ b/engines/sherlock/tattoo/tattoo_fixed_text.h
@@ -56,7 +56,15 @@ enum FixedTextId {
 	kFixedText_Solve,
 	kFixedText_With,
 	kFixedText_NoEffect,
-	kFixedText_NothingToSay
+	kFixedText_NothingToSay,
+
+	kFixedText_CloseJournal,
+	kFixedText_SearchJournal,
+	kFixedText_SaveJournal,
+	kFixedText_AbortSearch,
+	kFixedText_SearchBackwards,
+	kFixedText_SearchForwards,
+	kFixedText_TextNotFound
 };
 
 class TattooFixedText: public FixedText {
diff --git a/engines/sherlock/tattoo/tattoo_journal.cpp b/engines/sherlock/tattoo/tattoo_journal.cpp
index c4022e9..8922aff 100644
--- a/engines/sherlock/tattoo/tattoo_journal.cpp
+++ b/engines/sherlock/tattoo/tattoo_journal.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/tattoo/tattoo_journal.h"
+#include "sherlock/tattoo/tattoo_fixed_text.h"
 #include "sherlock/tattoo/tattoo_scene.h"
 #include "sherlock/tattoo/tattoo_user_interface.h"
 #include "sherlock/tattoo/tattoo.h"
@@ -30,11 +31,6 @@ namespace Sherlock {
 namespace Tattoo {
 
 #define JOURNAL_BAR_WIDTH	450
-#define S_NO_TEXT "Text Not Found !"
-
-static const char *const JOURNAL_COMMANDS[2] = { "Close Journal", "Search Journal" };
-
-static const char *const JOURNAL_SEARCH_COMMANDS[3] = { "Abort Search", "Search Backwards", "Search Forwards" };
 
 TattooJournal::TattooJournal(SherlockEngine *vm) : Journal(vm) {
 	_journalImages = nullptr;
@@ -578,17 +574,23 @@ void TattooJournal::highlightJournalControls(bool slamIt) {
 		int xp = r.left + r.width() / 6;
 		byte color = (_selector == 0) ? COMMAND_HIGHLIGHTED : INFO_TOP;
 
-		screen.gPrint(Common::Point(xp - screen.stringWidth(JOURNAL_COMMANDS[0]) / 2, r.top),
-			color, "%s", JOURNAL_COMMANDS[0]);
+		screen.gPrint(Common::Point(xp - screen.stringWidth(FIXED(CloseJournal)) / 2, r.top + 5),
+			color, "%s", FIXED(CloseJournal));
 		xp += r.width() / 3;
 
 		if (!_journal.empty())
 			color = (_selector == 1) ? COMMAND_HIGHLIGHTED : INFO_TOP;
 		else
 			color = INFO_BOTTOM;
-		screen.gPrint(Common::Point(xp - screen.stringWidth(JOURNAL_COMMANDS[0]) / 2, r.top + 5),
-			color, "%s", JOURNAL_COMMANDS[1]);
+		screen.gPrint(Common::Point(xp - screen.stringWidth(FIXED(SearchJournal)) / 2, r.top + 5),
+			color, "%s", FIXED(SearchJournal));
+		xp += r.width() / 3;
+
+		color = INFO_BOTTOM;
+		screen.gPrint(Common::Point(xp - screen.stringWidth(FIXED(SaveJournal)) / 2, r.top + 5), 
+			color, "%s", FIXED(SaveJournal));
 
+		// Draw the horizontal scrollbar
 		drawScrollBar();
 
 		if (slamIt)
@@ -604,6 +606,7 @@ void TattooJournal::highlightSearchControls(bool slamIt) {
 	Common::Point mousePos = events.mousePos();
 	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);
+	const char *SEARCH_COMMANDS[3] = { FIXED(AbortSearch), FIXED(SearchBackwards), FIXED(SearchForwards) };
 
 	// See if the mouse is over any of the Journal Controls
 	_selector = -1;
@@ -617,8 +620,8 @@ void TattooJournal::highlightSearchControls(bool slamIt) {
 
 		for (int idx = 0; idx < 3; ++idx) {
 			byte color = (_selector == idx) ? COMMAND_HIGHLIGHTED : INFO_TOP;
-			screen.gPrint(Common::Point(xp - screen.stringWidth(JOURNAL_SEARCH_COMMANDS[idx]) / 2,
-				r.top + 5), color, "%s", JOURNAL_SEARCH_COMMANDS[idx]);
+			screen.gPrint(Common::Point(xp - screen.stringWidth(SEARCH_COMMANDS[idx]) / 2,
+				r.top + 5), color, "%s", SEARCH_COMMANDS[idx]);
 			xp += r.width() / 3;
 		}
 
@@ -698,6 +701,7 @@ void TattooJournal::disableControls() {
 	Screen &screen = *_vm->_screen;
 	Common::Rect r(JOURNAL_BAR_WIDTH, BUTTON_SIZE + screen.fontHeight() + 13);
 	r.moveTo((SHERLOCK_SCREEN_HEIGHT - r.width()) / 2, SHERLOCK_SCREEN_HEIGHT - r.height());
+	const char *JOURNAL_COMMANDS[3] = { FIXED(CloseJournal), FIXED(SearchJournal), FIXED(SaveJournal) };
 
 	// Print the Journal commands
 	int xp = r.left + r.width() / 6;
@@ -735,7 +739,7 @@ int TattooJournal::getFindName(bool printError) {
 		r.right - 3, cursorY + screen.fontHeight()));
 
 	if (printError) {
-		screen.gPrint(Common::Point(0, cursorY), INFO_TOP, "%s", S_NO_TEXT);
+		screen.gPrint(Common::Point(0, cursorY), INFO_TOP, "%s", FIXED(TextNotFound));
 	} else {
 		// If there was a name already entered, copy it to name and display it
 		if (!_find.empty()) {






More information about the Scummvm-git-logs mailing list