diff options
author | Paul Gilbert | 2016-08-12 22:43:14 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-12 22:43:14 -0400 |
commit | 4f8c31ecf7c8ac71e1be65771ce508fb11c62749 (patch) | |
tree | aab2bac6a82e02e690d96800eb154621f5cd95d5 /engines/titanic/gfx | |
parent | 9e0a6cda67a63e74419a891a90ea835d17a8f3c9 (diff) | |
download | scummvm-rg350-4f8c31ecf7c8ac71e1be65771ce508fb11c62749.tar.gz scummvm-rg350-4f8c31ecf7c8ac71e1be65771ce508fb11c62749.tar.bz2 scummvm-rg350-4f8c31ecf7c8ac71e1be65771ce508fb11c62749.zip |
TITANIC: Implemented CAnnounce and CActButton classes
Diffstat (limited to 'engines/titanic/gfx')
-rw-r--r-- | engines/titanic/gfx/act_button.cpp | 10 | ||||
-rw-r--r-- | engines/titanic/gfx/act_button.h | 2 | ||||
-rw-r--r-- | engines/titanic/gfx/st_button.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/gfx/st_button.h | 6 |
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: |