diff options
author | Paul Gilbert | 2016-04-30 17:16:22 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:37:48 -0400 |
commit | ecb14e9bc235df216fdcb8426688b455043f2ad0 (patch) | |
tree | 6165447f4b163e00901ecc55d0cf36709ace4619 | |
parent | b013d10d8f44e9f611ff205304f451e4e35ee14e (diff) | |
download | scummvm-rg350-ecb14e9bc235df216fdcb8426688b455043f2ad0.tar.gz scummvm-rg350-ecb14e9bc235df216fdcb8426688b455043f2ad0.tar.bz2 scummvm-rg350-ecb14e9bc235df216fdcb8426688b455043f2ad0.zip |
TITANIC: Implement more NavHelmet section
-rw-r--r-- | engines/titanic/pet_control/pet_control.h | 2 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_nav_helmet.cpp | 46 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_nav_helmet.h | 4 |
3 files changed, 39 insertions, 13 deletions
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h index 96c46a6845..7ebdbbdfa2 100644 --- a/engines/titanic/pet_control/pet_control.h +++ b/engines/titanic/pet_control/pet_control.h @@ -62,7 +62,6 @@ private: CPetControlSub7 _sub7; CPetFrame _frame; CString _activeNPCName; - CTreeItem *_treeItem2; CString _string2; CRoomItem *_hiddenRoom; Rect _drawBounds; @@ -114,6 +113,7 @@ protected: public: PetArea _currentArea; CTreeItem *_activeNPC; + CTreeItem *_treeItem2; public: CLASSDEF CPetControl(); diff --git a/engines/titanic/pet_control/pet_nav_helmet.cpp b/engines/titanic/pet_control/pet_nav_helmet.cpp index 13f1989b64..7697df40f6 100644 --- a/engines/titanic/pet_control/pet_nav_helmet.cpp +++ b/engines/titanic/pet_control/pet_nav_helmet.cpp @@ -22,12 +22,13 @@ #include "titanic/pet_control/pet_nav_helmet.h" #include "titanic/pet_control/pet_control.h" +#include "titanic/messages/pet_messages.h" namespace Titanic { CPetNavHelmet::CPetNavHelmet() : _field98(0), _field9C(0), _fieldA0(0), _field18C(0), - _field20C(1), _field210(0), _rect1(22, 352, 598, 478) { + _photoOn(true), _field210(0), _rect1(22, 352, 598, 478) { } bool CPetNavHelmet::setup(CPetControl *petControl) { @@ -40,8 +41,8 @@ bool CPetNavHelmet::reset() { if (_petControl) { _val1.setup(MODE_UNSELECTED, "3PetStarField", _petControl); _val2.setup(MODE_UNSELECTED, "HomePhotoOnOff", _petControl); - _val3.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl); - _val3.setup(MODE_SELECTED, "3PetSetDestin1", _petControl); + _setDestination.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl); + _setDestination.setup(MODE_SELECTED, "3PetSetDestin1", _petControl); _val4.setup(MODE_UNSELECTED, "3PetStarCtrl", _petControl); _leds[0].setup(MODE_UNSELECTED, "LEDOff1", _petControl); @@ -62,13 +63,13 @@ bool CPetNavHelmet::reset() { void CPetNavHelmet::draw(CScreenManager *screenManager) { _petControl->drawSquares(screenManager, 2); - if (_field20C) { + if (_photoOn) { _val2.draw(screenManager); } else { _val4.draw(screenManager); } - _val3.draw(screenManager); + _setDestination.draw(screenManager); drawButton(_field98, 0, screenManager); drawButton(_field9C, 2, screenManager); drawButton(_fieldA0, 4, screenManager); @@ -76,11 +77,36 @@ void CPetNavHelmet::draw(CScreenManager *screenManager) { } bool CPetNavHelmet::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { - return false; + if (!_petControl->_treeItem2) + return false; + + if (_val1.MouseButtonDownMsg(msg->_mousePos)) { + CPETHelmetOnOffMsg helmetMsg; + helmetMsg.execute(_petControl->_treeItem2); + } else if (_val2.MouseButtonDownMsg(msg->_mousePos)) { + if (_field210) { + _photoOn = !_photoOn; + CPETPhotoOnOffMsg photoMsg; + photoMsg.execute(_petControl->_treeItem2); + } else { + _petControl->displayMessage("Please supply Galactic reference material."); + } + } else if (_setDestination.MouseButtonDownMsg(msg->_mousePos)) { + warning("TODO: CPetNavHelmet::MouseButtonDownMsg"); + } + + return true; } bool CPetNavHelmet::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { - return false; + if (!_petControl->_treeItem2 || !_setDestination.MouseButtonUpMsg(msg->_mousePos)) + return false; + + if (_petControl) { + warning("TODO: CPetNavHelmet::MouseButtonUpMsg"); + } + + return true; } bool CPetNavHelmet::isValid(CPetControl *petControl) { @@ -89,7 +115,7 @@ bool CPetNavHelmet::isValid(CPetControl *petControl) { void CPetNavHelmet::load(SimpleFile *file, int param) { if (!param) { - _field20C = file->readNumber(); + _photoOn = file->readNumber(); _field210 = file->readNumber(); } } @@ -99,7 +125,7 @@ void CPetNavHelmet::postLoad() { } void CPetNavHelmet::save(SimpleFile *file, int indent) const { - file->writeNumberLine(_field20C, indent); + file->writeNumberLine(_photoOn, indent); file->writeNumberLine(_field210, indent); } @@ -133,7 +159,7 @@ bool CPetNavHelmet::setupControl(CPetControl *petControl) { r = Rect(0, 0, 157, 51); r.translate(224, 33); r.translate(20, 350); - _val3.setBounds(r); + _setDestination.setBounds(r); r = Rect(0, 0, 580, 15); r.translate(32, 445); diff --git a/engines/titanic/pet_control/pet_nav_helmet.h b/engines/titanic/pet_control/pet_nav_helmet.h index f47520d548..09504a1b27 100644 --- a/engines/titanic/pet_control/pet_nav_helmet.h +++ b/engines/titanic/pet_control/pet_nav_helmet.h @@ -33,7 +33,7 @@ class CPetNavHelmet : public CPetSection { private: CPetGfxElement _val1; CPetGfxElement _val2; - CPetGfxElement _val3; + CPetGfxElement _setDestination; CPetGfxElement _val4; int _field98; int _field9C; @@ -42,7 +42,7 @@ private: Rect _rect1; int _field18C; CPetText _text; - int _field20C; + bool _photoOn; int _field210; private: /** |