[Scummvm-cvs-logs] scummvm master -> 7234f076f4ccf5cb427ad4abda65b4fb2d823d3b

dreammaster dreammaster at scummvm.org
Tue Aug 16 03:32:18 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7234f076f4 TITANIC: Implemented CBottomOfWellMonitor class


Commit: 7234f076f4ccf5cb427ad4abda65b4fb2d823d3b
    https://github.com/scummvm/scummvm/commit/7234f076f4ccf5cb427ad4abda65b4fb2d823d3b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-15T21:32:03-04:00

Commit Message:
TITANIC: Implemented CBottomOfWellMonitor class

Changed paths:
    engines/titanic/game/bottom_of_well_monitor.cpp
    engines/titanic/game/bottom_of_well_monitor.h



diff --git a/engines/titanic/game/bottom_of_well_monitor.cpp b/engines/titanic/game/bottom_of_well_monitor.cpp
index beb2a80..373fe4c 100644
--- a/engines/titanic/game/bottom_of_well_monitor.cpp
+++ b/engines/titanic/game/bottom_of_well_monitor.cpp
@@ -24,6 +24,13 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CBottomOfWellMonitor, CGameObject)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(LeaveViewMsg)
+END_MESSAGE_MAP()
+
 int CBottomOfWellMonitor::_v1;
 int CBottomOfWellMonitor::_v2;
 
@@ -31,7 +38,7 @@ void CBottomOfWellMonitor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
-	file->writeNumberLine(_value, indent);
+	file->writeNumberLine(_flag, indent);
 	CGameObject::save(file, indent);
 }
 
@@ -39,8 +46,69 @@ void CBottomOfWellMonitor::load(SimpleFile *file) {
 	file->readNumber();
 	_v1 = file->readNumber();
 	_v2 = file->readNumber();
-	_value = file->readNumber();
+	_flag = file->readNumber();
 	CGameObject::load(file);
 }
 
+bool CBottomOfWellMonitor::ActMsg(CActMsg *msg) {
+	if (msg->_action == "TelevisionTaken") {
+		_v1 = 0;
+		_cursorId = CURSOR_ARROW;
+		CVisibleMsg visibleMsg;
+		visibleMsg.execute("CrushedTV2NE");
+		visibleMsg.execute("CrushedTV4SW");
+		_cursorId = CURSOR_ARROW;
+	} else if (msg->_action == "LiftbotHeadTaken") {
+		_v2 = 0;
+		_cursorId = CURSOR_ARROW;
+		CVisibleMsg visibleMsg;
+		visibleMsg.execute("LiftbotHead2NE");
+		visibleMsg.execute("LiftbotHead4SW");
+		_cursorId = CURSOR_ARROW;
+	} else if (msg->_action == "LiftbotHeadTaken") {
+		_v2 = 1;
+		CVisibleMsg visibleMsg;
+		visibleMsg.execute("CrushedTV2NE");
+		visibleMsg.execute("CrushedTV4SW");
+		_cursorId = CURSOR_MOVE_DOWN1;
+	}
+
+	return true;
+}
+
+bool CBottomOfWellMonitor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (!compareTo("BOWTelevisionMonitor")) {
+		if (_v2)
+			changeView("BottomOfWell.Node 8.N", "");
+	} else {
+		if (_v1)
+			changeView("BottomOfWell.Node 7.N", "");
+	}
+
+	return true;
+}
+
+bool CBottomOfWellMonitor::EnterViewMsg(CEnterViewMsg *msg) {
+	if (_flag) {
+		if (!compareTo("BOWTelevisionMonitor")) {
+			if (_v2) {
+				changeView("BottomOfWell.Node 8.N", "");
+				_flag = false;
+			}
+		} else {
+			if (_v1) {
+				changeView("BottomOfWell.Node 7.N", "");
+				_flag = false;
+			}
+		}
+	}
+
+	return true;
+}
+
+bool CBottomOfWellMonitor::LeaveViewMsg(CLeaveViewMsg *msg) {
+	_flag = true;
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/bottom_of_well_monitor.h b/engines/titanic/game/bottom_of_well_monitor.h
index 65424aa..be9ae2c 100644
--- a/engines/titanic/game/bottom_of_well_monitor.h
+++ b/engines/titanic/game/bottom_of_well_monitor.h
@@ -28,12 +28,17 @@
 namespace Titanic {
 
 class CBottomOfWellMonitor : public CGameObject {
+	DECLARE_MESSAGE_MAP;
+	bool ActMsg(CActMsg *msg);
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
 public:
 	static int _v1, _v2;
-	int _value;
+	bool _flag;
 public:
 	CLASSDEF;
-	CBottomOfWellMonitor() : _value(1) {}
+	CBottomOfWellMonitor() : _flag(true) {}
 
 	/**
 	 * Save the data for the class to file






More information about the Scummvm-git-logs mailing list