diff options
author | Paul Gilbert | 2015-08-02 18:10:41 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-08-02 18:10:41 -0400 |
commit | 6a346b97a20ed02883bf2a8435799665bdf3fe35 (patch) | |
tree | e779ffa195be12860cac62331fdab08c374c610e | |
parent | 6a21765c2e252f58795e777308079cf93918a4ef (diff) | |
download | scummvm-rg350-6a346b97a20ed02883bf2a8435799665bdf3fe35.tar.gz scummvm-rg350-6a346b97a20ed02883bf2a8435799665bdf3fe35.tar.bz2 scummvm-rg350-6a346b97a20ed02883bf2a8435799665bdf3fe35.zip |
SHERLOCK: RT: Fixes for Foolscap puzzle
-rw-r--r-- | engines/sherlock/tattoo/widget_foolscap.cpp | 15 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_foolscap.h | 2 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_inventory.cpp | 11 |
3 files changed, 14 insertions, 14 deletions
diff --git a/engines/sherlock/tattoo/widget_foolscap.cpp b/engines/sherlock/tattoo/widget_foolscap.cpp index 9b906aee33..2acb20081a 100644 --- a/engines/sherlock/tattoo/widget_foolscap.cpp +++ b/engines/sherlock/tattoo/widget_foolscap.cpp @@ -107,12 +107,15 @@ void WidgetFoolscap::show() { if (_vm->readFlags(299)) { Common::Point cursorPos; for (int line = 0; line < 3; ++line) { - cursorPos.y = _lines[_lineNum].y - screen.fontHeight() - 2; + cursorPos.y = _lines[line].y - screen.fontHeight() - 2; - for (uint idx = 0; idx < strlen(_solutions[_lineNum]); ++idx) { - cursorPos.x = _lines[_lineNum].x + 8 - screen.widestChar() / 2 + idx * _spacing; - screen.gPrint(Common::Point(cursorPos.x + screen.widestChar() / 2 - - screen.charWidth(_solutions[_lineNum][idx]) / 2, cursorPos.y), 0, "%c", _solutions[_lineNum][idx]); + for (uint idx = 0; idx < strlen(_solutions[line]); ++idx) { + cursorPos.x = _lines[line].x + 8 - screen.widestChar() / 2 + idx * _spacing; + char c = _solutions[line][idx]; + + Common::String str = Common::String::format("%c", c); + _surface.writeString(str, Common::Point(cursorPos.x + screen.widestChar() / 2 + - screen.charWidth(c) / 2, cursorPos.y), 0); } } } @@ -253,7 +256,7 @@ void WidgetFoolscap::handleKeyboardEvents() { // See if all of their anwers are correct if (!scumm_stricmp(_answers[0], _solutions[0]) && !scumm_stricmp(_answers[1], _solutions[1]) && !scumm_stricmp(_answers[2], _solutions[2])) { - _solved; + _solved = true; close(); } } diff --git a/engines/sherlock/tattoo/widget_foolscap.h b/engines/sherlock/tattoo/widget_foolscap.h index 5ed1edee4e..3c85998cee 100644 --- a/engines/sherlock/tattoo/widget_foolscap.h +++ b/engines/sherlock/tattoo/widget_foolscap.h @@ -60,7 +60,7 @@ public: virtual ~WidgetFoolscap(); /** - * Show the hangman puzzle + * Show the foolscap puzzle */ void show(); diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp index 4653172481..a72f5eb8ee 100644 --- a/engines/sherlock/tattoo/widget_inventory.cpp +++ b/engines/sherlock/tattoo/widget_inventory.cpp @@ -390,23 +390,20 @@ void WidgetInventoryVerbs::handleEvents() { _outsideMenu = false; // Check if they are trying to solve the Foolscap puzzle, or looking at the completed puzzle - bool doHangman = !inv[_owner->_invSelect]._name.compareToIgnoreCase(FIXED(Inv6)) && + bool doFoolscap = !inv[_owner->_invSelect]._name.compareToIgnoreCase(FIXED(Inv6)) && !_inventCommands[_invVerbSelect].compareToIgnoreCase(FIXED(Solve)); - doHangman |= (!inv[_owner->_invSelect]._name.compareToIgnoreCase(FIXED(Inv6)) || !inv[_owner->_invSelect]._name.compareToIgnoreCase(FIXED(Inv7))) + doFoolscap |= (!inv[_owner->_invSelect]._name.compareToIgnoreCase(FIXED(Inv6)) || !inv[_owner->_invSelect]._name.compareToIgnoreCase(FIXED(Inv7))) && _inventCommands[_invVerbSelect].compareToIgnoreCase(FIXED(Look)) && vm.readFlags(299); - if (doHangman) { + if (doFoolscap) { // Close the entire Inventory and return to Standard Mode _owner->_invVerbMode = 0; _owner->_tooltipWidget.banishWindow(); + _owner->banishWindow(); inv.freeInv(); events.clearEvents(); - events.setCursor(ARROW); - ui._menuMode = scene._labTableScene ? LAB_MODE : STD_MODE; - - scene.doBgAnim(); vm.doFoolscapPuzzle(); } else if (_invVerbSelect == 0) { // They have released the mouse on the Look Verb command, so Look at the inventory item |