SHERLOCK: RT: Fixes for Foolscap puzzle

This commit is contained in:
Paul Gilbert 2015-08-02 18:10:41 -04:00
parent 6a21765c2e
commit 6a346b97a2
3 changed files with 14 additions and 14 deletions

View File

@ -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();
}
}

View File

@ -60,7 +60,7 @@ public:
virtual ~WidgetFoolscap();
/**
* Show the hangman puzzle
* Show the foolscap puzzle
*/
void show();

View File

@ -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