]> git.jsancho.org Git - lugaru.git/blob - Source/Dialog.h
DialogBox is protected on Windows, rename to DialogScene
[lugaru.git] / Source / Dialog.h
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
4
5 This file is part of Lugaru.
6
7 Lugaru 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 2 of the License, or
10 (at your option) any later version.
11
12 Lugaru 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 Lugaru.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _DIALOG_H_
22 #define _DIALOG_H_
23
24 #include "stdio.h"
25 #include "Quaternions.h"
26 #include <vector>
27
28 class DialogScene
29 {
30 public:
31     DialogScene(FILE* tfile);
32     DialogScene(ifstream &ipstream);
33     void save(FILE* tfile);
34
35     int location;
36     float color[3];
37     int sound;
38     std::string text;
39     std::string name;
40     XYZ camera;
41     float camerayaw;
42     float camerapitch;
43     int participantfocus;
44     int participantaction;
45     XYZ participantfacing[10];
46 };
47
48 class Dialog
49 {
50 public:
51     Dialog(FILE* tfile);
52     Dialog(int type, std::string filename);
53     void tick(int id);
54     void play();
55     void save(FILE* tfile);
56
57     int type;
58     int gonethrough;
59     std::vector<DialogScene> scenes;
60     XYZ participantlocation[10];
61     float participantyaw[10];
62
63     static void loadDialogs(FILE*);
64     static void saveDialogs(FILE*);
65
66     static bool inDialog() { return (indialogue != -1); }
67     static Dialog& currentDialog() { return dialogs[whichdialogue]; }
68     static DialogScene& currentScene() { return currentDialog().scenes[indialogue]; }
69
70     static int indialogue;
71     static int whichdialogue;
72     static bool directing;
73     static float dialoguetime;
74     static std::vector<Dialog> dialogs;
75 };
76
77 #endif /*_DIALOG_H_*/