[Scummvm-cvs-logs] scummvm master -> 48f5ef847fed6ef97a92c059f8f93bd453051144
dreammaster
dreammaster at scummvm.org
Mon Jul 20 00:57:13 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:
48f5ef847f SHERLOCK: RT: Fix tooltip display when using inventory item
Commit: 48f5ef847fed6ef97a92c059f8f93bd453051144
https://github.com/scummvm/scummvm/commit/48f5ef847fed6ef97a92c059f8f93bd453051144
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-19T18:56:08-04:00
Commit Message:
SHERLOCK: RT: Fix tooltip display when using inventory item
Changed paths:
engines/sherlock/events.cpp
engines/sherlock/events.h
engines/sherlock/tattoo/widget_inventory.cpp
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index c57abc7..a8912f6 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -89,6 +89,8 @@ void Events::setCursor(CursorId cursorId) {
void Events::setCursor(const Graphics::Surface &src, int hotspotX, int hotspotY) {
_cursorId = INVALID_CURSOR;
+ _hotspotPos = Common::Point(hotspotX, hotspotY);
+
if (!IS_3DO) {
// PC 8-bit palettized
CursorMan.replaceCursor(src.getPixels(), src.w, src.h, hotspotX, hotspotY, 0xff);
diff --git a/engines/sherlock/events.h b/engines/sherlock/events.h
index 6932f21..93a5e54 100644
--- a/engines/sherlock/events.h
+++ b/engines/sherlock/events.h
@@ -59,6 +59,7 @@ public:
bool _oldRightButton;
bool _firstPress;
Common::Stack<Common::KeyState> _pendingKeys;
+ Common::Point _hotspotPos;
public:
Events(SherlockEngine *vm);
~Events();
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 52ab5bf..9afe841 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -230,6 +230,10 @@ void WidgetInventoryTooltip::handleEvents() {
return;
}
+ if (_owner->_invVerbMode == 3)
+ // Adjust tooltip to be above the inventory item being shown above the standard cursor
+ mousePos.y -= events._hotspotPos.y;
+
// Update the position of the tooltip
int xs = CLIP(mousePos.x - _bounds.width() / 2, 0, SHERLOCK_SCENE_WIDTH - _bounds.width());
int ys = CLIP(mousePos.y - _bounds.height(), 0, SHERLOCK_SCREEN_HEIGHT - _bounds.height());
More information about the Scummvm-git-logs
mailing list