diff options
author | Paul Gilbert | 2015-07-02 20:13:21 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-07-02 20:13:21 -0400 |
commit | 169f4b94f2e0999b5825e3328fafa7960df18659 (patch) | |
tree | a635440a90f93c2afe0179ee248a1e371a70802c | |
parent | 03fbbbb3ae46b7004d62677ddba08ee80e247262 (diff) | |
download | scummvm-rg350-169f4b94f2e0999b5825e3328fafa7960df18659.tar.gz scummvm-rg350-169f4b94f2e0999b5825e3328fafa7960df18659.tar.bz2 scummvm-rg350-169f4b94f2e0999b5825e3328fafa7960df18659.zip |
SHERLOCK: RT: Fix looking at characters
-rw-r--r-- | engines/sherlock/tattoo/tattoo_user_interface.cpp | 6 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_base.cpp | 4 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_base.h | 2 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_inventory.cpp | 2 |
4 files changed, 11 insertions, 3 deletions
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp index 8942d4e511..93290c67dd 100644 --- a/engines/sherlock/tattoo/tattoo_user_interface.cpp +++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp @@ -63,13 +63,18 @@ void TattooUserInterface::initScrollVars() { } void TattooUserInterface::lookAtObject() { + Events &events = *_vm->_events; People &people = *_vm->_people; Scene &scene = *_vm->_scene; Sound &sound = *_vm->_sound; Talk &talk = *_vm->_talk; + Common::Point mousePos = events.mousePos(); Common::String desc; int cAnimSpeed = 0; + _lookPos = mousePos; + _menuMode = LOOK_MODE; + if (_personFound) { desc = people[_bgFound - 1000]._examine; } else { @@ -184,6 +189,7 @@ void TattooUserInterface::printObjectDesc(const Common::String &str, bool firstT // Show text dialog _textWidget.load(str); + _textWidget.summonWindow(); if (firstTime) _selector = _oldSelector = -1; diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp index 0a53c55222..00bc83d0f2 100644 --- a/engines/sherlock/tattoo/widget_base.cpp +++ b/engines/sherlock/tattoo/widget_base.cpp @@ -76,7 +76,9 @@ void WidgetBase::draw() { if (_bounds.width() > 0 && !_surface.empty()) { // Get the area to draw, adjusted for scroll position + restrictToScreen(); Common::Rect bounds = _bounds; + bounds.translate(currentScroll.x, currentScroll.y); // Draw the background for the widget @@ -148,7 +150,7 @@ Common::String WidgetBase::splitLines(const Common::String &str, Common::StringA return *strP ? Common::String(strP) : Common::String(); } -void WidgetBase::checkMenuPosition() { +void WidgetBase::restrictToScreen() { if (_bounds.left < 0) _bounds.moveTo(0, _bounds.top); if (_bounds.top < 0) diff --git a/engines/sherlock/tattoo/widget_base.h b/engines/sherlock/tattoo/widget_base.h index f5ac2ea52b..3bf3095faf 100644 --- a/engines/sherlock/tattoo/widget_base.h +++ b/engines/sherlock/tattoo/widget_base.h @@ -51,7 +51,7 @@ protected: /** * Ensure that menu is drawn entirely on-screen */ - void checkMenuPosition(); + void restrictToScreen(); /** * Draw a window frame around the dges of the passed surface diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp index 1b4fa69a76..1df0e995c5 100644 --- a/engines/sherlock/tattoo/widget_inventory.cpp +++ b/engines/sherlock/tattoo/widget_inventory.cpp @@ -287,7 +287,7 @@ void WidgetInventory::load(int mode) { } // Ensure menu will be on-screen - checkMenuPosition(); + restrictToScreen(); // Load the inventory data inv.loadInv(); |