aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/gfx')
-rw-r--r--engines/titanic/gfx/act_button.cpp10
-rw-r--r--engines/titanic/gfx/act_button.h2
-rw-r--r--engines/titanic/gfx/st_button.cpp14
-rw-r--r--engines/titanic/gfx/st_button.h6
4 files changed, 22 insertions, 10 deletions
diff --git a/engines/titanic/gfx/act_button.cpp b/engines/titanic/gfx/act_button.cpp
index c84f358ca9..75c999b10f 100644
--- a/engines/titanic/gfx/act_button.cpp
+++ b/engines/titanic/gfx/act_button.cpp
@@ -24,6 +24,10 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CActButton, CSTButton)
+ ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
CActButton::CActButton() : CSTButton() {
}
@@ -37,4 +41,10 @@ void CActButton::load(SimpleFile *file) {
CSTButton::load(file);
}
+bool CActButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+ CActMsg actMsg(_actionName);
+ actMsg.execute(_actionTarget);
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/gfx/act_button.h b/engines/titanic/gfx/act_button.h
index 26e5595411..910ace1d13 100644
--- a/engines/titanic/gfx/act_button.h
+++ b/engines/titanic/gfx/act_button.h
@@ -28,6 +28,8 @@
namespace Titanic {
class CActButton : public CSTButton {
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
public:
CLASSDEF;
CActButton();
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 4b93d46595..6fc31f4c64 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -32,10 +32,10 @@ END_MESSAGE_MAP()
CSTButton::CSTButton() : CBackground() {
_statusInc = 0;
- _statusTarget = "NULL";
+ _actionTarget = "NULL";
_fieldF0 = 0;
_currentStatus = 0;
- _string4 = "NULL";
+ _actionName = "NULL";
_soundName = "NULL";
_buttonFrame = 0;
}
@@ -43,10 +43,10 @@ CSTButton::CSTButton() : CBackground() {
void CSTButton::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_statusInc, indent);
- file->writeQuotedLine(_statusTarget, indent);
+ file->writeQuotedLine(_actionTarget, indent);
file->writeNumberLine(_fieldF0, indent);
file->writeNumberLine(_currentStatus, indent);
- file->writeQuotedLine(_string4, indent);
+ file->writeQuotedLine(_actionName, indent);
file->writeQuotedLine(_soundName, indent);
file->writeNumberLine(_buttonFrame, indent);
@@ -56,10 +56,10 @@ void CSTButton::save(SimpleFile *file, int indent) {
void CSTButton::load(SimpleFile *file) {
file->readNumber();
_statusInc = file->readNumber();
- _statusTarget = file->readString();
+ _actionTarget = file->readString();
_fieldF0 = file->readNumber();
_currentStatus = file->readNumber();
- _string4 = file->readString();
+ _actionName = file->readString();
_soundName = file->readString();
_buttonFrame = file->readNumber() != 0;
@@ -79,7 +79,7 @@ bool CSTButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
CStatusChangeMsg statusMsg(oldStatus, newStatus, false);
_currentStatus = newStatus;
- statusMsg.execute(_statusTarget);
+ statusMsg.execute(_actionTarget);
if (!statusMsg._success) {
_currentStatus -= _statusInc;
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index 789437691b..444c883f59 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -34,12 +34,12 @@ class CSTButton : public CBackground {
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
-private:
+protected:
int _statusInc;
- CString _statusTarget;
+ CString _actionTarget;
int _fieldF0;
int _currentStatus;
- CString _string4;
+ CString _actionName;
CString _soundName;
int _buttonFrame;
public: