diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/fixed_text.cpp | 21 | ||||
-rw-r--r-- | engines/sherlock/fixed_text.h | 8 | ||||
-rw-r--r-- | engines/sherlock/inventory.cpp | 60 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_user_interface.cpp | 14 |
4 files changed, 71 insertions, 32 deletions
diff --git a/engines/sherlock/fixed_text.cpp b/engines/sherlock/fixed_text.cpp index 0633ce65d1..ab77b185bc 100644 --- a/engines/sherlock/fixed_text.cpp +++ b/engines/sherlock/fixed_text.cpp @@ -29,7 +29,12 @@ static const Common::String fixedTextEN[] = { // Window buttons "Exit", "Up", - "Down" + "Down", + // Inventory buttons + "Exit", + "Look", + "Use", + "Give" }; // sharp-s : 0xE1 / octal 341 @@ -40,14 +45,24 @@ static const Common::String fixedTextDE[] = { // Window buttons "Zur\201ck", "Hoch", - "Runter" + "Runter", + // Inventory buttons + "Zur\201ck", + "Schau", + "Benutze", + "Gib" }; static const Common::String fixedTextES[] = { // Window buttons "Exit", "Subir", - "Bajar" + "Bajar", + // Inventory buttons + "Exit", + "Mirar", + "Usar", + "Dar" }; static const SherlockFixedTextLanguageEntry fixedTextLanguages[] = { diff --git a/engines/sherlock/fixed_text.h b/engines/sherlock/fixed_text.h index 016a1fb493..cca98b5dc5 100644 --- a/engines/sherlock/fixed_text.h +++ b/engines/sherlock/fixed_text.h @@ -28,9 +28,15 @@ namespace Sherlock { enum FixedTextId { + // Window buttons kFixedText_Window_Exit = 0, kFixedText_Window_Up, - kFixedText_Window_Down + kFixedText_Window_Down, + // Inventory buttons + kFixedText_Inventory_Exit, + kFixedText_Inventory_Look, + kFixedText_Inventory_Use, + kFixedText_Inventory_Give }; struct SherlockFixedTextLanguageEntry { diff --git a/engines/sherlock/inventory.cpp b/engines/sherlock/inventory.cpp index 929be0e9d4..94e90b516a 100644 --- a/engines/sherlock/inventory.cpp +++ b/engines/sherlock/inventory.cpp @@ -179,6 +179,7 @@ void Inventory::putInv(InvSlamMode slamIt) { } void Inventory::drawInventory(InvNewMode mode) { + FixedText &fixedText = *_vm->_fixedText; Screen &screen = *_vm->_screen; UserInterface &ui = *_vm->_ui; InvNewMode tempMode = mode; @@ -201,22 +202,27 @@ void Inventory::drawInventory(InvNewMode mode) { INV_BACKGROUND); // Draw the buttons + Common::String fixedText_Exit = fixedText.getText(kFixedText_Inventory_Exit); + Common::String fixedText_Look = fixedText.getText(kFixedText_Inventory_Look); + Common::String fixedText_Use = fixedText.getText(kFixedText_Inventory_Use); + Common::String fixedText_Give = fixedText.getText(kFixedText_Inventory_Give); + screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[0][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[0][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[0][2] - screen.stringWidth("Exit") / 2, "Exit"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[0][2] - screen.stringWidth(fixedText_Exit) / 2, fixedText_Exit); screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[1][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[1][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[1][2] - screen.stringWidth("Look") / 2, "Look"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[1][2] - screen.stringWidth(fixedText_Look) / 2, fixedText_Look); screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[2][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[2][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[2][2] - screen.stringWidth("Use") / 2, "Use"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[2][2] - screen.stringWidth(fixedText_Use) / 2, fixedText_Use); screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[3][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[3][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[3][2] - screen.stringWidth("Give") / 2, "Give"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[3][2] - screen.stringWidth(fixedText_Give) / 2, fixedText_Give); screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[4][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[4][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[4][2], "^^"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[4][2], "^^"); // 2 arrows pointing to the left screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[5][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[5][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[5][2], "^"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[5][2], "^"); // 1 arrow pointing to the left screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[6][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[6][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[6][2], "_"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[6][2], "_"); // 1 arrow pointing to the right screen.makeButton(Common::Rect(Scalpel::INVENTORY_POINTS[7][0], CONTROLS_Y1, Scalpel::INVENTORY_POINTS[7][1], - CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[7][2], "__"); + CONTROLS_Y1 + 10), Scalpel::INVENTORY_POINTS[7][2], "__"); // 2 arrows pointing to the right if (tempMode == INVENTORY_DONT_DISPLAY) mode = LOOK_INVENTORY_MODE; @@ -249,61 +255,67 @@ void Inventory::drawInventory(InvNewMode mode) { } void Inventory::invCommands(bool slamIt) { + FixedText &fixedText = *_vm->_fixedText; Screen &screen = *_vm->_screen; UserInterface &ui = *_vm->_ui; + Common::String fixedText_Exit = fixedText.getText(kFixedText_Inventory_Exit); + Common::String fixedText_Look = fixedText.getText(kFixedText_Inventory_Look); + Common::String fixedText_Use = fixedText.getText(kFixedText_Inventory_Use); + Common::String fixedText_Give = fixedText.getText(kFixedText_Inventory_Give); + if (slamIt) { screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[0][2], CONTROLS_Y1), _invMode == INVMODE_EXIT ? COMMAND_HIGHLIGHTED :COMMAND_FOREGROUND, - true, "Exit"); + true, fixedText_Exit); screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[1][2], CONTROLS_Y1), _invMode == INVMODE_LOOK ? COMMAND_HIGHLIGHTED :COMMAND_FOREGROUND, - true, "Look"); + true, fixedText_Look); screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[2][2], CONTROLS_Y1), _invMode == INVMODE_USE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND, - true, "Use"); + true, fixedText_Use); screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[3][2], CONTROLS_Y1), _invMode == INVMODE_GIVE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND, - true, "Give"); + true, fixedText_Give); screen.print(Common::Point(Scalpel::INVENTORY_POINTS[4][2], CONTROLS_Y1 + 1), _invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND, - "^^"); + "^^"); // 2 arrows pointing to the left screen.print(Common::Point(Scalpel::INVENTORY_POINTS[5][2], CONTROLS_Y1 + 1), _invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND, - "^"); + "^"); // 2 arrows pointing to the left screen.print(Common::Point(Scalpel::INVENTORY_POINTS[6][2], CONTROLS_Y1 + 1), (_holdings - _invIndex <= 6) ? COMMAND_NULL : COMMAND_FOREGROUND, - "_"); + "_"); // 1 arrow pointing to the right screen.print(Common::Point(Scalpel::INVENTORY_POINTS[7][2], CONTROLS_Y1 + 1), (_holdings - _invIndex <= 6) ? COMMAND_NULL : COMMAND_FOREGROUND, - "__"); + "__"); // 2 arrows pointing to the right if (_invMode != INVMODE_LOOK) ui.clearInfo(); } else { screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[0][2], CONTROLS_Y1), _invMode == INVMODE_EXIT ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND, - false, "Exit"); + false, fixedText_Exit); screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[1][2], CONTROLS_Y1), _invMode == INVMODE_LOOK ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND, - false, "Look"); + false, fixedText_Look); screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[2][2], CONTROLS_Y1), _invMode == INVMODE_USE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND, - false, "Use"); + false, fixedText_Use); screen.buttonPrint(Common::Point(Scalpel::INVENTORY_POINTS[3][2], CONTROLS_Y1), _invMode == INVMODE_GIVE ? COMMAND_HIGHLIGHTED : COMMAND_FOREGROUND, - false, "Give"); + false, fixedText_Give); screen.gPrint(Common::Point(Scalpel::INVENTORY_POINTS[4][2], CONTROLS_Y1), _invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND, - "^^"); + "^^"); // 2 arrows pointing to the left screen.gPrint(Common::Point(Scalpel::INVENTORY_POINTS[5][2], CONTROLS_Y1), _invIndex == 0 ? COMMAND_NULL : COMMAND_FOREGROUND, - "^"); + "^"); // 1 arrow pointing to the left screen.gPrint(Common::Point(Scalpel::INVENTORY_POINTS[6][2], CONTROLS_Y1), (_holdings - _invIndex < 7) ? COMMAND_NULL : COMMAND_FOREGROUND, - "_"); + "_"); // 1 arrow pointing to the right screen.gPrint(Common::Point(Scalpel::INVENTORY_POINTS[7][2], CONTROLS_Y1), (_holdings - _invIndex < 7) ? COMMAND_NULL : COMMAND_FOREGROUND, - "__"); + "__"); // 2 arrows pointing to the right } } diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index f40d6b4c19..e0e7f3362b 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -981,6 +981,7 @@ void ScalpelUserInterface::doEnvControl() { void ScalpelUserInterface::doInvControl() { Events &events = *_vm->_events; + FixedText &fixedText = *_vm->_fixedText; Inventory &inv = *_vm->_inventory; Scene &scene = *_vm->_scene; Screen &screen = *_vm->_screen; @@ -1006,15 +1007,20 @@ void ScalpelUserInterface::doInvControl() { if (events._pressed || events._released) { events.clearKeyboard(); + Common::String fixedText_Exit = fixedText.getText(kFixedText_Inventory_Exit); + Common::String fixedText_Look = fixedText.getText(kFixedText_Inventory_Look); + Common::String fixedText_Use = fixedText.getText(kFixedText_Inventory_Use); + Common::String fixedText_Give = fixedText.getText(kFixedText_Inventory_Give); + 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, "Exit"); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[0][2], CONTROLS_Y1), colors[0], true, fixedText_Exit); if (found >= 0 && found <= 3) { - screen.buttonPrint(Common::Point(INVENTORY_POINTS[1][2], CONTROLS_Y1), colors[1], true, "Look"); - screen.buttonPrint(Common::Point(INVENTORY_POINTS[2][2], CONTROLS_Y1), colors[2], true, "Use"); - screen.buttonPrint(Common::Point(INVENTORY_POINTS[3][2], CONTROLS_Y1), colors[3], true, "Give"); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[1][2], CONTROLS_Y1), colors[1], true, fixedText_Look); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[2][2], CONTROLS_Y1), colors[2], true, fixedText_Use); + screen.buttonPrint(Common::Point(INVENTORY_POINTS[3][2], CONTROLS_Y1), colors[3], true, fixedText_Give); inv._invMode = (InvMode)found; _selector = -1; } |