aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_conversations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/pet_control/pet_conversations.cpp')
-rw-r--r--engines/titanic/pet_control/pet_conversations.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index a62de341a0..c8d17e830d 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -216,7 +216,7 @@ void CPetConversations::load(SimpleFile *file, int param) {
_textInput.load(file, param);
_log.load(file, param);
- for (int idx = 0; idx < 3; ++idx)
+ for (int idx = 0; idx < TOTAL_DIALS; ++idx)
_npcLevels[idx] = file->readNumber();
}
@@ -228,7 +228,7 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
_textInput.save(file, indent);
_log.save(file, indent);
- for (int idx = 0; idx < 3; ++idx)
+ for (int idx = 0; idx < TOTAL_DIALS; ++idx)
file->writeNumberLine(_npcLevels[idx], indent);
}
@@ -252,7 +252,7 @@ void CPetConversations::proc25(int val) {
} else {
CString name = _field418 ? _npcName : getActiveNPCName();
- for (int idx = 0; idx < 3; ++idx) {
+ for (int idx = 0; idx < TOTAL_DIALS; ++idx) {
if (!_dials[idx].hasActiveMovie())
updateDial(idx, name);
}
@@ -301,6 +301,17 @@ void CPetConversations::displayNPCName(CGameObject *npc) {
}
}
+void CPetConversations::proc34(const CString &name) {
+ _field418 = 0;
+ resetDials(name);
+ startNPCTimer();
+}
+
+void CPetConversations::proc35() {
+ stopNPCTimer();
+ resetDials("0");
+}
+
void CPetConversations::showCursor() {
_textInput.showCursor(-2);
}
@@ -546,4 +557,15 @@ void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel)
}
}
+void CPetConversations::resetDials(const CString &name) {
+ TTNamedScript *script = getNPCScript(name);
+
+ for (int idx = 0; idx < TOTAL_DIALS; ++idx) {
+ uint oldLevel = _npcLevels[idx];
+ uint newLevel = getDialLevel(idx, script);
+ npcDialChange(idx, oldLevel, newLevel);
+ _npcLevels[idx] = newLevel;
+ }
+}
+
} // End of namespace Titanic