Skip to content

Commit

Permalink
SHERLOCK: RT: Fix tooltip display when using inventory item
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jul 19, 2015
1 parent 23471ee commit 48f5ef8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engines/sherlock/events.cpp
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions engines/sherlock/events.h
Expand Up @@ -59,6 +59,7 @@ class Events {
bool _oldRightButton;
bool _firstPress;
Common::Stack<Common::KeyState> _pendingKeys;
Common::Point _hotspotPos;
public:
Events(SherlockEngine *vm);
~Events();
Expand Down
4 changes: 4 additions & 0 deletions engines/sherlock/tattoo/widget_inventory.cpp
Expand Up @@ -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());
Expand Down

0 comments on commit 48f5ef8

Please sign in to comment.