TITANIC: Renamings for CBridgeView

This commit is contained in:
Paul Gilbert 2017-02-20 23:48:41 -05:00
parent 89efab8bdd
commit f189cb1530
2 changed files with 17 additions and 13 deletions

View File

@ -31,13 +31,13 @@ END_MESSAGE_MAP()
void CBridgeView::save(SimpleFile *file, int indent) { void CBridgeView::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent); file->writeNumberLine(1, indent);
file->writeNumberLine(_mode, indent); file->writeNumberLine(_action, indent);
CBackground::save(file, indent); CBackground::save(file, indent);
} }
void CBridgeView::load(SimpleFile *file) { void CBridgeView::load(SimpleFile *file) {
file->readNumber(); file->readNumber();
_mode = file->readNumber(); _action = (BridgeAction)file->readNumber();
CBackground::load(file); CBackground::load(file);
} }
@ -47,13 +47,13 @@ bool CBridgeView::ActMsg(CActMsg *msg) {
volumeMsg._secondsTransition = 1; volumeMsg._secondsTransition = 1;
if (msg->_action == "End") { if (msg->_action == "End") {
_mode = 4; _action = BA_ENDING2;
petLockInput(); petLockInput();
petHide(); petHide();
setVisible(true); setVisible(true);
playMovie(MOVIE_NOTIFY_OBJECT); playMovie(MOVIE_NOTIFY_OBJECT);
} else if (msg->_action == "Go") { } else if (msg->_action == "Go") {
_mode = 1; _action = BA_GO;
setVisible(true); setVisible(true);
volumeMsg._volume = 100; volumeMsg._volume = 100;
volumeMsg.execute("EngineSounds"); volumeMsg.execute("EngineSounds");
@ -65,11 +65,11 @@ bool CBridgeView::ActMsg(CActMsg *msg) {
onMsg.execute("EngineSounds"); onMsg.execute("EngineSounds");
if (msg->_action == "Cruise") { if (msg->_action == "Cruise") {
_mode = 2; _action = BA_CRUISE;
setVisible(true); setVisible(true);
playMovie(MOVIE_NOTIFY_OBJECT); playMovie(MOVIE_NOTIFY_OBJECT);
} else if (msg->_action == "GoEnd") { } else if (msg->_action == "GoEnd") {
_mode = 3; _action = BA_ENDING1;
setVisible(true); setVisible(true);
CChangeMusicMsg musicMsg; CChangeMusicMsg musicMsg;
musicMsg._flags = 1; musicMsg._flags = 1;
@ -86,21 +86,21 @@ bool CBridgeView::MovieEndMsg(CMovieEndMsg *msg) {
CTurnOff offMsg; CTurnOff offMsg;
offMsg.execute("EngineSounds"); offMsg.execute("EngineSounds");
switch (_mode) { switch (_action) {
case 1: case BA_GO:
case 2: case BA_CRUISE:
setVisible(false); setVisible(false);
decTransitions(); decTransitions();
break; break;
case 3: { case BA_ENDING1: {
setVisible(false); setVisible(false);
CActMsg actMsg("End"); CActMsg actMsg("End");
actMsg.execute("HomeSequence"); actMsg.execute("HomeSequence");
break; break;
} }
case 4: case BA_ENDING2:
setVisible(false); setVisible(false);
changeView("TheEnd.Node 3.N"); changeView("TheEnd.Node 3.N");
break; break;

View File

@ -27,15 +27,19 @@
namespace Titanic { namespace Titanic {
enum BridgeAction {
BA_NONE = 0, BA_GO = 1, BA_CRUISE = 2, BA_ENDING1 = 3, BA_ENDING2 = 4
};
class CBridgeView : public CBackground { class CBridgeView : public CBackground {
DECLARE_MESSAGE_MAP; DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg); bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg); bool MovieEndMsg(CMovieEndMsg *msg);
public: public:
int _mode; BridgeAction _action;
public: public:
CLASSDEF; CLASSDEF;
CBridgeView() : CBackground(), _mode(0) {} CBridgeView() : CBackground(), _action(BA_NONE) {}
/** /**
* Save the data for the class to file * Save the data for the class to file