SHERLOCK: RT: Fix tooltip display when using inventory item

This commit is contained in:
Paul Gilbert 2015-07-19 18:56:08 -04:00
parent 23471eeb53
commit 48f5ef847f
3 changed files with 7 additions and 0 deletions

View File

@ -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);

View File

@ -59,6 +59,7 @@ public:
bool _oldRightButton;
bool _firstPress;
Common::Stack<Common::KeyState> _pendingKeys;
Common::Point _hotspotPos;
public:
Events(SherlockEngine *vm);
~Events();

View File

@ -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());