diff options
author | Paul Gilbert | 2017-08-06 15:25:28 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-08-06 15:25:28 -0400 |
commit | 89457af33e7e1682e6e8a9b9ba758ab2677ec936 (patch) | |
tree | 43d794650b50c935cde0a1f19af91cbcec6f9178 | |
parent | 5a4840ee55fe141cd44ed4d3eb7991bd8adb6ccd (diff) | |
download | scummvm-rg350-89457af33e7e1682e6e8a9b9ba758ab2677ec936.tar.gz scummvm-rg350-89457af33e7e1682e6e8a9b9ba758ab2677ec936.tar.bz2 scummvm-rg350-89457af33e7e1682e6e8a9b9ba758ab2677ec936.zip |
TITANIC: Don't allow movement link to be used in Starfield Puzlze
The scene has an unused right turn link that wasn't used, and is
covered by the starview. Since movement now uses simulated mouse
clicks, the worst result of clicking right arrow is simply that
a star may be accidentally selected. But for cleanliness, it was
best to fix it. It also allowed the creation of code that other
objects in the view can use to override default movement logic,
just in case it's needed.
-rw-r--r-- | engines/titanic/core/view_item.cpp | 10 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.h | 1 |
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; |