aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/game')
-rw-r--r--engines/titanic/game/missiveomat.cpp26
-rw-r--r--engines/titanic/game/missiveomat.h6
-rw-r--r--engines/titanic/game/missiveomat_button.cpp2
-rw-r--r--engines/titanic/game/missiveomat_button.h5
4 files changed, 19 insertions, 20 deletions
diff --git a/engines/titanic/game/missiveomat.cpp b/engines/titanic/game/missiveomat.cpp
index 9fac83a5ea..8f491cadf6 100644
--- a/engines/titanic/game/missiveomat.cpp
+++ b/engines/titanic/game/missiveomat.cpp
@@ -75,15 +75,13 @@ void CMissiveOMat::load(SimpleFile *file) {
}
bool CMissiveOMat::EnterViewMsg(CEnterViewMsg *msg) {
- CMissiveOMatActionMsg actionMsg(9);
+ CMissiveOMatActionMsg actionMsg(MESSAGE_9);
actionMsg.execute(this);
return true;
}
bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
CTreeItem *loginControl = findRoom()->findByName("MissiveOMat Login Control");
- CTreeItem *welcome = findRoom()->findByName("MissiveOMat Welcome");
- CTreeItem *scrollUp = findRoom()->findByName("MissiveOMat ScrollUp Button");
CEditControlMsg editMsg;
switch (_mode) {
@@ -162,6 +160,12 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
editMsg._mode = EDIT_CLEAR;
editMsg.execute(loginControl);
+ CRoomItem *room = findRoom();
+ CTreeItem *welcome = room->findByName("MissiveOMat Welcome");
+ CTreeItem *scrollUp = room->findByName("MissiveOMat ScrollUp Button");
+ CTreeItem *scrollDown = room->findByName("MissiveOMat ScrollDown Button");
+ CTreeItem *ok = room->findByName("MissiveOMat OK Button");
+
getTextCursor()->hide();
editMsg._mode = EDIT_HIDE;
editMsg.execute(loginControl);
@@ -174,9 +178,9 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
editMsg.execute(welcome);
editMsg._mode = EDIT_SHOW;
- editMsg._text = "MissiveOMat OK Button";
- editMsg.execute(welcome);
+ editMsg.execute(ok);
editMsg.execute(scrollUp);
+ editMsg.execute(scrollDown);
} else {
// Credentials were invalid, so access denied
_mode = MMODE_DENIED;
@@ -296,15 +300,15 @@ bool CMissiveOMat::MissiveOMatActionMsg(CMissiveOMatActionMsg *msg) {
_mode = MMODE_USERNAME;
_account = NO_ACCOUNT;
- static const char *const WIDGETS[7] = {
- "MissiveOMat Login Control", "MissiveOMat OK Button",
- "MissiveOMat Next Button", "MissiveOMat Prev Button",
- "MissiveOMat Logout Button", "MissiveOMat ScrollDown Button",
- "MissiveOMat ScrollUp Button"
+ static const char *const WIDGETS[8] = {
+ "MissiveOMat Login Control", "MissiveOMat Welcome",
+ "MissiveOMat OK Button", "MissiveOMat Next Button",
+ "MissiveOMat Prev Button", "MissiveOMat Logout Button",
+ "MissiveOMat ScrollDown Button", "MissiveOMat ScrollUp Button"
};
CEditControlMsg editMsg;
- for (int idx = 0; idx < 7; ++idx) {
+ for (int idx = 0; idx < 8; ++idx) {
editMsg._mode = EDIT_INIT;
editMsg._param = 12;
editMsg.execute(WIDGETS[idx]);
diff --git a/engines/titanic/game/missiveomat.h b/engines/titanic/game/missiveomat.h
index 1c8e94d59c..c8441edff2 100644
--- a/engines/titanic/game/missiveomat.h
+++ b/engines/titanic/game/missiveomat.h
@@ -27,12 +27,6 @@
namespace Titanic {
-enum MissiveOMatAction {
- MESSAGE_NONE = 1, MESSAGE_SHOW = 2, NEXT_MESSAGE = 3, PRIOR_MESSAGE = 4,
- MESSAGE_5 = 5, MESSAGE_DOWN = 6, MESSAGE_UP = 7, REDRAW_MESSAGE = 8,
- MESSAGE_9 = 9
-};
-
enum MissiveOMatMode {
MMODE_USERNAME = 1,
MMODE_PASSWORD = 2,
diff --git a/engines/titanic/game/missiveomat_button.cpp b/engines/titanic/game/missiveomat_button.cpp
index b7ad7f8f6f..8c1f6c51c6 100644
--- a/engines/titanic/game/missiveomat_button.cpp
+++ b/engines/titanic/game/missiveomat_button.cpp
@@ -40,7 +40,7 @@ void CMissiveOMatButton::save(SimpleFile *file, int indent) {
void CMissiveOMatButton::load(SimpleFile *file) {
file->readNumber();
- _buttonId = file->readNumber();
+ _buttonId = (MissiveOMatAction)file->readNumber();
CEditControl::load(file);
}
diff --git a/engines/titanic/game/missiveomat_button.h b/engines/titanic/game/missiveomat_button.h
index 6dbfd4cd56..b029f6ce85 100644
--- a/engines/titanic/game/missiveomat_button.h
+++ b/engines/titanic/game/missiveomat_button.h
@@ -24,6 +24,7 @@
#define TITANIC_MISSIVEOMAT_BUTTON_H
#include "titanic/gfx/edit_control.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
@@ -33,10 +34,10 @@ class CMissiveOMatButton : public CEditControl {
bool VisibleMsg(CVisibleMsg *msg);
bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
public:
- int _buttonId;
+ MissiveOMatAction _buttonId;
public:
CLASSDEF;
- CMissiveOMatButton() : CEditControl(), _buttonId(2) {}
+ CMissiveOMatButton() : CEditControl(), _buttonId(MESSAGE_SHOW) {}
/**
* Save the data for the class to file