diff options
Diffstat (limited to 'engines/titanic/game/bar_menu_button.cpp')
-rw-r--r-- | engines/titanic/game/bar_menu_button.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/titanic/game/bar_menu_button.cpp b/engines/titanic/game/bar_menu_button.cpp index f57d72c64a..874584db30 100644 --- a/engines/titanic/game/bar_menu_button.cpp +++ b/engines/titanic/game/bar_menu_button.cpp @@ -21,9 +21,15 @@ */ #include "titanic/game/bar_menu_button.h" +#include "titanic/messages/pet_messages.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CBarMenuButton, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseButtonUpMsg) +END_MESSAGE_MAP() + void CBarMenuButton::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_value, indent); @@ -36,4 +42,20 @@ void CBarMenuButton::load(SimpleFile *file) { CGameObject::load(file); } +bool CBarMenuButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return true; +} + +bool CBarMenuButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { + if (_value) { + CPETUpMsg upMsg("", -1); + upMsg.execute("BarTelevision"); + } else { + CPETDownMsg downMsg("", -1); + downMsg.execute("BarTelevision"); + } + + return true; +} + } // End of namespace Titanic |