diff options
author | Paul Gilbert | 2016-08-27 18:29:16 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-27 18:29:16 -0400 |
commit | 311006c84cd85897cb9c536e948bc6f5d36b3805 (patch) | |
tree | e1e33b74090a7abfda909d964b8e25c769e42f9b /engines/titanic/game/record_phonograph_button.cpp | |
parent | 1694680acea712db0149c74de412e309dbd0c1cc (diff) | |
download | scummvm-rg350-311006c84cd85897cb9c536e948bc6f5d36b3805.tar.gz scummvm-rg350-311006c84cd85897cb9c536e948bc6f5d36b3805.tar.bz2 scummvm-rg350-311006c84cd85897cb9c536e948bc6f5d36b3805.zip |
TITANIC: Implemented restaurant related game classes
Diffstat (limited to 'engines/titanic/game/record_phonograph_button.cpp')
-rw-r--r-- | engines/titanic/game/record_phonograph_button.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/engines/titanic/game/record_phonograph_button.cpp b/engines/titanic/game/record_phonograph_button.cpp index f022957dbb..1ffaec4228 100644 --- a/engines/titanic/game/record_phonograph_button.cpp +++ b/engines/titanic/game/record_phonograph_button.cpp @@ -24,16 +24,44 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CRecordPhonographButton, CBackground) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(PhonographStopMsg) +END_MESSAGE_MAP() + void CRecordPhonographButton::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_value, indent); + file->writeNumberLine(_active, indent); CBackground::save(file, indent); } void CRecordPhonographButton::load(SimpleFile *file) { file->readNumber(); - _value = file->readNumber(); + _active = file->readNumber(); CBackground::load(file); } +bool CRecordPhonographButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + CPhonographRecordMsg recordMsg; + recordMsg.execute(getParent()); + + if (recordMsg._value) { + playSound("z#58.wav"); + loadFrame(1); + _active = true; + } + + return true; +} + +bool CRecordPhonographButton::PhonographStopMsg(CPhonographStopMsg *msg) { + if (_active) { + playSound("z#57.wav"); + loadFrame(0); + _active = false; + } + + return true; +} + } // End of namespace Titanic |