aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-24 18:29:45 +0300
committerEugene Sandulenko2013-09-06 14:51:18 +0300
commit1261cd421d176d6caa7230c5cf726b08e04ff25f (patch)
treed965e0a4d38240a20c8bb9e719faf1fea8e200de /engines
parent87488185a82f123387176cb9f72e2c714d088c73 (diff)
downloadscummvm-rg350-1261cd421d176d6caa7230c5cf726b08e04ff25f.tar.gz
scummvm-rg350-1261cd421d176d6caa7230c5cf726b08e04ff25f.tar.bz2
scummvm-rg350-1261cd421d176d6caa7230c5cf726b08e04ff25f.zip
FULLPIPE: Implement CInventory2::getHoveredItem()
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/inventory.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 002c9b9e6b..9384cb2463 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -78,7 +78,7 @@ CInventory2::CInventory2() {
_field_48 = -1;
_scene = 0;
_picture = 0;
- _isInventoryOut = 0;
+ _isInventoryOut = false;
_isLocked = 0;
_topOffset = -65;
}
@@ -273,7 +273,35 @@ int CInventory2::unselectItem(bool flag) {
}
int CInventory2::getHoveredItem(Common::Point *point) {
- warning("STUB: CInventory2::getHoveredItem()");
+ int selId = getSelectedItemId();
+
+ if (point->y <= 20 && !_isInventoryOut && !_isLocked )
+ slideOut();
+
+ if (!selId && point->y >= 55) {
+ if (!_isInventoryOut)
+ return 0;
+
+ if (!_isLocked)
+ slideIn();
+ }
+
+ if (!_isInventoryOut)
+ return 0;
+
+ for (uint i = 0; i < _inventoryIcons.size(); i++) {
+ InventoryIcon *icn = _inventoryIcons[i];
+ if (selId ||
+ point->x < icn->x1 ||
+ point->x > icn->x2 ||
+ point->y < _topOffset + icn->y1 ||
+ point->y > _topOffset + icn->y2) {
+ icn->isMouseHover = 0;
+ } else {
+ icn->isMouseHover = 1;
+ return icn->inventoryItemId;
+ }
+ }
return 0;
}