aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/bar_menu_button.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-14 15:52:03 -0400
committerPaul Gilbert2016-08-14 15:52:03 -0400
commit8ea436686dc0bd1726831f1648778903896b26c7 (patch)
tree79bcf7b1165faa25e3b374d78ba7363200da73c6 /engines/titanic/game/bar_menu_button.cpp
parentb670c02835f52673064cce9b025a353ca8fe82ce (diff)
downloadscummvm-rg350-8ea436686dc0bd1726831f1648778903896b26c7.tar.gz
scummvm-rg350-8ea436686dc0bd1726831f1648778903896b26c7.tar.bz2
scummvm-rg350-8ea436686dc0bd1726831f1648778903896b26c7.zip
TITANIC: Implemented CBarMenu and CBarMenuButton classes
Diffstat (limited to 'engines/titanic/game/bar_menu_button.cpp')
-rw-r--r--engines/titanic/game/bar_menu_button.cpp22
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