aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_remote_glyphs.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-02 22:23:21 -0400
committerPaul Gilbert2016-07-10 16:38:15 -0400
commit6166c33734efdeabca0fa9d3eeda34389af6b79b (patch)
treefff43e1b69aa5466eb2b690efc217110598fc246 /engines/titanic/pet_control/pet_remote_glyphs.cpp
parent8551f08d0d006b0a2be483420e8920be501d1d55 (diff)
downloadscummvm-rg350-6166c33734efdeabca0fa9d3eeda34389af6b79b.tar.gz
scummvm-rg350-6166c33734efdeabca0fa9d3eeda34389af6b79b.tar.bz2
scummvm-rg350-6166c33734efdeabca0fa9d3eeda34389af6b79b.zip
TITANIC: Implemented more PET Remote glyph classes
Diffstat (limited to 'engines/titanic/pet_control/pet_remote_glyphs.cpp')
-rw-r--r--engines/titanic/pet_control/pet_remote_glyphs.cpp94
1 files changed, 94 insertions, 0 deletions
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