factored out the EFFv2 saving into EFFImporter
[gemrb.git] / gemrb / core / Dialog.h
blob4dc473b6a26702252c2d6c637e10aca54fc764a8
1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef DIALOG_H
22 #define DIALOG_H
24 #include "exports.h"
25 #include "globals.h"
27 #include "GameScript/GameScript.h"
29 #include <vector>
31 #define IE_DLG_TR_TEXT 0x01
32 #define IE_DLG_TR_TRIGGER 0x02
33 #define IE_DLG_TR_ACTION 0x04
34 #define IE_DLG_TR_FINAL 0x08
35 #define IE_DLG_TR_JOURNAL 0x10
36 #define IE_DLG_UNSOLVED 0x40
37 #define IE_DLG_SOLVED 0x100
38 #define IE_DLG_QUEST_GROUP 0x4000 // this is a GemRB extension
40 struct DialogTransition {
41 ieDword Flags;
42 ieStrRef textStrRef;
43 ieStrRef journalStrRef;
44 Condition* condition;
45 std::vector<Action*> actions;
46 ieResRef Dialog;
47 ieDword stateIndex;
50 struct DialogState {
51 ieStrRef StrRef;
52 DialogTransition** transitions;
53 unsigned int transitionsCount;
54 Condition* condition;
55 unsigned int weight;
58 class GEM_EXPORT Dialog {
59 public:
60 Dialog(void);
61 ~Dialog(void);
62 private:
63 void FreeDialogState(DialogState* ds);
64 public:
65 void AddState(DialogState* ds);
66 DialogState* GetState(unsigned int index);
67 int FindFirstState(Scriptable* target);
68 int FindRandomState(Scriptable* target);
70 void Release()
72 delete this;
74 public:
75 ieResRef ResRef;
76 ieDword Flags; //freeze flags (bg2)
77 unsigned int TopLevelCount;
78 ieDword* Order;
79 DialogState** initialStates;
82 #endif