aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control
diff options
context:
space:
mode:
authorPaul Gilbert2017-03-29 21:49:22 -0400
committerPaul Gilbert2017-03-29 21:49:22 -0400
commit3b08987ad298dd4258df44de98fddc620d8a045f (patch)
tree578ced05ad3c43fcdc5d06c0c1d5daf7c3492c34 /engines/titanic/pet_control
parent7492d620b7f619f736b73281dd42411bc55b0752 (diff)
downloadscummvm-rg350-3b08987ad298dd4258df44de98fddc620d8a045f.tar.gz
scummvm-rg350-3b08987ad298dd4258df44de98fddc620d8a045f.tar.bz2
scummvm-rg350-3b08987ad298dd4258df44de98fddc620d8a045f.zip
TITANIC: Add remote icon for skipping nav puzzle
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r--engines/titanic/pet_control/pet_remote.cpp14
-rw-r--r--engines/titanic/pet_control/pet_remote_glyphs.cpp37
-rw-r--r--engines/titanic/pet_control/pet_remote_glyphs.h40
3 files changed, 86 insertions, 5 deletions
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 0293ec93a1..989d74452a 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -50,9 +50,15 @@ static const byte REMOTE_DATA[] = {
GLYPH_SUCCUBUS_DELIVERY,
0x09, 0x01,
GLYPH_SUCCUBUS_DELIVERY,
- 0x0A, 0x02, GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY,
+ 0x0A, 0x02,
+ GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY,
+#if defined(DISABLE_SKIP)
0x0B, 0x01,
GLYPH_NAVIGATION_CONTROLLER,
+#else
+ 0x0B, 0x02,
+ GLYPH_NAVIGATION_CONTROLLER, GLYPH_SKIP_NAVIGATION,
+#endif
0x0C, 0x01,
GLYPH_SUCCUBUS_DELIVERY,
0x0D, 0x01,
@@ -419,6 +425,12 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
glyph = new CNavigationControllerGlyph();
break;
+#if !defined(DISABLE_SKIP)
+ case GLYPH_SKIP_NAVIGATION:
+ glyph = new CSkipNavigationGlyph();
+ break;
+#endif
+
case GLYPH_GOTO_BOTTOM_OF_WELL:
glyph = new CGotoBottomOfWellGlyph();
break;
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 7f52ca7ee9..e9b2094dc8 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -618,4 +618,41 @@ CGotoRestaurantGlyph::CGotoRestaurantGlyph() : CRemoteGotoGlyph("3Pet1stClassRes
g_vm->_strings[GO_TO_1ST_CLASS_RESTAURANT], 1) {
}
+/*------------------------------------------------------------------------*/
+
+bool CSkipNavigationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+ CPetRemoteGlyph::setup(petControl, owner);
+ setDefaults("3PetTV", petControl);
+ if (owner) {
+ _button = getElement(7);
+ }
+
+ return true;
+}
+
+void CSkipNavigationGlyph::draw2(CScreenManager *screenManager) {
+ _button->draw(screenManager);
+}
+
+bool CSkipNavigationGlyph::MouseButtonDownMsg(const Point &pt) {
+ if (_button && _button->MouseButtonDownMsg(pt))
+ return true;
+
+ return false;
+}
+
+bool CSkipNavigationGlyph::MouseButtonUpMsg(const Point &pt) {
+ if (_button && _button->MouseButtonUpMsg(pt)) {
+ CActMsg actMsg("SetDestin");
+ actMsg.execute("CaptainsWheel");
+ return true;
+ }
+
+ return false;
+}
+
+void CSkipNavigationGlyph::getTooltip(CTextControl *text) {
+ text->setText(SKIP_NAVIGATION);
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 0a035ec03a..fc7df8c0d4 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -38,10 +38,10 @@ enum RemoteGlyph {
GLYPH_DEPLOY_WORK_SURFACE = 12, GLYPH_DEPLOY_MINOR_RELAXATION = 13,
GLYPH_DEPLOY_SINK = 14, GLYPH_DEPLOY_MAJOR_STORAGE = 15,
GLYPH_SUCCUBUS_DELIVERY = 16, GLYPH_NAVIGATION_CONTROLLER = 17,
- GLYPH_GOTO_BOTTOM_OF_WELL = 18, GLYPH_GOTO_TOP_OF_WELL = 19,
- GLYPH_GOTO_STATEROOM = 20, GLYPH_GOTO_BAR = 21,
- GLYPH_GOTO_PROMENADE = 22, GLYPH_GOTO_ARBORETUM = 23,
- GLYPH_GOTO_MUSIC_ROOM = 24, GLYPH_GOTO_RESTAURANT = 25
+ GLYPH_SKIP_NAVIGATION = 18, GLYPH_GOTO_BOTTOM_OF_WELL = 19,
+ GLYPH_GOTO_TOP_OF_WELL = 20, GLYPH_GOTO_STATEROOM = 21,
+ GLYPH_GOTO_BAR = 22, GLYPH_GOTO_PROMENADE = 23, GLYPH_GOTO_ARBORETUM = 24,
+ GLYPH_GOTO_MUSIC_ROOM = 25, GLYPH_GOTO_RESTAURANT = 26
};
enum RemoteMessage {
@@ -700,6 +700,38 @@ public:
CGotoRestaurantGlyph();
};
+class CSkipNavigationGlyph : public CPetRemoteGlyph {
+protected:
+ CPetGfxElement *_button;
+public:
+ CSkipNavigationGlyph() : CPetRemoteGlyph(), _button(nullptr) {}
+
+ /**
+ * Setup the glyph
+ */
+ virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+ /**
+ * Handles any secondary drawing of the glyph
+ */
+ virtual void draw2(CScreenManager *screenManager);
+
+ /**
+ * Called for mouse button down messages
+ */
+ virtual bool MouseButtonDownMsg(const Point &pt);
+
+ /**
+ * Handles mouse button up messages
+ */
+ virtual bool MouseButtonUpMsg(const Point &pt);
+
+ /**
+ * Returns the tooltip text for when the glyph is selected
+ */
+ virtual void getTooltip(CTextControl *text);
+};
+
} // End of namespace Titanic
#endif /* TITANIC_PET_REMOTE_GLYPHS_H */