aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-08 10:59:03 -0400
committerPaul Gilbert2016-07-10 16:38:50 -0400
commit74935b371fa94637f5592e402110c3b41cd0b3c4 (patch)
tree0fa2dc64e13c962d994e4faf2f3a49083694cff2 /engines/titanic/true_talk
parentf706ef374958923c8936e51bf544a01f51ab2066 (diff)
downloadscummvm-rg350-74935b371fa94637f5592e402110c3b41cd0b3c4.tar.gz
scummvm-rg350-74935b371fa94637f5592e402110c3b41cd0b3c4.tar.bz2
scummvm-rg350-74935b371fa94637f5592e402110c3b41cd0b3c4.zip
TITANIC: Implementing scriptChanged methods
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/script_handler.cpp8
-rw-r--r--engines/titanic/true_talk/script_handler.h14
-rw-r--r--engines/titanic/true_talk/true_talk_manager.cpp2
-rw-r--r--engines/titanic/true_talk/tt_npc_script.cpp4
-rw-r--r--engines/titanic/true_talk/tt_npc_script.h16
-rw-r--r--engines/titanic/true_talk/tt_room_script.cpp6
-rw-r--r--engines/titanic/true_talk/tt_room_script.h21
7 files changed, 57 insertions, 14 deletions
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index ef5814c3f2..e902d0c874 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,8 +29,12 @@ namespace Titanic {
CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
}
-void CScriptHandler::setup(TTRoomScript *roomScript, TTNpcScript *npcScript, uint charId) {
- // TODO
+int CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
+ if (!npcScript || !roomScript) {
+ ++_inputCtr;
+ return 5;
+ }
+
}
void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 6a1e0dc0f1..868a2c3eaa 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -34,13 +34,25 @@ class CTitleEngine;
class CScriptHandler {
private:
CTitleEngine *_owner;
+ TTScriptBase *_script;
+ int _field8;
+ int _fieldC;
+ int _field10;
+ int _field14;
+ int _field18;
+ int _inputCtr;
+ int _field20;
+ int _field24;
+ int _field28;
+ int _field2C;
+ int _field30;
public:
CScriptHandler(CTitleEngine *owner, int val1, int val2);
/**
* Set the character and room
*/
- void setup(TTRoomScript *roomScript, TTNpcScript *npcScript, uint charId);
+ int scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId);
void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
const TTString &line);
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 4b1dab0046..0b841aca00 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -224,7 +224,7 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
loadAssets(npc, charId);
_currentNPC = npc;
- _titleEngine._scriptHandler->setup(roomScript, npcScript, charId);
+ _titleEngine._scriptHandler->scriptChanged(roomScript, npcScript, id);
_currentNPC = nullptr;
setDialogue(npc, roomScript, view);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index dfe8ac0ada..40a50be030 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -79,10 +79,6 @@ int TTNpcScript::proc9() const {
return 2;
}
-int TTNpcScript::proc10() const {
- return 2;
-}
-
int TTNpcScript::proc11() const {
return 2;
}
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 2f0370107e..c11dc6d0b8 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -44,7 +44,12 @@ public:
virtual void proc7(int v1, int v2) = 0;
virtual int proc8() const = 0;
virtual int proc9() const = 0;
- virtual int proc10() const = 0;
+
+ /**
+ * Called when the script/id changes
+ */
+ virtual int scriptChanged(TTScriptBase *roomScript, uint id) = 0;
+
virtual int proc11() const = 0;
virtual int proc12() const = 0;
@@ -78,7 +83,14 @@ public:
virtual void proc7(int v1, int v2);
virtual int proc8() const;
virtual int proc9() const;
- virtual int proc10() const;
+
+ /**
+ * Called when the script/id changes
+ */
+ virtual int scriptChanged(TTScriptBase *roomScript, uint id) {
+ return 2;
+ }
+
virtual int proc11() const;
virtual int proc12() const;
virtual bool proc13() const;
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index 1c37a39bf0..37fba1f1a9 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -53,8 +53,10 @@ void TTRoomScript::proc9() {
warning("TODO");
}
-void TTRoomScript::proc10() {
- warning("TODO");
+int TTRoomScript::scriptChanged(TTScriptBase *npcScript, int id) {
+ if (id == 1)
+ _field54 = 1;
+ return 1;
}
void TTRoomScript::proc11() {
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index ed17b29e9c..f64570995c 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -38,7 +38,12 @@ public:
virtual void proc7() = 0;
virtual void proc8() = 0;
virtual void proc9() = 0;
- virtual void proc10() = 0;
+
+ /**
+ * Called when the script changes
+ */
+ virtual int scriptChanged(TTScriptBase *npcScript, int id) = 0;
+
virtual void proc11() = 0;
};
@@ -53,8 +58,20 @@ public:
virtual void proc7();
virtual void proc8();
virtual void proc9();
- virtual void proc10();
+
+ /**
+ * Called when the script changes
+ */
+ virtual int scriptChanged(TTScriptBase *npcScript, int id);
+
virtual void proc11();
+
+ /**
+ * Called with the new script and id
+ */
+ int notifyScript(TTScriptBase *npcScript, int id) {
+ return scriptChanged(npcScript, id);
+ }
};
} // End of namespace Titanic