diff options
Diffstat (limited to 'engines/titanic/carry/photograph.cpp')
-rw-r--r-- | engines/titanic/carry/photograph.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/engines/titanic/carry/photograph.cpp b/engines/titanic/carry/photograph.cpp index 92549b3ce5..a7c5d8d095 100644 --- a/engines/titanic/carry/photograph.cpp +++ b/engines/titanic/carry/photograph.cpp @@ -21,9 +21,17 @@ */ #include "titanic/carry/photograph.h" +#include "titanic/core/room_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CPhotograph, CCarry) + ON_MESSAGE(MouseDragStartMsg) + ON_MESSAGE(MouseDragEndMsg) + ON_MESSAGE(PETGainedObjectMsg) + ON_MESSAGE(ActMsg) +END_MESSAGE_MAP() + int CPhotograph::_v1; CPhotograph::CPhotograph() : CCarry(), _field12C(0), _field130(0) { @@ -47,4 +55,43 @@ void CPhotograph::load(SimpleFile *file) { CCarry::load(file); } +bool CPhotograph::MouseDragEndMsg(CMouseDragEndMsg *msg) { + _v1 = 0; + CGameObject *target = msg->_dropTarget; + + if (target && target->getName() != "NavigationComputer") { + warning("TODO: CPhotograph::MouseDragEndMsg"); + } else { + return CCarry::MouseDragEndMsg(msg); + } +} + +bool CPhotograph::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (checkPoint(msg->_mousePos, true, true)) { + _v1 = true; + CActMsg actMsg("PlayerPicksUpPhoto"); + actMsg.execute("Doorbot"); + } + + return CCarry::MouseDragStartMsg(msg); +} + +bool CPhotograph::PETGainedObjectMsg(CPETGainedObjectMsg *msg) { + if (getRoom()->getName() == "Home") { + CActMsg actMsg("PlayerPutsPhotoInPET"); + actMsg.execute("Doorbot"); + } + + return true; +} + +bool CPhotograph::ActMsg(CActMsg *msg) { + if (msg->_action == "BecomeGettable") { + _fieldE0 = 1; + _cursorId = CURSOR_HAND; + } + + return true; +} + } // End of namespace Titanic |