aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/gfx
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-28 11:29:23 -0400
committerPaul Gilbert2016-08-28 11:29:23 -0400
commit56c2ef9efc966286eefa451eba6f5acb1f58886f (patch)
tree6f856e9e387c9e61c53ad3df71fd2e808cc6306e /engines/titanic/gfx
parent1dcfe25808164c5f2540662028862ac8a0e56831 (diff)
downloadscummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.tar.gz
scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.tar.bz2
scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.zip
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/gfx')
-rw-r--r--engines/titanic/gfx/slider_button.cpp43
-rw-r--r--engines/titanic/gfx/slider_button.h6
-rw-r--r--engines/titanic/gfx/status_change_button.cpp11
-rw-r--r--engines/titanic/gfx/status_change_button.h2
4 files changed, 62 insertions, 0 deletions
diff --git a/engines/titanic/gfx/slider_button.cpp b/engines/titanic/gfx/slider_button.cpp
index 0633158e97..b3dbbed08f 100644
--- a/engines/titanic/gfx/slider_button.cpp
+++ b/engines/titanic/gfx/slider_button.cpp
@@ -24,6 +24,14 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CSliderButton, CSTButton)
+ ON_MESSAGE(MouseButtonUpMsg)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(MouseDragMoveMsg)
+ ON_MESSAGE(StatusChangeMsg)
+ ON_MESSAGE(EnterViewMsg)
+END_MESSAGE_MAP()
+
CSliderButton::CSliderButton() : CSTButton(), _field114(0),
_field118(0), _field11C(0) {
}
@@ -48,4 +56,39 @@ void CSliderButton::load(SimpleFile *file) {
CSTButton::load(file);
}
+bool CSliderButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+ _pos1 = msg->_mousePos;
+ CStatusChangeMsg changeMsg;
+ changeMsg.execute(this);
+ return true;
+}
+
+bool CSliderButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ _pos1 = msg->_mousePos;
+ return true;
+}
+
+bool CSliderButton::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+ _pos1 = msg->_mousePos;
+ if (_field118) {
+ CStatusChangeMsg changeMsg;
+ changeMsg.execute(this);
+ }
+
+ return true;
+}
+
+bool CSliderButton::StatusChangeMsg(CStatusChangeMsg *msg) {
+ CStatusChangeMsg changeMsg;
+ changeMsg._oldStatus = _currentStatus;
+ _currentStatus = (_pos1.y - _bounds.top) / _field11C;
+ changeMsg._newStatus = _currentStatus;
+ changeMsg.execute(_actionTarget);
+ return true;
+}
+
+bool CSliderButton::EnterViewMsg(CEnterViewMsg *msg) {
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/gfx/slider_button.h b/engines/titanic/gfx/slider_button.h
index 398290bb05..18ebbae3db 100644
--- a/engines/titanic/gfx/slider_button.h
+++ b/engines/titanic/gfx/slider_button.h
@@ -28,6 +28,12 @@
namespace Titanic {
class CSliderButton : public CSTButton {
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
+ bool StatusChangeMsg(CStatusChangeMsg *msg);
+ bool EnterViewMsg(CEnterViewMsg *msg);
private:
int _field114;
int _field118;
diff --git a/engines/titanic/gfx/status_change_button.cpp b/engines/titanic/gfx/status_change_button.cpp
index 6644247ff2..e38f1ee07e 100644
--- a/engines/titanic/gfx/status_change_button.cpp
+++ b/engines/titanic/gfx/status_change_button.cpp
@@ -24,6 +24,10 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CStatusChangeButton, CSTButton)
+ ON_MESSAGE(MouseButtonDownMsg)
+END_MESSAGE_MAP()
+
CStatusChangeButton::CStatusChangeButton() : CSTButton() {
}
@@ -37,4 +41,11 @@ void CStatusChangeButton::load(SimpleFile *file) {
CSTButton::load(file);
}
+bool CStatusChangeButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ CStatusChangeMsg changeMsg;
+ changeMsg._newStatus = _statusInc;
+ changeMsg.execute(_actionTarget);
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/gfx/status_change_button.h b/engines/titanic/gfx/status_change_button.h
index 9e410c66f2..9d187493a7 100644
--- a/engines/titanic/gfx/status_change_button.h
+++ b/engines/titanic/gfx/status_change_button.h
@@ -28,6 +28,8 @@
namespace Titanic {
class CStatusChangeButton : public CSTButton {
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
public:
CLASSDEF;
CStatusChangeButton();