From d5ef626490f52348997a2c25592b91ce2343e289 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 7 Oct 2015 15:06:48 +0200 Subject: SHERLOCK: SS: Multilingual press key text Press key to continue/for more is now translated in the Spanish+German versions of the game --- engines/sherlock/scalpel/scalpel_fixed_text.cpp | 15 ++++++++++++ engines/sherlock/scalpel/scalpel_fixed_text.h | 5 ++++ engines/sherlock/scalpel/scalpel_talk.cpp | 9 +++++--- .../sherlock/scalpel/scalpel_user_interface.cpp | 27 ++++++++++++++-------- 4 files changed, 43 insertions(+), 13 deletions(-) (limited to 'engines') diff --git a/engines/sherlock/scalpel/scalpel_fixed_text.cpp b/engines/sherlock/scalpel/scalpel_fixed_text.cpp index cc48cdfd5c..372fbc3e7e 100644 --- a/engines/sherlock/scalpel/scalpel_fixed_text.cpp +++ b/engines/sherlock/scalpel/scalpel_fixed_text.cpp @@ -55,6 +55,11 @@ static const char *const fixedTextEN[] = { "Backward", "Forward", "Text Not Found !", + // SH1: Press key text + "Press any Key for More.", + "P", + "Press any Key to Continue.", + "P", // SH1: Initial Inventory "A message requesting help", "A number of business cards", @@ -163,6 +168,11 @@ static const char *const fixedTextDE[] = { "R\201ckw\204rts", // original: "Backward" "Vorw\204rts", // original: "Forward" "Text nicht gefunden!", + // SH1: Press key text + "Mehr auf Tastendruck...", + "M", + "Beliebige Taste dr\201cken.", + "B", // SH1: Initial Inventory "Ein Hilferuf von Lestrade", "Holmes' Visitenkarten", @@ -270,6 +280,11 @@ static const char *const fixedTextES[] = { "Retroceder", "Avanzar", "Texto no encontrado!", + // SH1: Press key text + "Tecla para ver mas", + "T", + "Tecla para continuar", + "T", // SH1: Initial Inventory "Un mensaje solicitando ayuda", "Unas cuantas tarjetas de visita", diff --git a/engines/sherlock/scalpel/scalpel_fixed_text.h b/engines/sherlock/scalpel/scalpel_fixed_text.h index b8f51710b5..f46587ce81 100644 --- a/engines/sherlock/scalpel/scalpel_fixed_text.h +++ b/engines/sherlock/scalpel/scalpel_fixed_text.h @@ -57,6 +57,11 @@ enum FixedTextId { kFixedText_JournalSearch_Backward, kFixedText_JournalSearch_Forward, kFixedText_JournalSearch_NotFound, + // Press key text + kFixedText_PressKey_ForMore, + kFixedText_PressKey_ForMoreHotkey, + kFixedText_PressKey_ToContinue, + kFixedText_PressKey_ToContinueHotkey, // Initial inventory kFixedText_InitInventory_Message, kFixedText_InitInventory_HolmesCard, diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index 0458c309d7..64aac4e308 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -709,10 +709,13 @@ void ScalpelTalk::drawInterface() { screen.makeButton(Common::Rect(181, CONTROLS_Y, 221, CONTROLS_Y + 10), 200 - screen.stringWidth(fixedText_Down) / 2, fixedText_Down); } else { - int strWidth = screen.stringWidth(Scalpel::PRESS_KEY_TO_CONTINUE); + Common::String fixedText_PressKeyToContinue = fixedText.getText(kFixedText_PressKey_ToContinue); + Common::String fixedText_PressKeyToContinueHotkey = fixedText.getText(kFixedText_PressKey_ToContinueHotkey); + int fixedText_PressKeyToContinueLen = screen.stringWidth(fixedText_PressKeyToContinue); + screen.makeButton(Common::Rect(46, CONTROLS_Y, 273, CONTROLS_Y + 10), - 160 - strWidth / 2, Scalpel::PRESS_KEY_TO_CONTINUE); - screen.gPrint(Common::Point(160 - strWidth / 2, CONTROLS_Y), COMMAND_FOREGROUND, "P"); + 160 - fixedText_PressKeyToContinueLen / 2, fixedText_PressKeyToContinue); + screen.gPrint(Common::Point(160 - fixedText_PressKeyToContinueLen / 2, CONTROLS_Y), COMMAND_FOREGROUND, fixedText_PressKeyToContinueHotkey.c_str()); } } diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index 44189075b1..6ee9577a5d 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -67,8 +67,6 @@ const int INVENTORY_POINTS[8][3] = { const char COMMANDS[13] = "LMTPOCIUGJFS"; const char COMMANDS_3DO[13] = "LMTPOCIUGSFF"; const char INVENTORY_COMMANDS[9] = { "ELUG-+,." }; -const char *const PRESS_KEY_FOR_MORE = "Press any Key for More."; -const char *const PRESS_KEY_TO_CONTINUE = "Press any Key to Continue."; const int UI_OFFSET_3DO = 16; // (320 - 288) / 2 /*----------------------------------------------------------------*/ @@ -1808,6 +1806,7 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first ScalpelInventory &inv = *(ScalpelInventory *)_vm->_inventory; ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen; Talk &talk = *_vm->_talk; + FixedText &fixedText = *_vm->_fixedText; if (str.hasPrefix("_")) { _lookScriptFlag = true; @@ -1938,20 +1937,28 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first // Handle display depending on whether all the message was shown if (!endOfStr) { + Common::String fixedText_PressKeyForMore = fixedText.getText(kFixedText_PressKey_ForMore); + Common::String fixedText_PressKeyForMoreHotkey = fixedText.getText(kFixedText_PressKey_ForMoreHotkey); + int fixedText_PressKeyForMoreLen = screen.stringWidth(fixedText_PressKeyForMore); + screen.makeButton(Common::Rect(46, CONTROLS_Y, 272, CONTROLS_Y + 10), - (SHERLOCK_SCREEN_WIDTH - screen.stringWidth(PRESS_KEY_FOR_MORE)) / 2, - PRESS_KEY_FOR_MORE); + (SHERLOCK_SCREEN_WIDTH - fixedText_PressKeyForMoreLen) / 2, + fixedText_PressKeyForMore); screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - - screen.stringWidth(PRESS_KEY_FOR_MORE)) / 2, CONTROLS_Y), - COMMAND_FOREGROUND, "P"); + fixedText_PressKeyForMoreLen) / 2, CONTROLS_Y), + COMMAND_FOREGROUND, fixedText_PressKeyForMoreHotkey.c_str()); _descStr = msgP; } else { + Common::String fixedText_PressKeyToContinue = fixedText.getText(kFixedText_PressKey_ToContinue); + Common::String fixedText_PressKeyToContinueHotkey = fixedText.getText(kFixedText_PressKey_ToContinueHotkey); + int fixedText_PressKeyToContinueLen = screen.stringWidth(fixedText_PressKeyToContinue); + screen.makeButton(Common::Rect(46, CONTROLS_Y, 272, CONTROLS_Y + 10), - (SHERLOCK_SCREEN_WIDTH - screen.stringWidth(PRESS_KEY_TO_CONTINUE)) / 2, - PRESS_KEY_TO_CONTINUE); + (SHERLOCK_SCREEN_WIDTH - fixedText_PressKeyToContinueLen) / 2, + fixedText_PressKeyToContinue); screen.gPrint(Common::Point((SHERLOCK_SCREEN_WIDTH - - screen.stringWidth(PRESS_KEY_TO_CONTINUE)) / 2, CONTROLS_Y), - COMMAND_FOREGROUND, "P"); + fixedText_PressKeyToContinueLen) / 2, CONTROLS_Y), + COMMAND_FOREGROUND, fixedText_PressKeyToContinueHotkey.c_str()); _descStr = ""; } -- cgit v1.2.3