ScummVM API documentation
pet_conversations.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_PET_CONVERSATIONS_H
23 #define TITANIC_PET_CONVERSATIONS_H
24 
25 #include "titanic/pet_control/pet_section.h"
26 #include "titanic/gfx/text_control.h"
27 #include "titanic/pet_control/pet_gfx_element.h"
28 #include "titanic/true_talk/true_talk_manager.h"
29 
30 namespace Titanic {
31 
32 #define TOTAL_DIALS 3
33 
35 private:
36  CPetGfxElement _scrollUp;
37  CPetGfxElement _scrollDown;
38  CPetGfxElement _dialBackground;
39  CPetGfxElement _dials[TOTAL_DIALS];
40  uint _npcLevels[TOTAL_DIALS];
41  CPetGfxElement _val4;
42  CPetGfxElement _val5;
43  CPetGfxElement _indent;
44  Rect _rect1;
45  CPetGfxElement _doorBot;
46  CPetGfxElement _bellBot;
47  CPetGfxElement _splitter;
48  CPetGfxElement _npcIcons[9];
49  int _npcNum;
50  CTextControl _log;
51  CTextControl _textInput;
52  bool _logChanged;
53  int _field418;
54  CString _npcName;
55 private:
59  bool setupControl(CPetControl *petControl);
60 
64  void scrollUp();
65 
69  void scrollDown();
70 
74  void scrollUpPage();
75 
79  void scrollDownPage();
80 
84  void scrollToTop();
85 
89  void scrollToBottom();
90 
94  int canSummonBot(const CString &name);
95 
99  void summonBot(const CString &name);
100 
104  TTnpcScript *getNPCScript(const CString &name) const;
105 
109  bool handleKey(const Common::KeyState &keyState);
110 
114  void textLineEntered(const CString &textLine);
115 
119  void updateDial(uint dialNum, const CString &npcName);
120 
124  uint getDialLevel(uint dialNum, TTnpcScript *script, bool flag = true);
125 
129  void npcDialChange(uint dialNum, uint oldLevel, uint newLevel);
130 public:
132  ~CPetConversations() override {}
133 
137  bool setup(CPetControl *petControl) override;
138 
142  bool reset() override;
143 
147  void draw(CScreenManager *screenManager) override;
148 
152  Rect getBounds() const override;
153 
157  bool isValid(CPetControl *petControl) override;
158 
163  bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override;
164  bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) override;
165  bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) override;
166  bool MouseWheelMsg(CMouseWheelMsg *msg) override;
167  bool KeyCharMsg(CKeyCharMsg *msg) override;
168  bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) override;
169 
173  void displayMessage(const CString &msg) override;
174 
178  void load(SimpleFile *file, int param) override;
179 
183  void postLoad() override;
187  void save(SimpleFile *file, int indent) override;
188 
192  void enter(PetArea oldArea) override;
193 
197  void leave() override;
198 
202  void timerExpired(int val) override;
203 
207  void displayNPCName(CGameObject *npc) override;
208 
212  void setNPC(const CString &name) override;
213 
217  void resetNPC() override;
218 
222  void showCursor() override;
223 
227  void hideCursor() override;
228 
232  void setActiveNPC(const CString &name);
233 
237  void resetDials();
238 
242  void resetDials(const CString &name);
243 
247  void resetDials0();
248 
252  void addLine(const CString &line);
253 
257  void startNPCTimer();
258 
262  void stopNPCTimer();
263 };
264 
265 } // End of namespace Titanic
266 
267 #endif /* TITANIC_PET_CONVERSATIONS_H */
void showCursor() override
Definition: text_control.h:35
void hideCursor() override
void save(SimpleFile *file, int indent) override
Definition: mouse_messages.h:117
void displayMessage(const CString &msg) override
Definition: pet_section.h:51
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override
void addLine(const CString &line)
void setActiveNPC(const CString &name)
Definition: simple_file.h:49
void enter(PetArea oldArea) override
Definition: screen_manager.h:49
Definition: pet_gfx_element.h:29
bool setup(CPetControl *petControl) override
Definition: game_object.h:79
Definition: messages.h:408
void displayNPCName(CGameObject *npc) override
Definition: tt_npc_script.h:88
bool isValid(CPetControl *petControl) override
void load(SimpleFile *file, int param) override
void draw(CScreenManager *screenManager) override
Definition: rect.h:35
Definition: mouse_messages.h:103
void setNPC(const CString &name) override
Definition: arm.h:30
Definition: string.h:40
void postLoad() override
Definition: mouse_messages.h:87
Definition: messages.h:307
Definition: keyboard.h:294
Definition: mouse_messages.h:71
Rect getBounds() const override
Definition: pet_conversations.h:34
void resetNPC() override
Definition: pet_control.h:45
void timerExpired(int val) override