aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-28 18:37:20 -0400
committerPaul Gilbert2016-07-15 19:16:33 -0400
commit66a2500928dffba83622d274c37bf26ceda00caf (patch)
treed3f59385d364e9042f9106734e10bc9b0a7bcc1a
parentfa04a6fdf0271f74c45da180b3c6f1ac16bd3a98 (diff)
downloadscummvm-rg350-66a2500928dffba83622d274c37bf26ceda00caf.tar.gz
scummvm-rg350-66a2500928dffba83622d274c37bf26ceda00caf.tar.bz2
scummvm-rg350-66a2500928dffba83622d274c37bf26ceda00caf.zip
TITANIC: Added CTurnOnObject message handlers
-rw-r--r--engines/titanic/core/turn_on_object.cpp21
-rw-r--r--engines/titanic/core/turn_on_object.h5
2 files changed, 22 insertions, 4 deletions
diff --git a/engines/titanic/core/turn_on_object.cpp b/engines/titanic/core/turn_on_object.cpp
index b4ed2b4525..a24843b3bb 100644
--- a/engines/titanic/core/turn_on_object.cpp
+++ b/engines/titanic/core/turn_on_object.cpp
@@ -24,21 +24,36 @@
namespace Titanic {
-CTurnOnObject::CTurnOnObject() : CBackground(), _string3("NULL") {
+BEGIN_MESSAGE_MAP(CTurnOnObject, CBackground)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
+CTurnOnObject::CTurnOnObject() : CBackground(), _msgName("NULL") {
}
void CTurnOnObject::save(SimpleFile *file, int indent) const {
file->writeNumberLine(1, indent);
- file->writeQuotedLine(_string3, indent);
+ file->writeQuotedLine(_msgName, indent);
CBackground::save(file, indent);
}
void CTurnOnObject::load(SimpleFile *file) {
file->readNumber();
- _string3 = file->readString();
+ _msgName = file->readString();
CBackground::load(file);
}
+bool CTurnOnObject::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ return true;
+}
+
+bool CTurnOnObject::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+ CTurnOn turnOn;
+ turnOn.execute(_msgName);
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/core/turn_on_object.h b/engines/titanic/core/turn_on_object.h
index d87e205983..3ac5a897f1 100644
--- a/engines/titanic/core/turn_on_object.h
+++ b/engines/titanic/core/turn_on_object.h
@@ -28,8 +28,11 @@
namespace Titanic {
class CTurnOnObject : public CBackground {
+ DECLARE_MESSAGE_MAP
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
protected:
- CString _string3;
+ CString _msgName;
public:
CLASSDEF
CTurnOnObject();