aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/core/view_item.cpp10
-rw-r--r--engines/titanic/star_control/star_control.cpp8
-rw-r--r--engines/titanic/star_control/star_control.h1
3 files changed, 18 insertions, 1 deletions
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 19e1a1136b..401553d55d 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -341,7 +341,15 @@ CString CViewItem::getNodeViewName() const {
bool CViewItem::MovementMsg(CMovementMsg *msg) {
Point pt;
- // Iterate through the links to find an appropriate link
+ // First allow any child objects to handle it
+ for (CTreeItem *treeItem = getFirstChild(); treeItem;
+ treeItem = treeItem->scan(this)) {
+ if (msg->execute(treeItem, nullptr, 0))
+ return true;
+ }
+
+ // Iterate through the view's contents to find a link or item
+ // with the appropriate movement action
for (CTreeItem *treeItem = getFirstChild(); treeItem;
treeItem = treeItem->scan(this)) {
CLinkItem *link = dynamic_cast<CLinkItem *>(treeItem);
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 42f81f5f2e..ee296291c5 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -39,6 +39,7 @@ BEGIN_MESSAGE_MAP(CStarControl, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(KeyCharMsg)
ON_MESSAGE(FrameMsg)
+ ON_MESSAGE(MovementMsg)
END_MESSAGE_MAP()
CStarControl::CStarControl() : _enabled(false), _petControl(nullptr),
@@ -276,4 +277,11 @@ void CStarControl::starDestinationSet() {
_view.starDestinationSet();
}
+bool CStarControl::MovementMsg(CMovementMsg *msg) {
+ // The star control view has an unused turn right link hidden
+ // under the star view. For cleanliness, explicitly consume any
+ // movements in the star view so the link is never used
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 776f25afd1..8013eed850 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -36,6 +36,7 @@ class CStarControl : public CGameObject {
bool MouseMoveMsg(CMouseMoveMsg *msg);
bool KeyCharMsg(CKeyCharMsg *msg);
bool FrameMsg(CFrameMsg *msg);
+ bool MovementMsg(CMovementMsg *msg);
private:
bool _enabled;
CStarField _starField;