diff options
author | Paul Gilbert | 2016-08-21 21:41:48 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-21 21:41:48 -0400 |
commit | e7d0047b5334bef6688a5f81c200630a58ff89c4 (patch) | |
tree | 62fb8f5e0a453d67674e304b4f8102d93d5cba02 /engines/titanic/game/get_lift_eye2.cpp | |
parent | 9ebd75742eb3a4fac4f6ff3ae421ec67be1f28eb (diff) | |
download | scummvm-rg350-e7d0047b5334bef6688a5f81c200630a58ff89c4.tar.gz scummvm-rg350-e7d0047b5334bef6688a5f81c200630a58ff89c4.tar.bz2 scummvm-rg350-e7d0047b5334bef6688a5f81c200630a58ff89c4.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/game/get_lift_eye2.cpp')
-rw-r--r-- | engines/titanic/game/get_lift_eye2.cpp | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp index 7747f7b0c2..914f306f0e 100644 --- a/engines/titanic/game/get_lift_eye2.cpp +++ b/engines/titanic/game/get_lift_eye2.cpp @@ -21,34 +21,80 @@ */ #include "titanic/game/get_lift_eye2.h" +#include "titanic/game/transport/lift.h" +#include "titanic/core/project_item.h" +#include "titanic/pet_control/pet_control.h" namespace Titanic { -CString *CGetLiftEye2::_v1; +BEGIN_MESSAGE_MAP(CGetLiftEye2, CGameObject) + ON_MESSAGE(ActMsg) + ON_MESSAGE(EnterRoomMsg) + ON_MESSAGE(VisibleMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + +CString *CGetLiftEye2::_destObject; void CGetLiftEye2::init() { - _v1 = new CString(); + _destObject = new CString(); } void CGetLiftEye2::deinit() { - delete _v1; + delete _destObject; } void CGetLiftEye2::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(*_v1, indent); + file->writeQuotedLine(*_destObject, indent); CGameObject::save(file, indent); } void CGetLiftEye2::load(SimpleFile *file) { file->readNumber(); - *_v1 = file->readString(); + *_destObject = file->readString(); CGameObject::load(file); } +bool CGetLiftEye2::ActMsg(CActMsg *msg) { + *_destObject = msg->_action; + setVisible(true); + return true; +} + bool CGetLiftEye2::EnterRoomMsg(CEnterRoomMsg *msg) { - warning("CGetLiftEye2::handleEvent"); + CPetControl *pet = getPetControl(); + if (pet->getRoomsElevatorNum() == 4 && CLift::_v1 == 1 && !CLift::_v6) { + _cursorId = CURSOR_HAND; + setVisible(true); + } else { + _cursorId = CURSOR_ARROW; + setVisible(false); + } + return true; } +bool CGetLiftEye2::VisibleMsg(CVisibleMsg *msg) { + setVisible(true); + _cursorId = CURSOR_HAND; + return true; +} + +bool CGetLiftEye2::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (checkPoint(msg->_mousePos, false, true)) { + _cursorId = CURSOR_ARROW; + setVisible(false); + CActMsg actMsg("EyeNotHead"); + actMsg.execute(*_destObject); + CPassOnDragStartMsg dragMsg(msg->_mousePos, 1); + dragMsg.execute(*_destObject); + + msg->_dragItem = getRoot()->findByName(*_destObject); + return true; + } else { + return false; + } +} + } // End of namespace Titanic |