aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/pickup/pick_up_lemon.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-27 12:10:37 -0400
committerPaul Gilbert2016-08-27 12:10:37 -0400
commitc1b6fc3824018118618685fcbfcabe413e865531 (patch)
tree7f8f9e0bd248e7fd6f4fbcbc0e5d2f9c1cb6aa96 /engines/titanic/game/pickup/pick_up_lemon.cpp
parent40ec26b3439eb82e5bf8bff82529c16d34a5ed94 (diff)
downloadscummvm-rg350-c1b6fc3824018118618685fcbfcabe413e865531.tar.gz
scummvm-rg350-c1b6fc3824018118618685fcbfcabe413e865531.tar.bz2
scummvm-rg350-c1b6fc3824018118618685fcbfcabe413e865531.zip
TITANIC: Implemented game pickup classes
Diffstat (limited to 'engines/titanic/game/pickup/pick_up_lemon.cpp')
-rw-r--r--engines/titanic/game/pickup/pick_up_lemon.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/titanic/game/pickup/pick_up_lemon.cpp b/engines/titanic/game/pickup/pick_up_lemon.cpp
index 772114f76c..5109c36304 100644
--- a/engines/titanic/game/pickup/pick_up_lemon.cpp
+++ b/engines/titanic/game/pickup/pick_up_lemon.cpp
@@ -21,9 +21,15 @@
*/
#include "titanic/game/pickup/pick_up_lemon.h"
+#include "titanic/core/project_item.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CPickUpLemon, CPickUp)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(MouseDragStartMsg)
+END_MESSAGE_MAP()
+
void CPickUpLemon::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CPickUp::save(file, indent);
@@ -34,4 +40,23 @@ void CPickUpLemon::load(SimpleFile *file) {
CPickUp::load(file);
}
+bool CPickUpLemon::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ return true;
+}
+
+bool CPickUpLemon::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+ if (!checkStartDragging(msg))
+ return true;
+ if (!_enabled)
+ return false;
+
+ CVisibleMsg visibleMsg;
+ visibleMsg.execute("Lemon");
+ CPassOnDragStartMsg passMsg(msg->_mousePos, 1);
+ passMsg.execute("Lemon");
+
+ msg->_dragItem = getRoot()->findByName("Lemon");
+ return true;
+}
+
} // End of namespace Titanic