diff options
author | Paul Gilbert | 2016-05-02 22:23:21 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:38:15 -0400 |
commit | 6166c33734efdeabca0fa9d3eeda34389af6b79b (patch) | |
tree | fff43e1b69aa5466eb2b690efc217110598fc246 /engines | |
parent | 8551f08d0d006b0a2be483420e8920be501d1d55 (diff) | |
download | scummvm-rg350-6166c33734efdeabca0fa9d3eeda34389af6b79b.tar.gz scummvm-rg350-6166c33734efdeabca0fa9d3eeda34389af6b79b.tar.bz2 scummvm-rg350-6166c33734efdeabca0fa9d3eeda34389af6b79b.zip |
TITANIC: Implemented more PET Remote glyph classes
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/messages/messages.h | 14 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_remote.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_remote_glyphs.cpp | 94 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_remote_glyphs.h | 80 |
4 files changed, 186 insertions, 16 deletions
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h index 4c8ccaf43a..d64972c40d 100644 --- a/engines/titanic/messages/messages.h +++ b/engines/titanic/messages/messages.h @@ -180,19 +180,6 @@ public: } }; -class CTransportMsg : public CMessage { -public: - CString _string; - int _value1, _value2; -public: - CLASSDEF - CTransportMsg() : _value1(0), _value2(0) {} - - static bool isSupportedBy(const CTreeItem *item) { - return supports(item, _type); - } -}; - MESSAGE1(CTimeMsg, uint, _ticks, 0); class CTimerMsg : public CTimeMsg { @@ -350,6 +337,7 @@ MESSAGE1(CTimeDilationMsg, int, value, 0); MESSAGE0(CTitleSequenceEndedMsg); MESSAGE0(CTransitMsg); MESSAGE1(CTranslateObjectMsg, Point, delta, Point()); +MESSAGE3(CTransportMsg, CString, roomName, "", int, value1, 0, int, value2, 0); MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0); MESSAGE1(CTriggerNPCEvent, int, value, 0); MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0); diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp index 6dc7a1a12f..f2062aff25 100644 --- a/engines/titanic/pet_control/pet_remote.cpp +++ b/engines/titanic/pet_control/pet_remote.cpp @@ -51,7 +51,8 @@ static const byte REMOTE_DATA[] = { 0x09, 0x01, GLYPH_SUCCUBUS_DELIVERY, 0x0A, 0x02, GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY, - 0x0B, 0x01, 0x11, + 0x0B, 0x01, + GLYPH_NAVIGATION_CONTROLLER, 0x0C, 0x01, GLYPH_SUCCUBUS_DELIVERY, 0x0D, 0x01, @@ -59,7 +60,8 @@ static const byte REMOTE_DATA[] = { 0x0E, 0x00, 0x0F, 0x01, GLYPH_TELEVISION_CONTROL, - 0x10, 0x03, 0x12, 0x14, 0x13, + 0x10, 0x03, + GLYPH_BOTTOM_OF_WELL, 0x14, 0x13, 0x11, 0x01, GLYPH_SUCCUBUS_DELIVERY, 0x12, 0x00, @@ -390,6 +392,14 @@ bool CPetRemote::loadGlyph(int glyphIndex) { glyph = new CSuccubusDeliveryGlyph(); break; + case GLYPH_NAVIGATION_CONTROLLER: + glyph = new CNavigationControllerGlyph(); + break; + + case GLYPH_BOTTOM_OF_WELL: + glyph = new CBottomOfWellGlyph(); + break; + default: break; } diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp index 460907a99c..00ddf421cf 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/titanic.h" namespace Titanic { @@ -118,6 +119,47 @@ bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt, int petNum) { /*------------------------------------------------------------------------*/ +bool CRemoteGotoGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) { + CPetRemoteGlyph::setup(petControl, owner); + + if (owner) + _gfxElement = getElement(7); + + return true; +} + +void CRemoteGotoGlyph::draw2(CScreenManager *screenManager) { + if (_gfxElement) + _gfxElement->draw(screenManager); +} + +bool CRemoteGotoGlyph::MouseButtonDownMsg(const Point &pt) { + return _gfxElement && _gfxElement->MouseButtonDownMsg(pt); +} + +bool CRemoteGotoGlyph::MouseButtonUpMsg(const Point &pt) { + if (!_gfxElement || !_gfxElement->MouseButtonUpMsg(pt)) + return false; + + CPetControl *petControl = getPetControl(); + if (petControl) { + CGameManager *gameManager = petControl->getGameManager(); + + if (gameManager) { + CRoomItem *room = gameManager->getRoom(); + + if (room) { + CTransportMsg msg(g_vm->_roomNames[_roomIndex], 1, 0); + msg.execute(room); + } + } + } + + return true; +} + +/*------------------------------------------------------------------------*/ + bool CTelevisionControlGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) { CPetRemoteGlyph::setup(petControl, owner); setDefaults("3PetTV", petControl); @@ -471,4 +513,56 @@ void CSuccubusDeliveryGlyph::getTooltip(CPetText *text) { text->setText("Succ-U-Bus delivery system control"); } +/*------------------------------------------------------------------------*/ + +bool CNavigationControllerGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) { + CPetRemoteGlyph::setup(petControl, owner); + setDefaults("3PetStarField", petControl); + + if (owner) + _gfxElement = getElement(0); + + return true; +} + +void CNavigationControllerGlyph::draw2(CScreenManager *screenManager) { + _gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED); + _gfxElement->draw(screenManager); +} + +bool CNavigationControllerGlyph::MouseButtonDownMsg(const Point &pt) { + return _gfxElement->MouseButtonDownMsg(pt); +} + +bool CNavigationControllerGlyph::MouseButtonUpMsg(const Point &pt) { + if (!_gfxElement->MouseButtonUpMsg(pt)) + return false; + + _flag = !_flag; + CTreeItem *target = getPetControl()->_remoteTarget; + if (target) { + CPETHelmetOnOffMsg msg; + msg.execute(target); + } + + return true; +} + +void CNavigationControllerGlyph::getTooltip(CPetText *text) { + text->setText("Navigation controller"); +} + +/*------------------------------------------------------------------------*/ + +bool CBottomOfWellGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) { + CPetRemoteGlyph::setup(petControl, owner); + setDefaults("3PetBotOfWell", petControl); + + return true; +} + +void CBottomOfWellGlyph::getTooltip(CPetText *text) { + text->setText("Go to the Bottom of the Well"); +} + } // 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 0043ea97d8..e6dfc115c0 100644 --- a/engines/titanic/pet_control/pet_remote_glyphs.h +++ b/engines/titanic/pet_control/pet_remote_glyphs.h @@ -37,7 +37,8 @@ enum RemoteGlyph { GLYPH_INFLATE_RELAXATION = 10, GLYPH_DEPLOY_MAINTENANCE = 11, GLYPH_DEPLOY_WORK_SURFACE = 12, GLYPH_DEPLOY_MINOR_RELAXATION = 13, GLYPH_DEPLOY_SINK = 14, GLYPH_DEPLOY_MAJOR_STORAGE = 15, - GLYPH_SUCCUBUS_DELIVERY = 16 + GLYPH_SUCCUBUS_DELIVERY = 16, GLYPH_NAVIGATION_CONTROLLER = 17, + GLYPH_BOTTOM_OF_WELL = 18 }; enum RemoteMessage { @@ -143,6 +144,34 @@ public: bool elementMouseButtonUpMsg(const Point &pt, int petNum); }; +class CRemoteGotoGlyph : public CPetRemoteGlyph { +protected: + int _roomIndex; + CPetGfxElement *_gfxElement; +public: + CRemoteGotoGlyph() : CPetRemoteGlyph(), _gfxElement(nullptr), _roomIndex(21) {} + + /** + * 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); +}; + class CSummonElevatorGlyph : public CBasicRemoteGlyph { public: CSummonElevatorGlyph() : CBasicRemoteGlyph( @@ -587,6 +616,55 @@ public: virtual void getTooltip(CPetText *text); }; +class CNavigationControllerGlyph : public CPetRemoteGlyph { +private: + bool _flag; + CPetGfxElement *_gfxElement; +public: + CNavigationControllerGlyph() : CPetRemoteGlyph(), + _flag(false), _gfxElement(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(CPetText *text); +}; + +class CBottomOfWellGlyph : public CRemoteGotoGlyph { +public: + CBottomOfWellGlyph() : CRemoteGotoGlyph() {} + + /** + * Setup the glyph + */ + virtual bool setup(CPetControl *petControl, CPetGlyphs *owner); + + /** + * Returns the tooltip text for when the glyph is selected + */ + virtual void getTooltip(CPetText *text); +}; + } // End of namespace Titanic #endif /* TITANIC_PET_REMOTE_GLYPHS_H */ |