mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
SHERLOCK: RT: Fix tooltip display when using inventory item
This commit is contained in:
parent
23471eeb53
commit
48f5ef847f
@ -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);
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
bool _oldRightButton;
|
||||
bool _firstPress;
|
||||
Common::Stack<Common::KeyState> _pendingKeys;
|
||||
Common::Point _hotspotPos;
|
||||
public:
|
||||
Events(SherlockEngine *vm);
|
||||
~Events();
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user