[Scummvm-git-logs] scummvm master -> 7a1b35212bf44736104dc202d1f23e71bfdc4cc6
dreammaster
dreammaster at scummvm.org
Sat Sep 9 03:11:30 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7a1b35212b TITANIC: Keep highlighted inventory items animating when changing room
Commit: 7a1b35212bf44736104dc202d1f23e71bfdc4cc6
https://github.com/scummvm/scummvm/commit/7a1b35212bf44736104dc202d1f23e71bfdc4cc6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-08T21:11:22-04:00
Commit Message:
TITANIC: Keep highlighted inventory items animating when changing room
Changed paths:
engines/titanic/pet_control/pet_control.cpp
engines/titanic/pet_control/pet_glyphs.h
engines/titanic/pet_control/pet_inventory.cpp
engines/titanic/pet_control/pet_inventory.h
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index a86a72f..b329162 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 6229d17..8f335f8 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 b2f530c..0f9f253 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 dc85b31..32f5eb4 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
*/
More information about the Scummvm-git-logs
mailing list