diff options
author | Paul Gilbert | 2016-12-31 03:47:14 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-12-31 03:47:14 -0500 |
commit | 2d3d45002b8c1495fe41b973eca5dd7900b21155 (patch) | |
tree | d0b538db781964ee236723293ca37145e32d0dab | |
parent | 4029f328337f50a7d017ccd4979e414f490de942 (diff) | |
download | scummvm-rg350-2d3d45002b8c1495fe41b973eca5dd7900b21155.tar.gz scummvm-rg350-2d3d45002b8c1495fe41b973eca5dd7900b21155.tar.bz2 scummvm-rg350-2d3d45002b8c1495fe41b973eca5dd7900b21155.zip |
TITANIC: Better names for CEditControlMsg mode enum
-rw-r--r-- | engines/titanic/game/missiveomat.cpp | 28 | ||||
-rw-r--r-- | engines/titanic/gfx/edit_control.cpp | 56 | ||||
-rw-r--r-- | engines/titanic/gfx/edit_control.h | 2 | ||||
-rw-r--r-- | engines/titanic/messages/messages.h | 24 |
4 files changed, 55 insertions, 55 deletions
diff --git a/engines/titanic/game/missiveomat.cpp b/engines/titanic/game/missiveomat.cpp index da9c82b456..9fac83a5ea 100644 --- a/engines/titanic/game/missiveomat.cpp +++ b/engines/titanic/game/missiveomat.cpp @@ -92,13 +92,13 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) { return true; playSound("z#228.wav"); - editMsg._mode = EDIT_6; + editMsg._mode = EDIT_KEYPRESS; editMsg._param = msg->_key; editMsg.execute(loginControl); if (editMsg._param == 1000) { // Get the username - editMsg._mode = EDIT_3; + editMsg._mode = EDIT_GET_TEXT; editMsg.execute(loginControl); _username = editMsg._text; _username.toLowercase(); @@ -110,7 +110,7 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) { editMsg._mode = EDIT_CLEAR; editMsg.execute(loginControl); - editMsg._mode = EDIT_10; + editMsg._mode = EDIT_BORDERS; editMsg._param = 24; editMsg.execute(loginControl); } @@ -122,13 +122,13 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) { return true; playSound("z#228.wav"); - editMsg._mode = EDIT_6; + editMsg._mode = EDIT_KEYPRESS; editMsg._param = msg->_key; editMsg.execute(loginControl); if (editMsg._param == 1000) { // Get the password - editMsg._mode = EDIT_3; + editMsg._mode = EDIT_GET_TEXT; editMsg.execute(loginControl); _password = editMsg._text; _password.toLowercase(); @@ -163,17 +163,17 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) { editMsg.execute(loginControl); getTextCursor()->hide(); - editMsg._mode = EDIT_13; + editMsg._mode = EDIT_HIDE; editMsg.execute(loginControl); - editMsg._mode = EDIT_12; + editMsg._mode = EDIT_SHOW; editMsg.execute(welcome); editMsg._mode = EDIT_SET_TEXT; editMsg._text = _welcomeMessages[_account]; editMsg.execute(welcome); - editMsg._mode = EDIT_12; + editMsg._mode = EDIT_SHOW; editMsg._text = "MissiveOMat OK Button"; editMsg.execute(welcome); editMsg.execute(scrollUp); @@ -206,7 +206,7 @@ bool CMissiveOMat::TimerMsg(CTimerMsg *msg) { CTreeItem *loginControl = findRoom()->findByName("MissiveOMat Login Control"); CEditControlMsg editMsg; - editMsg._mode = EDIT_10; + editMsg._mode = EDIT_BORDERS; editMsg._param = 8; editMsg.execute(loginControl); } @@ -310,16 +310,16 @@ bool CMissiveOMat::MissiveOMatActionMsg(CMissiveOMatActionMsg *msg) { editMsg.execute(WIDGETS[idx]); editMsg._mode = EDIT_CLEAR; editMsg.execute(WIDGETS[idx]); - editMsg._mode = EDIT_13; + editMsg._mode = EDIT_HIDE; editMsg.execute(WIDGETS[idx]); } - editMsg._mode = EDIT_12; + editMsg._mode = EDIT_SHOW; editMsg.execute("MissiveOMat Login Control"); - editMsg._mode = EDIT_10; + editMsg._mode = EDIT_BORDERS; editMsg._param = 8; editMsg.execute("MissiveOMat Login Control"); - editMsg._mode = EDIT_8; + editMsg._mode = EDIT_SHOW_CURSOR; editMsg.execute("MissiveOMat Login Control"); _username.clear(); @@ -336,7 +336,7 @@ bool CMissiveOMat::MissiveOMatActionMsg(CMissiveOMatActionMsg *msg) { bool CMissiveOMat::LeaveViewMsg(CLeaveViewMsg *msg) { CEditControlMsg editMsg; - editMsg._mode = EDIT_9; + editMsg._mode = EDIT_HIDE_CURSOR; editMsg.execute("MissiveOMat Login Control"); petShowCursor(); diff --git a/engines/titanic/gfx/edit_control.cpp b/engines/titanic/gfx/edit_control.cpp index 857a27d97d..9cf3a9fbd4 100644 --- a/engines/titanic/gfx/edit_control.cpp +++ b/engines/titanic/gfx/edit_control.cpp @@ -28,13 +28,13 @@ BEGIN_MESSAGE_MAP(CEditControl, CGameObject) ON_MESSAGE(EditControlMsg) END_MESSAGE_MAP() -CEditControl::CEditControl() : CGameObject(), _fieldBC(false), _fontNumber(0), _fieldD4(2), +CEditControl::CEditControl() : CGameObject(), _showCursor(false), _fontNumber(0), _fieldD4(2), _textR(0), _textG(0), _textB(0), _fieldF0(0), _isPassword(false) { } void CEditControl::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldBC, indent); + file->writeNumberLine(_showCursor, indent); file->writeNumberLine(_editLeft, indent); file->writeNumberLine(_editBottom, indent); file->writeNumberLine(_editHeight, indent); @@ -53,7 +53,7 @@ void CEditControl::save(SimpleFile *file, int indent) { void CEditControl::load(SimpleFile *file) { file->readNumber(); - _fieldBC = file->readNumber(); + _showCursor = file->readNumber(); _editLeft = file->readNumber(); _editBottom = file->readNumber(); _editHeight = file->readNumber(); @@ -82,11 +82,11 @@ bool CEditControl::EditControlMsg(CEditControlMsg *msg) { setTextFontNumber(_fontNumber); CEditControlMsg ctlMsg; - ctlMsg._mode = EDIT_10; + ctlMsg._mode = EDIT_BORDERS; ctlMsg._param = _fieldD4; ctlMsg.execute(this); - ctlMsg._mode = EDIT_11; + ctlMsg._mode = EDIT_SET_COLOR; ctlMsg._textR = _textR; ctlMsg._textG = _textG; ctlMsg._textB = _textB; @@ -97,7 +97,7 @@ bool CEditControl::EditControlMsg(CEditControlMsg *msg) { case EDIT_CLEAR: { _text = ""; CEditControlMsg ctlMsg; - ctlMsg._mode = EDIT_14; + ctlMsg._mode = EDIT_RENDER; ctlMsg.execute(this); break; } @@ -105,28 +105,28 @@ bool CEditControl::EditControlMsg(CEditControlMsg *msg) { case EDIT_SET_TEXT: { _text = msg->_text; CEditControlMsg ctlMsg; - ctlMsg._mode = EDIT_14; + ctlMsg._mode = EDIT_RENDER; ctlMsg.execute(this); break; } - case EDIT_3: + case EDIT_GET_TEXT: msg->_text = _text; break; - case EDIT_4: + case EDIT_LENGTH: msg->_param = _text.size(); break; - case EDIT_5: + case EDIT_MAX_LENGTH: _maxTextChars = msg->_param; break; - case EDIT_6: + case EDIT_KEYPRESS: if (msg->_param == 8 && !_text.empty()) { _text = _text.left(_text.size() - 1); CEditControlMsg ctlMsg; - ctlMsg._mode = EDIT_14; + ctlMsg._mode = EDIT_RENDER; ctlMsg.execute(this); } else if (msg->_param == 13) { msg->_param = 1000; @@ -136,32 +136,32 @@ bool CEditControl::EditControlMsg(CEditControlMsg *msg) { _text += c; CEditControlMsg ctlMsg; - ctlMsg._mode = EDIT_14; + ctlMsg._mode = EDIT_RENDER; ctlMsg.execute(this); } break; - case EDIT_7: + case EDIT_SET_FONT: setTextFontNumber(msg->_param); break; - case EDIT_8: - if (!_fieldBC) { - _fieldBC = true; + case EDIT_SHOW_CURSOR: + if (!_showCursor) { + _showCursor = true; CEditControlMsg ctlMsg; - ctlMsg._mode = EDIT_14; + ctlMsg._mode = EDIT_RENDER; ctlMsg.execute(this); } break; - case EDIT_9: - if (_fieldBC) { - _fieldBC = false; + case EDIT_HIDE_CURSOR: + if (_showCursor) { + _showCursor = false; getTextCursor()->hide(); } break; - case EDIT_10: { + case EDIT_BORDERS: { setTextHasBorders((msg->_param & 1) != 0); if (msg->_param & 4) _fieldF0 = 1; @@ -172,24 +172,24 @@ bool CEditControl::EditControlMsg(CEditControlMsg *msg) { _isPassword = (msg->_param & 0x10) != 0; CEditControlMsg ctlMsg; - ctlMsg._mode = EDIT_14; + ctlMsg._mode = EDIT_RENDER; ctlMsg.execute(this); break; } - case EDIT_11: + case EDIT_SET_COLOR: setTextColor(msg->_textR, msg->_textG, msg->_textB); break; - case EDIT_12: + case EDIT_SHOW: setVisible(true); break; - case EDIT_13: + case EDIT_HIDE: setVisible(false); break; - case EDIT_14: { + case EDIT_RENDER: { makeDirty(); CString str = _isPassword ? CString('*', _text.size()) : _text; setText(str); @@ -202,7 +202,7 @@ bool CEditControl::EditControlMsg(CEditControlMsg *msg) { makeDirty(); } - if (_fieldBC) { + if (_showCursor) { CTextCursor *textCursor = getTextCursor(); textCursor->show(); textCursor->setPos(Point(_bounds.left + textWidth + 1, _bounds.top + 3)); diff --git a/engines/titanic/gfx/edit_control.h b/engines/titanic/gfx/edit_control.h index ce36f9b108..141386009b 100644 --- a/engines/titanic/gfx/edit_control.h +++ b/engines/titanic/gfx/edit_control.h @@ -31,7 +31,7 @@ class CEditControl : public CGameObject { DECLARE_MESSAGE_MAP; bool EditControlMsg(CEditControlMsg *msg); protected: - bool _fieldBC; + bool _showCursor; int _editLeft; int _editBottom; int _editHeight; diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h index f7019ec20e..a6e4a381b1 100644 --- a/engines/titanic/messages/messages.h +++ b/engines/titanic/messages/messages.h @@ -153,18 +153,18 @@ enum EditControlAction { EDIT_INIT = 0, EDIT_CLEAR = 1, EDIT_SET_TEXT = 2, - EDIT_3 = 3, - EDIT_4 = 4, - EDIT_5 = 5, - EDIT_6 = 6, - EDIT_7 = 7, - EDIT_8 = 8, - EDIT_9 = 9, - EDIT_10 = 10, - EDIT_11 = 11, - EDIT_12 = 12, - EDIT_13 = 13, - EDIT_14 = 14 + EDIT_GET_TEXT = 3, + EDIT_LENGTH = 4, + EDIT_MAX_LENGTH = 5, + EDIT_KEYPRESS = 6, + EDIT_SET_FONT = 7, + EDIT_SHOW_CURSOR = 8, + EDIT_HIDE_CURSOR = 9, + EDIT_BORDERS = 10, + EDIT_SET_COLOR = 11, + EDIT_SHOW = 12, + EDIT_HIDE = 13, + EDIT_RENDER = 14 }; class CEditControlMsg : public CMessage { |