diff options
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_glyphs.h | 5 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory.h | 5 |
4 files changed, 19 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index a86a72f99d..b3291623c3 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -182,6 +182,7 @@ void CPetControl::enterNode(CNodeItem *node) { void CPetControl::enterRoom(CRoomItem *room) { _rooms.enterRoom(room); _remote.enterRoom(room); + _inventory.enterRoom(room); } void CPetControl::resetRemoteTarget() { diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h index 6229d17994..8f335f882b 100644 --- a/engines/titanic/pet_control/pet_glyphs.h +++ b/engines/titanic/pet_control/pet_glyphs.h @@ -476,6 +476,11 @@ public: bool isGlyphHighlighted(const CPetGlyph *glyph) const; /** + * Returns the highlighted index, if any + */ + int getHighlightIndex() const { return _highlightIndex; } + + /** * Get the top-left position of the currently highlighted glyph */ Point getHighlightedGlyphPos() const; diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp index b2f530c5fa..0f9f253cb0 100644 --- a/engines/titanic/pet_control/pet_inventory.cpp +++ b/engines/titanic/pet_control/pet_inventory.cpp @@ -71,6 +71,14 @@ void CPetInventory::changed(int changeType) { } } +void CPetInventory::enterRoom(CRoomItem *room) { + int index = _items.getHighlightIndex(); + if (index != -1) { + _items.resetHighlight(); + _items.highlight(index); + } +} + bool CPetInventory::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return _items.MouseButtonDownMsg(msg->_mousePos); } diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h index dc85b31420..32f5eb4b12 100644 --- a/engines/titanic/pet_control/pet_inventory.h +++ b/engines/titanic/pet_control/pet_inventory.h @@ -86,6 +86,11 @@ public: virtual void changed(int changeType); /** + * Called when a new room is entered + */ + virtual void enterRoom(CRoomItem *room); + + /** * Following are handlers for the various messages that the PET can * pass onto the currently active section/area */ |