[Scummvm-cvs-logs] scummvm master -> 6a346b97a20ed02883bf2a8435799665bdf3fe35
dreammaster
dreammaster at scummvm.org
Mon Aug 3 00:11:41 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:
6a346b97a2 SHERLOCK: RT: Fixes for Foolscap puzzle
Commit: 6a346b97a20ed02883bf2a8435799665bdf3fe35
https://github.com/scummvm/scummvm/commit/6a346b97a20ed02883bf2a8435799665bdf3fe35
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-02T18:10:41-04:00
Commit Message:
SHERLOCK: RT: Fixes for Foolscap puzzle
Changed paths:
engines/sherlock/tattoo/widget_foolscap.cpp
engines/sherlock/tattoo/widget_foolscap.h
engines/sherlock/tattoo/widget_inventory.cpp
diff --git a/engines/sherlock/tattoo/widget_foolscap.cpp b/engines/sherlock/tattoo/widget_foolscap.cpp
index 9b906ae..2acb200 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 5ed1ede..3c85998 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 4653172..a72f5eb 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
More information about the Scummvm-git-logs
mailing list