aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.cpp6
-rw-r--r--engines/sherlock/tattoo/widget_base.cpp4
-rw-r--r--engines/sherlock/tattoo/widget_base.h2
-rw-r--r--engines/sherlock/tattoo/widget_inventory.cpp2
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();