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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef AGS_SHARED_AC_DIALOG_TOPIC_H
24 #define AGS_SHARED_AC_DIALOG_TOPIC_H
25 
26 #include "ags/shared/core/types.h"
27 
28 namespace AGS3 {
29 
30 namespace AGS {
31 namespace Shared {
32 class Stream;
33 } // namespace Shared
34 } // namespace AGS
35 
36 using namespace AGS; // FIXME later
37 
38 // [IKM] This is *conversation* dialog, not *gui* dialog, mind you!
39 
40 #define MAXTOPICOPTIONS     30
41 #define DFLG_ON             1  // currently enabled
42 #define DFLG_OFFPERM        2  // off forever (can't be trurned on)
43 #define DFLG_NOREPEAT       4  // character doesn't repeat it when clicked
44 #define DFLG_HASBEENCHOSEN  8  // dialog option is 'read'
45 #define DTFLG_SHOWPARSER    1  // show parser in this topic
46 #define DCMD_SAY            1
47 #define DCMD_OPTOFF         2
48 #define DCMD_OPTON          3
49 #define DCMD_RETURN         4
50 #define DCMD_STOPDIALOG     5
51 #define DCMD_OPTOFFFOREVER  6
52 #define DCMD_RUNTEXTSCRIPT  7
53 #define DCMD_GOTODIALOG     8
54 #define DCMD_PLAYSOUND      9
55 #define DCMD_ADDINV         10
56 #define DCMD_SETSPCHVIEW    11
57 #define DCMD_NEWROOM        12
58 #define DCMD_SETGLOBALINT   13
59 #define DCMD_GIVESCORE      14
60 #define DCMD_GOTOPREVIOUS   15
61 #define DCMD_LOSEINV        16
62 #define DCMD_ENDSCRIPT      0xff
63 #define DCHAR_NARRATOR  999
64 #define DCHAR_PLAYER    998
65 
66 struct DialogTopic {
67 	char          optionnames[MAXTOPICOPTIONS][150];
68 	int32_t       optionflags[MAXTOPICOPTIONS];
69 	unsigned char *optionscripts;
70 	short         entrypoints[MAXTOPICOPTIONS];
71 	short         startupentrypoint;
72 	short         codesize;
73 	int           numoptions;
74 	int           topicFlags;
75 
76 	void ReadFromFile(Shared::Stream *in);
77 
78 	void ReadFromSavegame(Shared::Stream *in);
79 	void WriteToSavegame(Shared::Stream *out) const;
80 };
81 
82 } // namespace AGS3
83 
84 #endif
85