aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control
diff options
context:
space:
mode:
authorPaul Gilbert2016-06-23 23:18:30 -0400
committerPaul Gilbert2016-07-15 19:24:36 -0400
commitec5dcc17dc75a1b74a417676edf0c51048e19b6c (patch)
treeb5cb35f7f30d93722a9e1822e2e9fc71e7267bb7 /engines/titanic/pet_control
parent934787b19be3aa86e02d77eea0a1a5ffa1771075 (diff)
downloadscummvm-rg350-ec5dcc17dc75a1b74a417676edf0c51048e19b6c.tar.gz
scummvm-rg350-ec5dcc17dc75a1b74a417676edf0c51048e19b6c.tar.bz2
scummvm-rg350-ec5dcc17dc75a1b74a417676edf0c51048e19b6c.zip
TITANIC: Added TTtalker methods
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp2
-rw-r--r--engines/titanic/pet_control/pet_control.h21
-rw-r--r--engines/titanic/pet_control/pet_conversations.cpp11
-rw-r--r--engines/titanic/pet_control/pet_conversations.h10
4 files changed, 37 insertions, 7 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 5de87cd04b..549ba728a8 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -521,7 +521,7 @@ CString CPetControl::getFullViewName() {
return gameManager ? gameManager->getFullViewName() : CString();
}
-void CPetControl::resetDials(int flag) {
+void CPetControl::convResetDials(int flag) {
if (flag == 1)
_conversations.resetDials(_activeNPCName);
}
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 8093152089..fb5e0093da 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -312,16 +312,25 @@ public:
*/
CString getFullViewName();
- /**
- * Resets the dial display to reflect new values
- */
- void resetDials(int flag = 1);
-
bool getC0() const { return _fieldC0 > 0; }
void incC0() { ++_fieldC0; }
void decC0() { --_fieldC0; }
- /* CPetRooms methods */
+ /*--- CPetConversations methods ---*/
+
+ /**
+ * Resets the dial display in the conversation tab to reflect new values
+ */
+ void convResetDials(int flag = 1);
+
+ /**
+ * Adds a line to the conversation log
+ */
+ void convAddLine(const CString &line) {
+ _conversations.addLine(line);
+ }
+
+ /*--- CPetRooms methods ---*/
/**
* Gives the player a new assigned room in the specified passenger class
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 4e2d905960..b1c3ef3763 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -239,6 +239,8 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
}
void CPetConversations::enter(PetArea oldArea) {
+ resetDials();
+
if (_petControl && _petControl->_activeNPC)
// Start a timer for the NPC
startNPCTimer();
@@ -558,6 +560,10 @@ void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel)
}
}
+void CPetConversations::resetDials() {
+ resetDials(getActiveNPCName());
+}
+
void CPetConversations::resetDials(const CString &name) {
TTnpcScript *script = getNPCScript(name);
@@ -569,4 +575,9 @@ void CPetConversations::resetDials(const CString &name) {
}
}
+void CPetConversations::addLine(const CString &line) {
+ _log.addLine(line);
+ scrollToBottom();
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index cefdf1b8f1..d6a3e252d1 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -238,9 +238,19 @@ public:
virtual void hideCursor();
/**
+ * Resets the dials with the data for the currently active NPC
+ */
+ void resetDials();
+
+ /**
* Reset the dials with those for a given NPC
*/
void resetDials(const CString &name);
+
+ /**
+ * Adds a line to the log
+ */
+ void addLine(const CString &line);
};
} // End of namespace Titanic