From 3b08987ad298dd4258df44de98fddc620d8a045f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 29 Mar 2017 21:49:22 -0400 Subject: TITANIC: Add remote icon for skipping nav puzzle --- engines/titanic/pet_control/pet_remote.cpp | 14 +++++++- engines/titanic/pet_control/pet_remote_glyphs.cpp | 37 +++++++++++++++++++++ engines/titanic/pet_control/pet_remote_glyphs.h | 40 ++++++++++++++++++++--- engines/titanic/support/strings.h | 1 + 4 files changed, 87 insertions(+), 5 deletions(-) (limited to 'engines/titanic') 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 */ diff --git a/engines/titanic/support/strings.h b/engines/titanic/support/strings.h index d19386bbbe..65d6550e1e 100644 --- a/engines/titanic/support/strings.h +++ b/engines/titanic/support/strings.h @@ -128,6 +128,7 @@ enum StringId { DEPLOY_MAJOR_STORAGE, SUCCUBUS_DELIVERY_SYSTEM, NAVIGATION_CONTROLLER, + SKIP_NAVIGATION, SUMMON_ELEVATOR, SUMMON_PELLERATOR, GO_TO_BOTTOM_OF_WELL, -- cgit v1.2.3