diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/pet_control/pet_remote.cpp | 7 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_remote_glyphs.cpp | 22 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_remote_glyphs.h | 41 |
3 files changed, 57 insertions, 13 deletions
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp index dbb912277d..9277f81610 100644 --- a/engines/titanic/pet_control/pet_remote.cpp +++ b/engines/titanic/pet_control/pet_remote.cpp @@ -73,7 +73,8 @@ static const byte REMOTE_DATA[] = { 0x1C, 0x00, 0x1D, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10, 0x1E, 0x0C, - GLYPH_DEPLOY_FLORAL, GLYPH_DEPLOY_RELAXATION, 0x07, 0x08, + GLYPH_DEPLOY_FLORAL, GLYPH_DEPLOY_RELAXATION, GLYPH_DEPLOY_COMFORT, + 0x08, GLYPH_ENTERTAINMENT_DEVICE, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x1F, 0x01, 0x10, 0x20, 0x02, @@ -338,6 +339,10 @@ bool CPetRemote::loadGlyph(int glyphIndex) { glyph = new CDeployRelaxationGlyph(); break; + case GLYPH_DEPLOY_COMFORT: + glyph = new CDeployComfortGlyph(); + break; + default: break; } diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp index a41f6431a6..9ca69869fb 100644 --- a/engines/titanic/pet_control/pet_remote_glyphs.cpp +++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp @@ -97,17 +97,17 @@ void CToggleRemoteGlyph::draw2(CScreenManager *screenManager) { _gfxElement->draw(screenManager); } -bool CToggleRemoteGlyph::elementMouseButtonDownMsg(const Point &pt) { +bool CToggleRemoteGlyph::elementMouseButtonDownMsg(const Point &pt, int petNum) { return _gfxElement->MouseButtonDownMsg(pt); } -bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt) { +bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt, int petNum) { if (!_gfxElement->MouseButtonUpMsg(pt)) return false; CTreeItem *target = getPetControl()->_remoteTarget; if (target) { - CPETActivateMsg msg("SGTSelector", -1); + CPETActivateMsg msg("SGTSelector", petNum); msg.execute(target); _flag = !_flag; _gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED); @@ -200,7 +200,7 @@ void CEntertainmentDeviceGlyph::draw2(CScreenManager *screenManager) { bool CEntertainmentDeviceGlyph::MouseButtonDownMsg(const Point &pt) { CString viewName = getPetControl()->getFullViewName(); if (viewName == "SGTState.Node 1.S") { - return elementMouseButtonDownMsg(pt); + return elementMouseButtonDownMsg(pt, 4); } else if (viewName == "SGTState.Node 4.E") { return _gfxElement->MouseButtonDownMsg(pt) || _gfxElement2->MouseButtonDownMsg(pt) @@ -213,7 +213,7 @@ bool CEntertainmentDeviceGlyph::MouseButtonDownMsg(const Point &pt) { bool CEntertainmentDeviceGlyph::MouseButtonUpMsg(const Point &pt) { CString viewName = getPetControl()->getFullViewName(); if (viewName == "SGTState.Node 1.S") { - return elementMouseButtonUpMsg(pt); + return elementMouseButtonUpMsg(pt, 4); } else if (viewName == "SGTState.Node 4.E") { if (_gfxElement->MouseButtonUpMsg(pt)) { _flag2 = !_flag2; @@ -315,4 +315,16 @@ void CDeployRelaxationGlyph::getTooltip(CPetText *text) { text->setText("Deploy fully recumbent relaxation device"); } +/*------------------------------------------------------------------------*/ + +bool CDeployComfortGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) { + CToggleRemoteGlyph::setup(petControl, owner); + setDefaults("3PetToilet", petControl); + return true; +} + +void CDeployComfortGlyph::getTooltip(CPetText *text) { + text->setText("Deploy comfort workstation"); +} + } // 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 09c626414c..eb235bc957 100644 --- a/engines/titanic/pet_control/pet_remote_glyphs.h +++ b/engines/titanic/pet_control/pet_remote_glyphs.h @@ -32,7 +32,7 @@ enum RemoteGlyph { GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1, GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3, GLYPH_OPERATE_LIGHTS = 4, GLYPH_DEPLOY_FLORAL = 5, - GLYPH_DEPLOY_RELAXATION = 6 + GLYPH_DEPLOY_RELAXATION = 6, GLYPH_DEPLOY_COMFORT = 7 }; enum RemoteMessage { @@ -130,12 +130,12 @@ public: /** * Called for mouse button down messages to the default element */ - bool elementMouseButtonDownMsg(const Point &pt); + bool elementMouseButtonDownMsg(const Point &pt, int petNum); /** * Called for mouse button up messages to the default element */ - bool elementMouseButtonUpMsg(const Point &pt); + bool elementMouseButtonUpMsg(const Point &pt, int petNum); }; class CSummonElevatorGlyph : public CBasicRemoteGlyph { @@ -263,14 +263,14 @@ public: * Called for mouse button down messages */ virtual bool MouseButtonDownMsg(const Point &pt) { - return elementMouseButtonDownMsg(pt); + return elementMouseButtonDownMsg(pt, 0); } /** * Handles mouse button up messages */ virtual bool MouseButtonUpMsg(const Point &pt) { - return elementMouseButtonUpMsg(pt); + return elementMouseButtonUpMsg(pt, 0); } /** @@ -282,6 +282,33 @@ public: class CDeployRelaxationGlyph : public CToggleRemoteGlyph { public: /** + * Setup the glyph + */ + virtual bool setup(CPetControl *petControl, CPetGlyphs *owner); + + /** + * Called for mouse button down messages + */ + virtual bool MouseButtonDownMsg(const Point &pt) { + return elementMouseButtonDownMsg(pt, 1); + } + + /** + * Handles mouse button up messages + */ + virtual bool MouseButtonUpMsg(const Point &pt) { + return elementMouseButtonUpMsg(pt, 1); + } + + /** + * Returns the tooltip text for when the glyph is selected + */ + virtual void getTooltip(CPetText *text); +}; + +class CDeployComfortGlyph : public CToggleRemoteGlyph { +public: + /** * Setup the glyph */ virtual bool setup(CPetControl *petControl, CPetGlyphs *owner); @@ -290,14 +317,14 @@ public: * Called for mouse button down messages */ virtual bool MouseButtonDownMsg(const Point &pt) { - return elementMouseButtonDownMsg(pt); + return elementMouseButtonDownMsg(pt, 2); } /** * Handles mouse button up messages */ virtual bool MouseButtonUpMsg(const Point &pt) { - return elementMouseButtonUpMsg(pt); + return elementMouseButtonUpMsg(pt, 2); } /** |