]> icculus.org git repositories - taylor/freespace2.git/blob - include/missiongoalsdlg.h
fix issue with looping audio streams
[taylor/freespace2.git] / include / missiongoalsdlg.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
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
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/FRED2/MissionGoalsDlg.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Mission goals editor dialog box handling code
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:13  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
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.
29  * 
30  * 1     10/07/98 3:01p Dave
31  * 
32  * 1     10/07/98 3:00p Dave
33  * 
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).
37  * 
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
42  * 
43  * 24    12/08/97 2:03p Hoffoss
44  * Added Fred support for MGF_NO_MUSIC flag in objectives.
45  * 
46  * 23    10/09/97 1:03p Hoffoss
47  * Renaming events or goals now updates sexp references as well.
48  * 
49  * 22    8/12/97 3:33p Hoffoss
50  * Fixed the "press cancel to go to reference" code to work properly.
51  * 
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.
55  * 
56  * 20    7/25/97 3:05p Allender
57  * added score field to goals and events editor
58  * 
59  * 19    7/17/97 4:10p Hoffoss
60  * Added drag and drop to sexp trees for reordering root items.
61  * 
62  * 18    7/07/97 12:04p Allender
63  * mission goal validation.
64  * 
65  * 17    6/02/97 8:47p Hoffoss
66  * Fixed bug with inserting an operator at root position, but under a
67  * label.
68  * 
69  * 16    5/20/97 2:28p Hoffoss
70  * Added message box queries for close window operation on all modal
71  * dialog boxes.
72  * 
73  * 15    5/01/97 4:12p Hoffoss
74  * Added return handling to dialogs.
75  * 
76  * 14    4/17/97 2:01p Hoffoss
77  * All dialog box window states are saved between sessions now.
78  * 
79  * 13    4/11/97 10:11a Hoffoss
80  * Name fields supported by Fred for Events and Mission Goals.
81  * 
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.
85  *
86  * $NoKeywords: $
87  */
88
89 #include "sexp_tree.h"
90 #include "missiongoals.h"
91
92 /////////////////////////////////////////////////////////////////////////////
93 // CMissionGoalsDlg dialog
94
95 #define MAX_GOAL_ELEMENTS 300
96 #define OPERAND 0x01
97 #define EDITABLE        0x02
98
99 class sexp_goal_tree : public sexp_tree
100 {
101 public:
102         int load_sub_tree(int index);
103         int get_new_node_position();
104 };
105
106 class CMissionGoalsDlg : public CDialog
107 {
108 // Construction
109 public:
110         void swap_handler(int node1, int node2);
111         int query_modified();
112         void OnCancel();
113         void OnOK();
114         void load_tree();
115         void update_cur_goal();
116         void add_sub_tree(int node, HTREEITEM root);
117         void create_tree();
118         CMissionGoalsDlg(CWnd* pParent = NULL);   // standard constructor
119         BOOL OnInitDialog();
120         int handler(int code, int goal);
121         void insert_handler(int old, int node);
122         int select_sexp_node;
123
124 // Dialog Data
125         //{{AFX_DATA(CMissionGoalsDlg)
126         enum { IDD = IDD_MISSION_GOALS };
127         sexp_goal_tree  m_goals_tree;
128         CString m_goal_desc;
129         int             m_goal_type;
130         int             m_display_goal_types;
131         CString m_name;
132         BOOL    m_goal_invalid;
133         int             m_goal_score;
134         BOOL    m_no_music;
135         int             m_team;
136         //}}AFX_DATA
137
138
139 // Overrides
140         // ClassWizard generated virtual function overrides
141         //{{AFX_VIRTUAL(CMissionGoalsDlg)
142         protected:
143         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
144         //}}AFX_VIRTUAL
145
146 // Implementation
147 protected:
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();
160         afx_msg void OnOk();
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();
166         //}}AFX_MSG
167         DECLARE_MESSAGE_MAP()
168
169         int cur_goal;
170         int m_num_goals;
171         int m_sig[MAX_GOALS];
172         mission_goal m_goals[MAX_GOALS];
173         int modified;
174 };
175
176 extern CMissionGoalsDlg *Goal_editor_dlg; // global reference needed by sexp_tree class
177