diff options
author | Paul Gilbert | 2016-04-30 14:55:15 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:37:44 -0400 |
commit | b11033800d1455bd4c35af1126bd4f0cf6b2fb77 (patch) | |
tree | 51798f1e90cf65b73e3bae936b9a157360f6c6c5 /engines/titanic/pet_control/pet_drag_chev.cpp | |
parent | 01989265aa6abd68f2aa5d799d867886c8ed3799 (diff) | |
download | scummvm-rg350-b11033800d1455bd4c35af1126bd4f0cf6b2fb77.tar.gz scummvm-rg350-b11033800d1455bd4c35af1126bd4f0cf6b2fb77.tar.bz2 scummvm-rg350-b11033800d1455bd4c35af1126bd4f0cf6b2fb77.zip |
TITANIC: Implementing PET support widgets
Diffstat (limited to 'engines/titanic/pet_control/pet_drag_chev.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_drag_chev.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp index 3c1569856e..32acf72795 100644 --- a/engines/titanic/pet_control/pet_drag_chev.cpp +++ b/engines/titanic/pet_control/pet_drag_chev.cpp @@ -21,9 +21,16 @@ */ #include "titanic/pet_control/pet_drag_chev.h" +#include "titanic/pet_control/pet_control.h" +#include "titanic/messages/messages.h" +#include "titanic/npcs/succubus.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CPetDragChev, CPetGraphic2) + +END_MESSAGE_MAP() + void CPetDragChev::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); CPetGraphic2::save(file, indent); @@ -34,4 +41,34 @@ void CPetDragChev::load(SimpleFile *file) { CPetGraphic2::load(file); } +bool CPetDragChev::MouseDragStartMsg(CMouseDragStartMsg *msg) { + getName(); + return checkStartDragging(msg); +} + +bool CPetDragChev::MouseDragMoveMsg(CMouseDragMoveMsg *msg) { + dragMove(msg->_mousePos); + return true; +} + +bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) { + if (msg->_dropTarget) { + CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_dropTarget); + + if (succubus) { + CSetChevRoomBits msg(_field54); + msg.execute(succubus); + } else { + CPetControl *petControl = getPetControl(); + if (petControl && petControl->contains(msg->_mousePos) + && msg->_mousePos.x < 528) { + if (petControl->checkDragEnd(this)) + moveToHiddenRoom(); + } + } + } + + return true; +} + } // End of namespace Titanic |