mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-19 10:41:55 +00:00
STARK: Show the mouse hint for inventory items
Not an accurate implementation, but good enough for now.
This commit is contained in:
parent
3150543c9a
commit
eb173b63af
@ -162,6 +162,10 @@ void GameInterface::itemDoActionAt(Resources::ItemVisual *item, uint32 action, c
|
||||
item->doAction(action, hotspotIndex);
|
||||
}
|
||||
|
||||
Common::String GameInterface::getItemTitle(Resources::ItemVisual *item) {
|
||||
return item->getHotspotTitle(0);
|
||||
}
|
||||
|
||||
Common::String GameInterface::getItemTitleAt(Resources::ItemVisual *item, const Common::Point &pos) {
|
||||
int32 hotspotIndex = item->getHotspotIndexForPoint(pos);
|
||||
return item->getHotspotTitle(hotspotIndex);
|
||||
|
@ -65,6 +65,7 @@ public:
|
||||
void itemDoActionAt(Resources::ItemVisual *item, uint32 action, const Common::Point &position);
|
||||
|
||||
/** Get the item's name */
|
||||
Common::String getItemTitle(Resources::ItemVisual *object);
|
||||
Common::String getItemTitleAt(Resources::ItemVisual *object, const Common::Point &pos);
|
||||
|
||||
/** List the actions available for an item in the current game state */
|
||||
|
@ -179,6 +179,13 @@ void InventoryWindow::onMouseMove(const Common::Point &pos) {
|
||||
_cursor->setCursorImage(cursorImage);
|
||||
_cursor->setFading(hoveredItemAction == _selectedInventoryItem);
|
||||
}
|
||||
|
||||
if (hoveredItem) {
|
||||
Common::String hint = StarkGameInterface->getItemTitle(hoveredItem);
|
||||
_cursor->setMouseHint(hint);
|
||||
} else {
|
||||
_cursor->setMouseHint("");
|
||||
}
|
||||
}
|
||||
|
||||
void InventoryWindow::onClick(const Common::Point &pos) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user