2 * $Logfile: /Freespace2/code/FRED2/MissionGoalsDlg.h $
7 * Mission goals editor dialog box handling code
10 * Revision 1.1 2002/05/03 03:28:12 root
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.
19 * 1 10/07/98 3:01p Dave
21 * 1 10/07/98 3:00p Dave
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).
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
32 * 24 12/08/97 2:03p Hoffoss
33 * Added Fred support for MGF_NO_MUSIC flag in objectives.
35 * 23 10/09/97 1:03p Hoffoss
36 * Renaming events or goals now updates sexp references as well.
38 * 22 8/12/97 3:33p Hoffoss
39 * Fixed the "press cancel to go to reference" code to work properly.
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.
45 * 20 7/25/97 3:05p Allender
46 * added score field to goals and events editor
48 * 19 7/17/97 4:10p Hoffoss
49 * Added drag and drop to sexp trees for reordering root items.
51 * 18 7/07/97 12:04p Allender
52 * mission goal validation.
54 * 17 6/02/97 8:47p Hoffoss
55 * Fixed bug with inserting an operator at root position, but under a
58 * 16 5/20/97 2:28p Hoffoss
59 * Added message box queries for close window operation on all modal
62 * 15 5/01/97 4:12p Hoffoss
63 * Added return handling to dialogs.
65 * 14 4/17/97 2:01p Hoffoss
66 * All dialog box window states are saved between sessions now.
68 * 13 4/11/97 10:11a Hoffoss
69 * Name fields supported by Fred for Events and Mission Goals.
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.
78 #include "sexp_tree.h"
79 #include "missiongoals.h"
81 /////////////////////////////////////////////////////////////////////////////
82 // CMissionGoalsDlg dialog
84 #define MAX_GOAL_ELEMENTS 300
88 class sexp_goal_tree : public sexp_tree
91 int load_sub_tree(int index);
92 int get_new_node_position();
95 class CMissionGoalsDlg : public CDialog
99 void swap_handler(int node1, int node2);
100 int query_modified();
104 void update_cur_goal();
105 void add_sub_tree(int node, HTREEITEM root);
107 CMissionGoalsDlg(CWnd* pParent = NULL); // standard constructor
109 int handler(int code, int goal);
110 void insert_handler(int old, int node);
111 int select_sexp_node;
114 //{{AFX_DATA(CMissionGoalsDlg)
115 enum { IDD = IDD_MISSION_GOALS };
116 sexp_goal_tree m_goals_tree;
119 int m_display_goal_types;
129 // ClassWizard generated virtual function overrides
130 //{{AFX_VIRTUAL(CMissionGoalsDlg)
132 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
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();
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();
156 DECLARE_MESSAGE_MAP()
160 int m_sig[MAX_GOALS];
161 mission_goal m_goals[MAX_GOALS];
165 extern CMissionGoalsDlg *Goal_editor_dlg; // global reference needed by sexp_tree class