aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-29 08:06:04 -0400
committerPaul Gilbert2016-07-10 16:22:41 -0400
commit6fa57389a2711a83103ebde63779743f7ac2b96d (patch)
tree9dc077d72760c2e6ee02dd68e9988ee20d3e3eb2 /engines/titanic
parentb117bae55a52efdfd0e7593e4e3038d22101d8bc (diff)
downloadscummvm-rg350-6fa57389a2711a83103ebde63779743f7ac2b96d.tar.gz
scummvm-rg350-6fa57389a2711a83103ebde63779743f7ac2b96d.tar.bz2
scummvm-rg350-6fa57389a2711a83103ebde63779743f7ac2b96d.zip
TITANIC: Finished PET Conversations input line processing
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/messages/messages.h2
-rw-r--r--engines/titanic/pet_control/pet_conversations.cpp8
-rw-r--r--engines/titanic/pet_control/pet_text.cpp4
-rw-r--r--engines/titanic/pet_control/pet_text.h5
4 files changed, 17 insertions, 2 deletions
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 3af65c29da..4c8ccaf43a 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -345,7 +345,7 @@ MESSAGE0(CSubTurnOnMsg);
MESSAGE2(CSummonBotMsg, CString, strValue, "", int, numValue, 0);
MESSAGE1(CSummonBotQueryMsg, CString, npcName, "");
MESSAGE1(CTakeHeadPieceMsg, CString, value, "NULL");
-MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, "");
+MESSAGE2(CTextInputMsg, CString, input, "", CString, response, "");
MESSAGE1(CTimeDilationMsg, int, value, 0);
MESSAGE0(CTitleSequenceEndedMsg);
MESSAGE0(CTransitMsg);
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index d7fe68ef88..ae5bbd6e24 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -256,7 +256,13 @@ void CPetConversations::textLineEntered(const CString &textLine) {
return;
if (_petControl->_activeNPC) {
- warning("TODO: textLineEntered");
+ _log.addLine("- " + textLine, getColor(0));
+
+ CTextInputMsg inputMsg(textLine, "");
+ inputMsg.execute(_petControl->_activeNPC);
+
+ if (!inputMsg._response.empty())
+ _log.addLine(inputMsg._response);
} else {
_log.addLine("There is no one here to talk to", getColor(1));
}
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index a092255d7c..349e419513 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -320,6 +320,10 @@ int CPetText::getPageHeight(CScreenManager *screenManager) {
}
}
+void CPetText::addLine(const CString &str) {
+ addLine(str, _textR, _textG, _textB);
+}
+
void CPetText::addLine(const CString &str, uint color) {
addLine(str, color & 0xff, (color >> 8) & 0xff,
(color >> 16) & 0xff);
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 00eab10146..a3d136a2d4 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -207,6 +207,11 @@ public:
/**
* Add a line to the text
*/
+ void addLine(const CString &str);
+
+ /**
+ * Add a line to the text
+ */
void addLine(const CString &str, uint color);
/**