diff options
author | Paul Gilbert | 2016-06-03 23:16:11 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:19:17 -0400 |
commit | 4e766db41cae9d747f49cbfefbb5a23612768ea5 (patch) | |
tree | cedc8b3a653cb33cfe9be4d796830ac9bdd215bc /engines/titanic | |
parent | f02efd2d9e762c9f79e983603b5684e5eb357496 (diff) | |
download | scummvm-rg350-4e766db41cae9d747f49cbfefbb5a23612768ea5.tar.gz scummvm-rg350-4e766db41cae9d747f49cbfefbb5a23612768ea5.tar.bz2 scummvm-rg350-4e766db41cae9d747f49cbfefbb5a23612768ea5.zip |
TITANIC: Implemented TTnpcScript loadQuotes
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/true_talk/true_talk_manager.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/true_talk_manager.h | 3 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.h | 6 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_scripts.cpp | 2 |
5 files changed, 21 insertions, 5 deletions
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp index 1c10953206..a5a1edcc37 100644 --- a/engines/titanic/true_talk/true_talk_manager.cpp +++ b/engines/titanic/true_talk/true_talk_manager.cpp @@ -49,6 +49,7 @@ CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : _gameManager(owner), _scripts(&_titleEngine), _currentCharId(0), _dialogueFile(nullptr), _dialogueId(0) { _titleEngine.setup(3, 3); + _quotes.load("TEXT/JRQuotes.txt"); _currentNPC = nullptr; g_vm->_trueTalkManager = this; } diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h index 3140e72724..754a9955ca 100644 --- a/engines/titanic/true_talk/true_talk_manager.h +++ b/engines/titanic/true_talk/true_talk_manager.h @@ -27,6 +27,7 @@ #include "titanic/support/simple_file.h" #include "titanic/true_talk/dialogue_file.h" #include "titanic/true_talk/title_engine.h" +#include "titanic/true_talk/tt_quotes.h" #include "titanic/true_talk/tt_scripts.h" #include "titanic/true_talk/tt_talker.h" @@ -129,6 +130,8 @@ public: static void setFlags(int index, int val); public: + TTquotes _quotes; +public: /** * Get a specified state value from the currently set NPC */ diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index ff1d854388..337b367eb9 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -136,9 +136,17 @@ int TTnpcScript::proc12() const { return 1; } -bool TTnpcScript::proc13() const { - warning("TODO"); - return true; + +bool TTnpcScript::loadQuotes() { + // Original did a load of a global quotes here the first time + // this method is called. ScummVM implementation has refactored + // the loading to the CTrueTalkManager constructor + + if (!proc18()) { + return false; + } else { + return proc17(); + } } void TTnpcScript::selectResponse(int id) { diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h index afd7680ac7..15ff5303b7 100644 --- a/engines/titanic/true_talk/tt_npc_script.h +++ b/engines/titanic/true_talk/tt_npc_script.h @@ -171,7 +171,11 @@ public: virtual int proc11() const; virtual int proc12() const; - virtual bool proc13() const; + + /** + * Handles loading quotes used by the scripts + */ + virtual bool loadQuotes(); /** * Translate a passed Id to a dialogue Id if necessary, diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp index fbdf52fdc0..94420a4112 100644 --- a/engines/titanic/true_talk/tt_scripts.cpp +++ b/engines/titanic/true_talk/tt_scripts.cpp @@ -75,7 +75,7 @@ TTscripts::TTscripts(CTitleEngine *titleEngine) : } void TTscripts::addScript(TTnpcScript *script, int scriptId) { - script->proc13(); + script->loadQuotes(); // Find the room script this is associated with TTroomScript *roomScript = getRoomScript(scriptId); |