]> icculus.org git repositories - taylor/freespace2.git/blob - include/missiongoalsdlg.h
Initial revision
[taylor/freespace2.git] / include / missiongoalsdlg.h
1 /*
2  * $Logfile: /Freespace2/code/FRED2/MissionGoalsDlg.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Mission goals editor dialog box handling code
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 2     10/07/98 6:28p Dave
15  * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
16  * Fred. Globalized mission and campaign file extensions. Removed Silent
17  * Threat specific code.
18  * 
19  * 1     10/07/98 3:01p Dave
20  * 
21  * 1     10/07/98 3:00p Dave
22  * 
23  * 26    5/20/98 1:04p Hoffoss
24  * Made credits screen use new artwork and removed rating field usage from
25  * Fred (a goal struct member).
26  * 
27  * 25    3/31/98 12:23a Allender
28  * changed macro names of campaign types to be more descriptive.  Added
29  * "team" to objectives dialog for team v. team missions.  Added two
30  * distinct multiplayer campaign types
31  * 
32  * 24    12/08/97 2:03p Hoffoss
33  * Added Fred support for MGF_NO_MUSIC flag in objectives.
34  * 
35  * 23    10/09/97 1:03p Hoffoss
36  * Renaming events or goals now updates sexp references as well.
37  * 
38  * 22    8/12/97 3:33p Hoffoss
39  * Fixed the "press cancel to go to reference" code to work properly.
40  * 
41  * 21    7/30/97 5:23p Hoffoss
42  * Removed Sexp tree verification code, since it duplicates normal sexp
43  * verification, and is just another set of code to keep maintained.
44  * 
45  * 20    7/25/97 3:05p Allender
46  * added score field to goals and events editor
47  * 
48  * 19    7/17/97 4:10p Hoffoss
49  * Added drag and drop to sexp trees for reordering root items.
50  * 
51  * 18    7/07/97 12:04p Allender
52  * mission goal validation.
53  * 
54  * 17    6/02/97 8:47p Hoffoss
55  * Fixed bug with inserting an operator at root position, but under a
56  * label.
57  * 
58  * 16    5/20/97 2:28p Hoffoss
59  * Added message box queries for close window operation on all modal
60  * dialog boxes.
61  * 
62  * 15    5/01/97 4:12p Hoffoss
63  * Added return handling to dialogs.
64  * 
65  * 14    4/17/97 2:01p Hoffoss
66  * All dialog box window states are saved between sessions now.
67  * 
68  * 13    4/11/97 10:11a Hoffoss
69  * Name fields supported by Fred for Events and Mission Goals.
70  * 
71  * 12    2/17/97 5:28p Hoffoss
72  * Checked RCS headers, added them were missing, changing description to
73  * something better, etc where needed.
74  *
75  * $NoKeywords: $
76  */
77
78 #include "sexp_tree.h"
79 #include "missiongoals.h"
80
81 /////////////////////////////////////////////////////////////////////////////
82 // CMissionGoalsDlg dialog
83
84 #define MAX_GOAL_ELEMENTS 300
85 #define OPERAND 0x01
86 #define EDITABLE        0x02
87
88 class sexp_goal_tree : public sexp_tree
89 {
90 public:
91         int load_sub_tree(int index);
92         int get_new_node_position();
93 };
94
95 class CMissionGoalsDlg : public CDialog
96 {
97 // Construction
98 public:
99         void swap_handler(int node1, int node2);
100         int query_modified();
101         void OnCancel();
102         void OnOK();
103         void load_tree();
104         void update_cur_goal();
105         void add_sub_tree(int node, HTREEITEM root);
106         void create_tree();
107         CMissionGoalsDlg(CWnd* pParent = NULL);   // standard constructor
108         BOOL OnInitDialog();
109         int handler(int code, int goal);
110         void insert_handler(int old, int node);
111         int select_sexp_node;
112
113 // Dialog Data
114         //{{AFX_DATA(CMissionGoalsDlg)
115         enum { IDD = IDD_MISSION_GOALS };
116         sexp_goal_tree  m_goals_tree;
117         CString m_goal_desc;
118         int             m_goal_type;
119         int             m_display_goal_types;
120         CString m_name;
121         BOOL    m_goal_invalid;
122         int             m_goal_score;
123         BOOL    m_no_music;
124         int             m_team;
125         //}}AFX_DATA
126
127
128 // Overrides
129         // ClassWizard generated virtual function overrides
130         //{{AFX_VIRTUAL(CMissionGoalsDlg)
131         protected:
132         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
133         //}}AFX_VIRTUAL
134
135 // Implementation
136 protected:
137         // Generated message map functions
138         //{{AFX_MSG(CMissionGoalsDlg)
139         afx_msg void OnSelchangeDisplayGoalTypesDrop();
140         afx_msg void OnSelchangedGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
141         afx_msg void OnRclickGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
142         afx_msg void OnEndlabeleditGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
143         afx_msg void OnBeginlabeleditGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
144         afx_msg void OnButtonNewGoal();
145         afx_msg void OnChangeGoalDesc();
146         afx_msg void OnChangeGoalRating();
147         afx_msg void OnSelchangeGoalTypeDrop();
148         afx_msg void OnChangeGoalName();
149         afx_msg void OnOk();
150         afx_msg void OnClose();
151         afx_msg void OnGoalInvalid();
152         afx_msg void OnChangeGoalScore();
153         afx_msg void OnNoMusic();
154         afx_msg void OnSelchangeTeam();
155         //}}AFX_MSG
156         DECLARE_MESSAGE_MAP()
157
158         int cur_goal;
159         int m_num_goals;
160         int m_sig[MAX_GOALS];
161         mission_goal m_goals[MAX_GOALS];
162         int modified;
163 };
164
165 extern CMissionGoalsDlg *Goal_editor_dlg; // global reference needed by sexp_tree class
166