diff options
Diffstat (limited to 'engines/sherlock/tattoo')
-rw-r--r-- | engines/sherlock/tattoo/tattoo_journal.h | 40 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_inventory.cpp | 6 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_talk.cpp | 17 |
3 files changed, 31 insertions, 32 deletions
diff --git a/engines/sherlock/tattoo/tattoo_journal.h b/engines/sherlock/tattoo/tattoo_journal.h index 9f0fa1fc9b..282f5b05f1 100644 --- a/engines/sherlock/tattoo/tattoo_journal.h +++ b/engines/sherlock/tattoo/tattoo_journal.h @@ -1,24 +1,24 @@ /* ScummVM - Graphic Adventure Engine -* -* ScummVM is the legal property of its developers, whose names -* are too numerous to list here. Please refer to the COPYRIGHT -* file distributed with this source distribution. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -*/ + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ #ifndef SHERLOCK_TATTOO_JOURNAL_H #define SHERLOCK_TATTOO_JOURNAL_H diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp index 9f126cf7a7..5e7238680a 100644 --- a/engines/sherlock/tattoo/widget_inventory.cpp +++ b/engines/sherlock/tattoo/widget_inventory.cpp @@ -376,15 +376,15 @@ void WidgetInventoryVerbs::handleEvents() { Common::Rect innerBounds = _bounds; innerBounds.grow(-3); - // Flag is they started pressing outside of the menu - if (events._firstPress && !_bounds.contains(mousePos)) + // Flag is they are pressing outside of the menu + if (!innerBounds.contains(mousePos)) _outsideMenu = true; if (events._released || events._rightReleased || ui._keyState.keycode == Common::KEYCODE_ESCAPE) { ui._scrollHighlight = SH_NONE; banishWindow(); - if ((_outsideMenu && !innerBounds.contains(mousePos)) || ui._keyState.keycode == Common::KEYCODE_ESCAPE) { + if (_outsideMenu || ui._keyState.keycode == Common::KEYCODE_ESCAPE) { _owner->_invVerbMode = 0; } else if (innerBounds.contains(mousePos)) { _outsideMenu = false; diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp index b673f32d31..aec664561e 100644 --- a/engines/sherlock/tattoo/widget_talk.cpp +++ b/engines/sherlock/tattoo/widget_talk.cpp @@ -196,22 +196,21 @@ void WidgetTalk::handleEvents() { // Handle selecting a talk entry if a numeric key has been pressed if (keycode >= Common::KEYCODE_1 && keycode <= Common::KEYCODE_9) { - int x = 0, t = 0, y = 0; + int x = 0, y = 0, t; + + for (t = 0; t < (int)_statementLines.size(); ++t) { + if (t > 0 && _statementLines[x]._num != _statementLines[t]._num) { + x = t; + ++y; + } - do { if (y == (keycode - Common::KEYCODE_1)) { _selector = _statementLines[t]._num; _outsideMenu = false; hotkey = true; break; } - - ++t; - if (_statementLines[x]._num != _statementLines[t]._num) { - x = t; - ++y; - } - } while (t < (int)_statementLines.size()); + } } // Display the selected statement highlighted and reset the last statement. |