2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/FRED2/MissionGoalsDlg.h $
15 * Mission goals editor dialog box handling code
18 * Revision 1.2 2002/06/09 04:41:13 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 2 10/07/98 6:28p Dave
26 * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
27 * Fred. Globalized mission and campaign file extensions. Removed Silent
28 * Threat specific code.
30 * 1 10/07/98 3:01p Dave
32 * 1 10/07/98 3:00p Dave
34 * 26 5/20/98 1:04p Hoffoss
35 * Made credits screen use new artwork and removed rating field usage from
36 * Fred (a goal struct member).
38 * 25 3/31/98 12:23a Allender
39 * changed macro names of campaign types to be more descriptive. Added
40 * "team" to objectives dialog for team v. team missions. Added two
41 * distinct multiplayer campaign types
43 * 24 12/08/97 2:03p Hoffoss
44 * Added Fred support for MGF_NO_MUSIC flag in objectives.
46 * 23 10/09/97 1:03p Hoffoss
47 * Renaming events or goals now updates sexp references as well.
49 * 22 8/12/97 3:33p Hoffoss
50 * Fixed the "press cancel to go to reference" code to work properly.
52 * 21 7/30/97 5:23p Hoffoss
53 * Removed Sexp tree verification code, since it duplicates normal sexp
54 * verification, and is just another set of code to keep maintained.
56 * 20 7/25/97 3:05p Allender
57 * added score field to goals and events editor
59 * 19 7/17/97 4:10p Hoffoss
60 * Added drag and drop to sexp trees for reordering root items.
62 * 18 7/07/97 12:04p Allender
63 * mission goal validation.
65 * 17 6/02/97 8:47p Hoffoss
66 * Fixed bug with inserting an operator at root position, but under a
69 * 16 5/20/97 2:28p Hoffoss
70 * Added message box queries for close window operation on all modal
73 * 15 5/01/97 4:12p Hoffoss
74 * Added return handling to dialogs.
76 * 14 4/17/97 2:01p Hoffoss
77 * All dialog box window states are saved between sessions now.
79 * 13 4/11/97 10:11a Hoffoss
80 * Name fields supported by Fred for Events and Mission Goals.
82 * 12 2/17/97 5:28p Hoffoss
83 * Checked RCS headers, added them were missing, changing description to
84 * something better, etc where needed.
89 #include "sexp_tree.h"
90 #include "missiongoals.h"
92 /////////////////////////////////////////////////////////////////////////////
93 // CMissionGoalsDlg dialog
95 #define MAX_GOAL_ELEMENTS 300
99 class sexp_goal_tree : public sexp_tree
102 int load_sub_tree(int index);
103 int get_new_node_position();
106 class CMissionGoalsDlg : public CDialog
110 void swap_handler(int node1, int node2);
111 int query_modified();
115 void update_cur_goal();
116 void add_sub_tree(int node, HTREEITEM root);
118 CMissionGoalsDlg(CWnd* pParent = NULL); // standard constructor
120 int handler(int code, int goal);
121 void insert_handler(int old, int node);
122 int select_sexp_node;
125 //{{AFX_DATA(CMissionGoalsDlg)
126 enum { IDD = IDD_MISSION_GOALS };
127 sexp_goal_tree m_goals_tree;
130 int m_display_goal_types;
140 // ClassWizard generated virtual function overrides
141 //{{AFX_VIRTUAL(CMissionGoalsDlg)
143 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
148 // Generated message map functions
149 //{{AFX_MSG(CMissionGoalsDlg)
150 afx_msg void OnSelchangeDisplayGoalTypesDrop();
151 afx_msg void OnSelchangedGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
152 afx_msg void OnRclickGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
153 afx_msg void OnEndlabeleditGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
154 afx_msg void OnBeginlabeleditGoalsTree(NMHDR* pNMHDR, LRESULT* pResult);
155 afx_msg void OnButtonNewGoal();
156 afx_msg void OnChangeGoalDesc();
157 afx_msg void OnChangeGoalRating();
158 afx_msg void OnSelchangeGoalTypeDrop();
159 afx_msg void OnChangeGoalName();
161 afx_msg void OnClose();
162 afx_msg void OnGoalInvalid();
163 afx_msg void OnChangeGoalScore();
164 afx_msg void OnNoMusic();
165 afx_msg void OnSelchangeTeam();
167 DECLARE_MESSAGE_MAP()
171 int m_sig[MAX_GOALS];
172 mission_goal m_goals[MAX_GOALS];
176 extern CMissionGoalsDlg *Goal_editor_dlg; // global reference needed by sexp_tree class