From 8fb2371f6fde6f82608b1f40e446cce2f5f8bf26 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 9 Sep 2017 11:01:45 -0400 Subject: TITANIC: Fix play/stop operation for 1st Class Restaurant Phonograph --- engines/titanic/game/stop_phonograph_button.cpp | 19 +++++++------------ engines/titanic/game/stop_phonograph_button.h | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/game/stop_phonograph_button.cpp b/engines/titanic/game/stop_phonograph_button.cpp index 51a7db34ce..fb3451238c 100644 --- a/engines/titanic/game/stop_phonograph_button.cpp +++ b/engines/titanic/game/stop_phonograph_button.cpp @@ -26,7 +26,7 @@ namespace Titanic { BEGIN_MESSAGE_MAP(CStopPhonographButton, CBackground) ON_MESSAGE(MouseButtonDownMsg) - ON_MESSAGE(MouseButtonUpMsg) + ON_MESSAGE(TimerMsg) END_MESSAGE_MAP() void CStopPhonographButton::save(SimpleFile *file, int indent) { @@ -45,17 +45,7 @@ bool CStopPhonographButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (!queryMsg._value) { playMovie(0, 1, 0); - } - - return true; -} - -bool CStopPhonographButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { - CQueryPhonographState queryMsg; - queryMsg.execute(getParent()); - - if (!queryMsg._value) { - playMovie(1, 0, 0); + addTimer(200); CPhonographStopMsg stopMsg; stopMsg.execute(getParent()); @@ -64,4 +54,9 @@ bool CStopPhonographButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return true; } +bool CStopPhonographButton::TimerMsg(CTimerMsg *msg) { + playMovie(1, 0, 0); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/stop_phonograph_button.h b/engines/titanic/game/stop_phonograph_button.h index 9388e6eda0..07a19cc103 100644 --- a/engines/titanic/game/stop_phonograph_button.h +++ b/engines/titanic/game/stop_phonograph_button.h @@ -30,7 +30,7 @@ namespace Titanic { class CStopPhonographButton : public CBackground { DECLARE_MESSAGE_MAP; bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); - bool MouseButtonUpMsg(CMouseButtonUpMsg *msg); + bool TimerMsg(CTimerMsg *msg); public: CLASSDEF; -- cgit v1.2.3