ScummVM API documentation
true_talk_manager.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TITANIC_TRUE_TALK_MANAGER_H
23 #define TITANIC_TRUE_TALK_MANAGER_H
24 
25 #include "titanic/messages/messages.h"
26 #include "titanic/support/simple_file.h"
27 #include "titanic/true_talk/dialogue_file.h"
28 #include "titanic/true_talk/title_engine.h"
29 #include "titanic/true_talk/tt_quotes.h"
30 #include "titanic/true_talk/tt_quotes_tree.h"
31 #include "titanic/true_talk/tt_scripts.h"
32 #include "titanic/true_talk/tt_talker.h"
33 #include "titanic/game_state.h"
34 
35 namespace Titanic {
36 
37 class CGameManager;
38 class CGameState;
39 class CTreeItem;
40 class CViewItem;
41 class CTrueTalkManager;
42 class CTrueTalkNPC;
43 
45 private:
46  CGameManager *_gameManager;
47  STtitleEngine _titleEngine;
48  TTscripts _scripts;
49  int _currentCharId;
50  CDialogueFile *_dialogueFile;
51  int _dialogueId;
52  int _speechDuration;
53  TTtalkerList _talkers;
54 private:
58  static void loadStatics(SimpleFile *file);
59 
63  static void saveStatics(SimpleFile *file);
64 
68  void loadNPC(SimpleFile *file, int charId);
69 
73  void saveNPC(SimpleFile *file, int charId) const;
74 
78  TTnpcScript *getNpcScript(CTrueTalkNPC *npc) const;
79 
83  TTroomScript *getRoomScript() const;
84 
88  void loadAssets(CTrueTalkNPC *npc, int charId);
89 
90  void setDialogue(CTrueTalkNPC *npc, TTroomScript *roomScript, CViewItem *view);
91 
95  CString readDialogueString();
96 
101  uint readDialogueSpeech();
102 
106  void triggerNPC(CTrueTalkNPC *npc);
107 
111  void playSpeech(TTtalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot);
112 
116  static void talkerEnd(TTtalker *talker);
117 
121  CGameState *getGameState() const;
122 public:
123  static int _v1;
124  static int _v2;
125  static int _v3;
126  static bool _v4;
127  static bool _v5;
128  static int _v6;
129  static int _v7;
130  static bool _v8;
131  static int _v9;
132  static bool _v10;
133  static int _v11[41];
134  static CTrueTalkNPC *_currentNPC;
135 
136  static void setFlags(int index, int val);
137 public:
138  TTquotes _quotes;
139  TTquotesTree _quotesTree;
140 public:
144  static int getStateValue(int stateNum);
145 
149  static bool triggerAction(int action, int param);
150 public:
152  ~CTrueTalkManager();
153 
157  void save(SimpleFile *file) const;
158 
162  void load(SimpleFile *file);
163 
167  void clear();
168 
172  void preLoad();
173 
177  void postLoad() {}
178 
182  void preSave() {}
183 
187  void postSave() {}
188 
192  TTscripts &getScripts() { return _scripts; }
193 
197  void removeCompleted();
198 
202  CGameManager *getGameManager() const;
203 
207  void start(CTrueTalkNPC *npc, uint id, CViewItem *view);
208 
212  void start3(CTrueTalkNPC *npc, CViewItem *view);
213 
217  void start4(CTrueTalkNPC *npc, CViewItem *view);
218 
222  TTnpcScript *getTalker(const CString &name) const;
223 
227  void processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view);
228 
232  TTroomScript *getRoomScript(int roomId) const;
233 
237  int getPassengerClass() const;
238 
239  Season getCurrentSeason() const;
240 };
241 
242 } // End of namespace Titanic
243 
244 #endif /* TITANIC_TRUE_TALK_MANAGER_H */
Definition: true_talk_manager.h:44
void start4(CTrueTalkNPC *npc, CViewItem *view)
Definition: tt_scripts.h:56
void start(CTrueTalkNPC *npc, uint id, CViewItem *view)
void load(SimpleFile *file)
void processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view)
Definition: tt_quotes_tree.h:51
void preSave()
Definition: true_talk_manager.h:182
Definition: tt_room_script.h:61
Definition: true_talk_npc.h:43
Definition: tt_talker.h:64
CGameManager * getGameManager() const
Definition: simple_file.h:49
Definition: messages.h:387
Definition: tt_talker.h:33
void start3(CTrueTalkNPC *npc, CViewItem *view)
Definition: game_state.h:60
void postLoad()
Definition: true_talk_manager.h:177
static int getStateValue(int stateNum)
void save(SimpleFile *file) const
Definition: tt_npc_script.h:88
Definition: game_manager.h:48
static bool triggerAction(int action, int param)
void postSave()
Definition: true_talk_manager.h:187
Definition: tt_quotes.h:31
Definition: arm.h:30
TTscripts & getScripts()
Definition: true_talk_manager.h:192
Definition: string.h:40
Definition: dialogue_file.h:51
TTnpcScript * getTalker(const CString &name) const
Definition: title_engine.h:65
Definition: view_item.h:32