diff options
author | Paul Gilbert | 2017-03-29 22:25:33 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-03-29 22:25:33 -0400 |
commit | 09da42129374f215301d6295cd6b092d1b3e6fee (patch) | |
tree | a0203cfc3bafce605136d0978d9366271bd865dd | |
parent | 119fd5fd34654c4c1af86f6952b6b2e5e94ee927 (diff) | |
download | scummvm-rg350-09da42129374f215301d6295cd6b092d1b3e6fee.tar.gz scummvm-rg350-09da42129374f215301d6295cd6b092d1b3e6fee.tar.bz2 scummvm-rg350-09da42129374f215301d6295cd6b092d1b3e6fee.zip |
TITANIC: Further code for new skip nav button to work correctly
-rw-r--r-- | engines/titanic/pet_control/pet_remote_glyphs.cpp | 5 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.cpp | 5 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.h | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp index e9b2094dc8..b56c2f6854 100644 --- a/engines/titanic/pet_control/pet_remote_glyphs.cpp +++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp @@ -24,6 +24,7 @@ #include "titanic/pet_control/pet_remote.h" #include "titanic/pet_control/pet_control.h" #include "titanic/messages/pet_messages.h" +#include "titanic/star_control/star_control.h" #include "titanic/support/strings.h" #include "titanic/titanic.h" @@ -643,6 +644,10 @@ bool CSkipNavigationGlyph::MouseButtonDownMsg(const Point &pt) { bool CSkipNavigationGlyph::MouseButtonUpMsg(const Point &pt) { if (_button && _button->MouseButtonUpMsg(pt)) { + CPetRemote *remote = static_cast<CPetRemote *>(_owner->getOwner()); + CStarControl *starControl = remote->getPetControl()->getStarControl(); + starControl->forceSolved(); + CActMsg actMsg("SetDestin"); actMsg.execute("CaptainsWheel"); return true; diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp index dbe8b01aa0..881de58f70 100644 --- a/engines/titanic/star_control/star_control.cpp +++ b/engines/titanic/star_control/star_control.cpp @@ -260,6 +260,11 @@ bool CStarControl::isSolved() const { return _starField.isSolved(); } +void CStarControl::forceSolved() { + while (!_starField.isSolved()) + _starField.fn7(); +} + bool CStarControl::canSetStarDestination() const { return _view.canSetStarDestination(); } diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h index 11e6053702..2c314a67a8 100644 --- a/engines/titanic/star_control/star_control.h +++ b/engines/titanic/star_control/star_control.h @@ -78,6 +78,11 @@ public: bool isSolved() const; /** + * Forces the starfield to be solved + */ + void forceSolved(); + + /** * Returns true if a star destination can be set */ bool canSetStarDestination() const; |