aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2016-01-30 17:21:51 +0100
committerMartin Kiewitz2016-01-30 17:21:51 +0100
commit9a91ed930d114d3ed7a6e493a3e82886464f0aa9 (patch)
tree25c67d90426d9697752d4813f37359557291fc97
parent9257597160bf70b6c7e323d27f3f8b6a47daa182 (diff)
downloadscummvm-rg350-9a91ed930d114d3ed7a6e493a3e82886464f0aa9.tar.gz
scummvm-rg350-9a91ed930d114d3ed7a6e493a3e82886464f0aa9.tar.bz2
scummvm-rg350-9a91ed930d114d3ed7a6e493a3e82886464f0aa9.zip
SHERLOCK: SS: make journal hotkeys multilingual
-rw-r--r--engines/sherlock/scalpel/scalpel_fixed_text.cpp72
-rw-r--r--engines/sherlock/scalpel/scalpel_journal.cpp182
-rw-r--r--engines/sherlock/scalpel/scalpel_journal.h31
-rw-r--r--engines/sherlock/scalpel/scalpel_user_interface.cpp2
4 files changed, 156 insertions, 131 deletions
diff --git a/engines/sherlock/scalpel/scalpel_fixed_text.cpp b/engines/sherlock/scalpel/scalpel_fixed_text.cpp
index 7d0faf32ed..8e8d01cad4 100644
--- a/engines/sherlock/scalpel/scalpel_fixed_text.cpp
+++ b/engines/sherlock/scalpel/scalpel_fixed_text.cpp
@@ -41,19 +41,19 @@ static const char *const fixedTextEN[] = {
"Watson's Journal",
"Page %d",
// SH1: Journal buttons
- "Exit",
- "Back 10",
- "Up",
- "Down",
- "Ahead 10",
- "Search",
- "First Page",
- "Last Page",
- "Print Text",
+ "EExit",
+ "BBack 10",
+ "UUp",
+ "DDown",
+ "AAhead 10",
+ "SSearch",
+ "FFirst Page",
+ "LLast Page",
+ "PPrint Text",
// SH1: Journal search
- "Exit",
- "Backward",
- "Forward",
+ "EExit",
+ "BBackward",
+ "FForward",
"Text Not Found !",
// SH1: Settings
"EExit",
@@ -186,19 +186,19 @@ static const char *const fixedTextDE[] = {
"Watsons Tagebuch",
"Seite %d",
// SH1: Journal buttons
- "Zur\201ck",
- "10 hoch",
- "Hoch",
- "Runter",
- "10 runter",
- "Suche",
- "Erste Seite",
- "Letzte Seite",
- "Drucke Text",
+ "ZZur\201ck", // original: "Zur\201ck"
+ "o10 hoch",
+ "HHoch",
+ "RRunter",
+ "u10 runter", // original: "10 runter"
+ "SSuche",
+ "EErste Seite",
+ "LLetzte Seite",
+ "DDrucke Text",
// SH1: Journal search
- "Zur\201ck",
- "R\201ckw\204rts", // original: "Backward"
- "Vorw\204rts", // original: "Forward"
+ "ZZur\201ck",
+ "RR\201ckw\204rts", // original: "Backward"
+ "VVorw\204rts", // original: "Forward"
"Text nicht gefunden!",
// SH1: Settings
"ZZur\201ck", // original interpreter: "Exit"
@@ -330,19 +330,19 @@ static const char *const fixedTextES[] = {
"Diario de Watson",
"Pagina %d",
// SH1: Journal buttons
- "Salir", // original interpreter: "Exit"
- "Retroceder",
- "Subir",
- "baJar",
- "Adelante",
- "Buscar",
- "1a pagina",
- "Ult pagina",
- "Imprimir",
+ "aSalir", // original interpreter: "Exit"
+ "RRetroceder",
+ "SSubir",
+ "JbaJar",
+ "AAdelante",
+ "BBuscar",
+ "11a pagina",
+ "UUlt pagina",
+ "IImprimir",
// SH1: Journal search
- "Salir", // original interpreter: "Exit"
- "Retroceder",
- "Avanzar",
+ "SSalir", // original interpreter: "Exit"
+ "RRetroceder",
+ "AAvanzar",
"Texto no encontrado!",
// SH1: Settings
"aSalir", // original interpreter: "Exit"
diff --git a/engines/sherlock/scalpel/scalpel_journal.cpp b/engines/sherlock/scalpel/scalpel_journal.cpp
index 85a2a2f8b8..904a5cfca0 100644
--- a/engines/sherlock/scalpel/scalpel_journal.cpp
+++ b/engines/sherlock/scalpel/scalpel_journal.cpp
@@ -64,6 +64,36 @@ ScalpelJournal::ScalpelJournal(SherlockEngine *vm) : Journal(vm) {
// Load the journal directory and location names
loadLocations();
}
+
+ _fixedTextWatsonsJournal = FIXED(Journal_WatsonsJournal);
+ _fixedTextExit = FIXED(Journal_Exit);
+ _fixedTextBack10 = FIXED(Journal_Back10);
+ _fixedTextUp = FIXED(Journal_Up);
+ _fixedTextDown = FIXED(Journal_Down);
+ _fixedTextAhead10 = FIXED(Journal_Ahead10);
+ _fixedTextSearch = FIXED(Journal_Search);
+ _fixedTextFirstPage = FIXED(Journal_FirstPage);
+ _fixedTextLastPage = FIXED(Journal_LastPage);
+ _fixedTextPrintText = FIXED(Journal_PrintText);
+
+ _hotkeyExit = toupper(_fixedTextExit[0]);
+ _hotkeyBack10 = toupper(_fixedTextBack10[0]);
+ _hotkeyUp = toupper(_fixedTextUp[0]);
+ _hotkeyDown = toupper(_fixedTextDown[0]);
+ _hotkeyAhead10 = toupper(_fixedTextAhead10[0]);
+ _hotkeySearch = toupper(_fixedTextSearch[0]);
+ _hotkeyFirstPage = toupper(_fixedTextFirstPage[0]);
+ _hotkeyLastPage = toupper(_fixedTextLastPage[0]);
+ _hotkeyPrintText = toupper(_fixedTextPrintText[0]);
+
+ _fixedTextSearchExit = FIXED(JournalSearch_Exit);
+ _fixedTextSearchBackward = FIXED(JournalSearch_Backward);
+ _fixedTextSearchForward = FIXED(JournalSearch_Forward);
+ _fixedTextSearchNotFound = FIXED(JournalSearch_NotFound);
+
+ _hotkeySearchExit = toupper(_fixedTextSearchExit[0]);
+ _hotkeySearchBackward = toupper(_fixedTextSearchBackward[0]);
+ _hotkeySearchForward = toupper(_fixedTextSearchForward[0]);
}
void ScalpelJournal::loadLocations() {
@@ -130,7 +160,6 @@ void ScalpelJournal::loadLocations() {
}
void ScalpelJournal::drawFrame() {
- FixedText &fixedText = *_vm->_fixedText;
Resources &res = *_vm->_res;
ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen;
byte palette[PALETTE_SIZE];
@@ -145,54 +174,43 @@ void ScalpelJournal::drawFrame() {
for (int idx = 0; idx < PALETTE_SIZE; ++idx)
palette[idx] = VGA_COLOR_TRANS(palette[idx]);
- Common::String fixedText_WatsonsJournal = fixedText.getText(kFixedText_Journal_WatsonsJournal);
- Common::String fixedText_Exit = fixedText.getText(kFixedText_Journal_Exit);
- Common::String fixedText_Back10 = fixedText.getText(kFixedText_Journal_Back10);
- Common::String fixedText_Up = fixedText.getText(kFixedText_Journal_Up);
- Common::String fixedText_Down = fixedText.getText(kFixedText_Journal_Down);
- Common::String fixedText_Ahead10 = fixedText.getText(kFixedText_Journal_Ahead10);
- Common::String fixedText_Search = fixedText.getText(kFixedText_Journal_Search);
- Common::String fixedText_FirstPage = fixedText.getText(kFixedText_Journal_FirstPage);
- Common::String fixedText_LastPage = fixedText.getText(kFixedText_Journal_LastPage);
- Common::String fixedText_PrintText = fixedText.getText(kFixedText_Journal_PrintText);
-
// Set the palette and print the title
screen.setPalette(palette);
- screen.gPrint(Common::Point(111, 18), BUTTON_BOTTOM, "%s", fixedText_WatsonsJournal.c_str());
- screen.gPrint(Common::Point(110, 17), INV_FOREGROUND, "%s", fixedText_WatsonsJournal.c_str());
+ screen.gPrint(Common::Point(111, 18), BUTTON_BOTTOM, "%s", _fixedTextWatsonsJournal.c_str());
+ screen.gPrint(Common::Point(110, 17), INV_FOREGROUND, "%s", _fixedTextWatsonsJournal.c_str());
// 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], fixedText_Exit);
+ JOURNAL_POINTS[0][2], _fixedTextExit, true);
screen.makeButton(Common::Rect(JOURNAL_POINTS[1][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[1][1], JOURNAL_BUTTONS_Y + 10),
- JOURNAL_POINTS[1][2], fixedText_Back10);
+ JOURNAL_POINTS[1][2], _fixedTextBack10, true);
screen.makeButton(Common::Rect(JOURNAL_POINTS[2][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[2][1], JOURNAL_BUTTONS_Y + 10),
- JOURNAL_POINTS[2][2], fixedText_Up);
+ JOURNAL_POINTS[2][2], _fixedTextUp, true);
screen.makeButton(Common::Rect(JOURNAL_POINTS[3][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[3][1], JOURNAL_BUTTONS_Y + 10),
- JOURNAL_POINTS[3][2], fixedText_Down);
+ JOURNAL_POINTS[3][2], _fixedTextDown, true);
screen.makeButton(Common::Rect(JOURNAL_POINTS[4][0], JOURNAL_BUTTONS_Y,
JOURNAL_POINTS[4][1], JOURNAL_BUTTONS_Y + 10),
- JOURNAL_POINTS[4][2], fixedText_Ahead10);
+ JOURNAL_POINTS[4][2], _fixedTextAhead10, true);
screen.makeButton(Common::Rect(JOURNAL_POINTS[5][0], JOURNAL_BUTTONS_Y + 11,
JOURNAL_POINTS[5][1], JOURNAL_BUTTONS_Y + 21),
- JOURNAL_POINTS[5][2], fixedText_Search);
+ JOURNAL_POINTS[5][2], _fixedTextSearch, true);
screen.makeButton(Common::Rect(JOURNAL_POINTS[6][0], JOURNAL_BUTTONS_Y + 11,
JOURNAL_POINTS[6][1], JOURNAL_BUTTONS_Y + 21),
- JOURNAL_POINTS[6][2], fixedText_FirstPage);
+ JOURNAL_POINTS[6][2], _fixedTextFirstPage, true);
screen.makeButton(Common::Rect(JOURNAL_POINTS[7][0], JOURNAL_BUTTONS_Y + 11,
JOURNAL_POINTS[7][1], JOURNAL_BUTTONS_Y + 21),
- JOURNAL_POINTS[7][2], fixedText_LastPage);
+ JOURNAL_POINTS[7][2], _fixedTextLastPage, true);
// 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], fixedText_PrintText);
+ JOURNAL_POINTS[8][2], _fixedTextPrintText, true);
screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11),
- COMMAND_NULL, false, fixedText_PrintText);
+ COMMAND_NULL, false, _fixedTextPrintText, true);
}
void ScalpelJournal::drawInterface() {
@@ -213,34 +231,24 @@ void ScalpelJournal::drawInterface() {
}
void ScalpelJournal::doArrows() {
- FixedText &fixedText = *_vm->_fixedText;
ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen;
byte color;
- Common::String fixedText_Back10 = fixedText.getText(kFixedText_Journal_Back10);
- Common::String fixedText_Up = fixedText.getText(kFixedText_Journal_Up);
- Common::String fixedText_Down = fixedText.getText(kFixedText_Journal_Down);
- Common::String fixedText_Ahead10 = fixedText.getText(kFixedText_Journal_Ahead10);
- Common::String fixedText_Search = fixedText.getText(kFixedText_Journal_Search);
- Common::String fixedText_FirstPage = fixedText.getText(kFixedText_Journal_FirstPage);
- Common::String fixedText_LastPage = fixedText.getText(kFixedText_Journal_LastPage);
- Common::String fixedText_PrintText = fixedText.getText(kFixedText_Journal_PrintText);
-
color = (_page > 1) ? COMMAND_FOREGROUND : COMMAND_NULL;
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), color, false, fixedText_Back10);
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), color, false, fixedText_Up);
+ 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);
color = _down ? COMMAND_FOREGROUND : COMMAND_NULL;
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), color, false, fixedText_Down);
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), color, false, fixedText_Ahead10);
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, false, fixedText_LastPage);
+ 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);
color = _journal.size() > 0 ? COMMAND_FOREGROUND : COMMAND_NULL;
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), color, false, fixedText_Search);
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), COMMAND_NULL, false, fixedText_PrintText);
+ 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);
color = _page > 1 ? COMMAND_FOREGROUND : COMMAND_NULL;
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, false, fixedText_FirstPage);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, false, _fixedTextFirstPage, true);
}
JournalButton ScalpelJournal::getHighlightedButton(const Common::Point &pt) {
@@ -285,7 +293,6 @@ JournalButton ScalpelJournal::getHighlightedButton(const Common::Point &pt) {
bool ScalpelJournal::handleEvents(int key) {
Events &events = *_vm->_events;
- FixedText &fixedText = *_vm->_fixedText;
ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen;
bool doneFlag = false;
@@ -294,46 +301,36 @@ bool ScalpelJournal::handleEvents(int key) {
byte color;
if (events._pressed || events._released) {
- Common::String fixedText_Exit = fixedText.getText(kFixedText_Journal_Exit);
- Common::String fixedText_Back10 = fixedText.getText(kFixedText_Journal_Back10);
- Common::String fixedText_Up = fixedText.getText(kFixedText_Journal_Up);
- Common::String fixedText_Down = fixedText.getText(kFixedText_Journal_Down);
- Common::String fixedText_Ahead10 = fixedText.getText(kFixedText_Journal_Ahead10);
- Common::String fixedText_Search = fixedText.getText(kFixedText_Journal_Search);
- Common::String fixedText_FirstPage = fixedText.getText(kFixedText_Journal_FirstPage);
- Common::String fixedText_LastPage = fixedText.getText(kFixedText_Journal_LastPage);
- Common::String fixedText_PrintText = fixedText.getText(kFixedText_Journal_PrintText);
-
// Exit button
color = (btn == BTN_EXIT) ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND;
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[0][2], JOURNAL_BUTTONS_Y), color, true, fixedText_Exit);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[0][2], JOURNAL_BUTTONS_Y), color, true, _fixedTextExit, true);
// Back 10 button
if (btn == BTN_BACK10) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, fixedText_Back10);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextBack10, true);
} else if (_page > 1) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, fixedText_Back10);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextBack10, true);
}
// Up button
if (btn == BTN_UP) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, fixedText_Up);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextUp, true);
} else if (_up) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, fixedText_Up);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextUp, true);
}
// Down button
if (btn == BTN_DOWN) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, fixedText_Down);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextDown, true);
} else if (_down) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, fixedText_Down);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextDown, true);
}
// Ahead 10 button
if (btn == BTN_AHEAD110) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, fixedText_Ahead10);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_HIGHLIGHTED, true, _fixedTextAhead10, true);
} else if (_down) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, fixedText_Ahead10);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), COMMAND_FOREGROUND, true, _fixedTextAhead10, true);
}
// Search button
@@ -344,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, fixedText_Search);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextSearch, true);
// First Page button
if (btn == BTN_FIRST_PAGE) {
@@ -354,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, fixedText_FirstPage);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextFirstPage, true);
// Last Page button
if (btn == BTN_LAST_PAGE) {
@@ -364,17 +361,17 @@ bool ScalpelJournal::handleEvents(int key) {
} else {
color = COMMAND_NULL;
}
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, true, fixedText_LastPage);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, true, _fixedTextLastPage, true);
// Print Text button
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), COMMAND_NULL, true, fixedText_PrintText);
+ screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), COMMAND_NULL, true, _fixedTextPrintText, true);
}
if (btn == BTN_EXIT && events._released) {
// Exit button pressed
doneFlag = true;
- } else if (((btn == BTN_BACK10 && events._released) || key == 'B') && (_page > 1)) {
+ } else if (((btn == BTN_BACK10 && events._released) || key == _hotkeyBack10) && (_page > 1)) {
// Scrolll up 10 pages
if (_page < 11)
drawJournal(1, (_page - 1) * LINES_PER_PAGE);
@@ -384,19 +381,19 @@ bool ScalpelJournal::handleEvents(int key) {
doArrows();
screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
- } else if (((btn == BTN_UP && events._released) || key == 'U') && _up) {
+ } else if (((btn == BTN_UP && events._released) || key == _hotkeyUp) && _up) {
// Scroll up
drawJournal(1, LINES_PER_PAGE);
doArrows();
screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
- } else if (((btn == BTN_DOWN && events._released) || key == 'D') && _down) {
+ } else if (((btn == BTN_DOWN && events._released) || key == _hotkeyDown) && _down) {
// Scroll down
drawJournal(2, LINES_PER_PAGE);
doArrows();
screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
- } else if (((btn == BTN_AHEAD110 && events._released) || key == 'A') && _down) {
+ } else if (((btn == BTN_AHEAD110 && events._released) || key == _hotkeyAhead10) && _down) {
// Scroll down 10 pages
if ((_page + 10) > _maxPage)
drawJournal(2, (_maxPage - _page) * LINES_PER_PAGE);
@@ -406,8 +403,8 @@ bool ScalpelJournal::handleEvents(int key) {
doArrows();
screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
- } else if (((btn == BTN_SEARCH && events._released) || key == 'S') && !_journal.empty()) {
- screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), COMMAND_FOREGROUND, true, "Search");
+ } 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);
bool notFound = false;
do {
@@ -437,7 +434,7 @@ bool ScalpelJournal::handleEvents(int key) {
} while (!doneFlag);
doneFlag = false;
- } else if (((btn == BTN_FIRST_PAGE && events._released) || key == 'F') && _up) {
+ } else if (((btn == BTN_FIRST_PAGE && events._released) || key == _hotkeyFirstPage) && _up) {
// First page
_index = _sub = 0;
_up = _down = false;
@@ -448,7 +445,7 @@ bool ScalpelJournal::handleEvents(int key) {
doArrows();
screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
- } else if (((btn == BTN_LAST_PAGE && events._released) || key == 'L') && _down) {
+ } else if (((btn == BTN_LAST_PAGE && events._released) || key == _hotkeyLastPage) && _down) {
// Last page
if ((_page + 10) > _maxPage)
drawJournal(2, (_maxPage - _page) * LINES_PER_PAGE);
@@ -468,7 +465,6 @@ int ScalpelJournal::getSearchString(bool printError) {
enum Button { BTN_NONE, BTN_EXIT, BTN_BACKWARD, BTN_FORWARD };
Events &events = *_vm->_events;
- FixedText &fixedText = *_vm->_fixedText;
ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen;
Talk &talk = *_vm->_talk;
int xp;
@@ -478,26 +474,21 @@ int ScalpelJournal::getSearchString(bool printError) {
int done = 0;
byte color;
- Common::String fixedText_Exit = fixedText.getText(kFixedText_JournalSearch_Exit);
- Common::String fixedText_Backward = fixedText.getText(kFixedText_JournalSearch_Backward);
- Common::String fixedText_Forward = fixedText.getText(kFixedText_JournalSearch_Forward);
- Common::String fixedText_NotFound = fixedText.getText(kFixedText_JournalSearch_NotFound);
-
// 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], fixedText_Exit);
+ SEARCH_POINTS[0][2], _fixedTextSearchExit, true);
screen.makeButton(Common::Rect(SEARCH_POINTS[1][0], yp, SEARCH_POINTS[1][1], yp + 10),
- SEARCH_POINTS[1][2], fixedText_Backward);
+ SEARCH_POINTS[1][2], _fixedTextSearchBackward, true);
screen.makeButton(Common::Rect(SEARCH_POINTS[2][0], yp, SEARCH_POINTS[2][1], yp + 10),
- SEARCH_POINTS[2][2], fixedText_Forward);
+ SEARCH_POINTS[2][2], _fixedTextSearchForward, true);
- screen.gPrint(Common::Point(SEARCH_POINTS[0][2] - screen.stringWidth(fixedText_Exit) / 2, yp),
- COMMAND_HIGHLIGHTED, "%c", fixedText_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]);
+// 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]);
screen.makeField(Common::Rect(12, 185, 307, 196));
@@ -507,8 +498,8 @@ int ScalpelJournal::getSearchString(bool printError) {
screen.hLine(306, 186, 195, BUTTON_TOP);
if (printError) {
- screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - screen.stringWidth(fixedText_NotFound)) / 2, 185),
- INV_FOREGROUND, "%s", fixedText_NotFound.c_str());
+ screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - screen.stringWidth(_fixedTextSearchNotFound)) / 2, 185),
+ INV_FOREGROUND, "%s", _fixedTextSearchNotFound.c_str());
} else if (!_find.empty()) {
// There's already a search term, display it already
screen.gPrint(Common::Point(15, 185), TALK_FOREGROUND, "%s", _find.c_str());
@@ -563,7 +554,8 @@ int ScalpelJournal::getSearchString(bool printError) {
} else {
color = COMMAND_FOREGROUND;
}
- 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, true);
+ //screen.print(Common::Point(SEARCH_POINTS[0][2] - screen.stringWidth(fixedText_Exit) / 2, 175), color, "%s", fixedText_Exit.c_str());
if (pt.x > SEARCH_POINTS[1][0] && pt.x < SEARCH_POINTS[1][1] && pt.y > 174 && pt.y < 183) {
found = BTN_BACKWARD;
@@ -571,7 +563,8 @@ int ScalpelJournal::getSearchString(bool printError) {
} else {
color = COMMAND_FOREGROUND;
}
- 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, true);
+ //screen.print(Common::Point(SEARCH_POINTS[1][2] - screen.stringWidth(fixedText_Backward) / 2, 175), color, "%s", fixedText_Backward.c_str());
if (pt.x > SEARCH_POINTS[2][0] && pt.x < SEARCH_POINTS[2][1] && pt.y > 174 && pt.y < 183) {
found = BTN_FORWARD;
@@ -579,7 +572,8 @@ int ScalpelJournal::getSearchString(bool printError) {
} else {
color = COMMAND_FOREGROUND;
}
- 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, true);
+ //screen.print(Common::Point(SEARCH_POINTS[2][2] - screen.stringWidth(fixedText_Forward) / 2, 175), color, "%s", fixedText_Forward.c_str());
}
events.wait(2);
diff --git a/engines/sherlock/scalpel/scalpel_journal.h b/engines/sherlock/scalpel/scalpel_journal.h
index c8e9c01739..50f1917fca 100644
--- a/engines/sherlock/scalpel/scalpel_journal.h
+++ b/engines/sherlock/scalpel/scalpel_journal.h
@@ -41,6 +41,37 @@ enum JournalButton {
};
class ScalpelJournal: public Journal {
+public:
+ Common::String _fixedTextWatsonsJournal;
+ Common::String _fixedTextExit;
+ Common::String _fixedTextBack10;
+ Common::String _fixedTextUp;
+ Common::String _fixedTextDown;
+ Common::String _fixedTextAhead10;
+ Common::String _fixedTextSearch;
+ Common::String _fixedTextFirstPage;
+ Common::String _fixedTextLastPage;
+ Common::String _fixedTextPrintText;
+
+ byte _hotkeyExit;
+ byte _hotkeyBack10;
+ byte _hotkeyUp;
+ byte _hotkeyDown;
+ byte _hotkeyAhead10;
+ byte _hotkeySearch;
+ byte _hotkeyFirstPage;
+ byte _hotkeyLastPage;
+ byte _hotkeyPrintText;
+
+ Common::String _fixedTextSearchExit;
+ Common::String _fixedTextSearchBackward;
+ Common::String _fixedTextSearchForward;
+ Common::String _fixedTextSearchNotFound;
+
+ byte _hotkeySearchExit;
+ byte _hotkeySearchBackward;
+ byte _hotkeySearchForward;
+
private:
/**
* Load the list of journal locations
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 3a64178cea..c48c2af884 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -1768,7 +1768,7 @@ void ScalpelUserInterface::journalControl() {
if (keyState.keycode == Common::KEYCODE_x && (keyState.flags & Common::KBD_ALT)) {
_vm->quitGame();
return;
- } else if (keyState.keycode == Common::KEYCODE_e || keyState.keycode == Common::KEYCODE_ESCAPE) {
+ } else if (toupper(keyState.ascii) == journal._hotkeyExit || keyState.keycode == Common::KEYCODE_ESCAPE) {
doneFlag = true;
} else {
_key = toupper(keyState.keycode);