2 * $Logfile: /Freespace2/code/Fred2/EventEditor.h $
7 * Event editor dialog box class and event tree class (used for dialog)
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 5 8/26/99 8:52p Dave
15 * Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
17 * 4 5/04/99 5:21p Andsager
19 * 3 2/17/99 2:11p Dave
20 * First full run of squad war. All freespace and tracker side stuff
23 * 2 10/07/98 6:28p Dave
24 * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
25 * Fred. Globalized mission and campaign file extensions. Removed Silent
26 * Threat specific code.
28 * 1 10/07/98 3:01p Dave
30 * 1 10/07/98 3:00p Dave
32 * 27 5/15/98 5:51p Hoffoss
33 * Fixed escape key and cancel button bugs.
35 * 26 4/22/98 9:56a Sandeep
37 * 25 4/20/98 4:40p Hoffoss
38 * Added a button to 4 editors to play the chosen wave file.
40 * 24 4/03/98 5:20p Hoffoss
41 * Changed code so that changing a message's wave file will update the
42 * persona as well, if the wave file has the proper prefix.
44 * 23 2/16/98 6:25p Hoffoss
45 * Did major rework of the whole right_clicked() handler to simplify it
46 * all, break it down and make it more flexible. Should be a lot easier
47 * to work with from now on.
49 * 22 2/16/98 2:42p Hoffoss
50 * Added new code in preparation to simplify the sexp_tree monster.
51 * Checking in code now as a good foundation point that I can revert back
54 * 21 1/08/98 11:18a Hoffoss
55 * Fixed several bugs in new Event Editor.
57 * 20 1/07/98 5:58p Hoffoss
58 * Combined message editor into event editor.
60 * 19 1/06/98 8:25p Hoffoss
61 * Added insert event functionality to event editor.
63 * 18 10/10/97 6:21p Hoffoss
64 * Put in Fred support for training object list editing.
66 * 17 10/09/97 1:03p Hoffoss
67 * Renaming events or goals now updates sexp references as well.
69 * 16 9/30/97 10:01a Hoffoss
70 * Added event chaining support to Fred and FreeSpace.
72 * 15 8/12/97 3:33p Hoffoss
73 * Fixed the "press cancel to go to reference" code to work properly.
75 * 14 7/30/97 5:23p Hoffoss
76 * Removed Sexp tree verification code, since it duplicates normal sexp
77 * verification, and is just another set of code to keep maintained.
79 * 13 7/25/97 3:05p Allender
80 * added score field to goals and events editor
82 * 12 7/24/97 12:45p Hoffoss
83 * Added sexp help system to sexp trees and some dialog boxes.
85 * 11 7/17/97 4:10p Hoffoss
86 * Added drag and drop to sexp trees for reordering root items.
88 * 10 7/15/97 10:30a Allender
89 * added repeat count and interval time to event editor. For use in
90 * repeating events at regular intervals
92 * 9 6/02/97 8:47p Hoffoss
93 * Fixed bug with inserting an operator at root position, but under a
96 * 8 5/20/97 2:28p Hoffoss
97 * Added message box queries for close window operation on all modal
100 * 7 5/01/97 4:12p Hoffoss
101 * Added return handling to dialogs.
103 * 6 4/17/97 2:01p Hoffoss
104 * All dialog box window states are saved between sessions now.
106 * 5 4/11/97 10:10a Hoffoss
107 * Name fields supported by Fred for Events and Mission Goals.
109 * 4 4/07/97 3:48p Hoffoss
110 * Event editor now supports a sporty new delete button!
112 * 3 1/22/97 11:01a Hoffoss
113 * Many bug fixes (those pointed out by Mark during Fred testing trying to
116 * 2 1/13/97 4:54p Hoffoss
117 * Added event editor.
122 #ifndef _EVENTEDITOR_H
123 #define _EVENTEDITOR_H
125 #include "sexp_tree.h"
126 #include "missiongoals.h"
127 #include "missionmessage.h"
129 #define MAX_SEARCH_MESSAGE_DEPTH 5 // maximum search number of event nodes with message text
131 class sexp_event_tree : public sexp_tree
134 int load_sub_tree(int index);
135 int get_new_node_position();
138 /////////////////////////////////////////////////////////////////////////////
139 // event_editor dialog
141 class event_editor : public CDialog
145 void update_persona();
147 char *current_message_name(int index);
148 char *get_message_list_item(int i);
149 int save_message(int num);
150 void update_cur_message();
151 HTREEITEM get_event_handle(int num);
152 void reset_event(int num, HTREEITEM after);
153 void save_event(int e);
154 void swap_handler(int node1, int node2);
155 void insert_handler(int old, int node);
156 int query_modified();
159 int handler(int code, int node, char *str = NULL);
163 int select_sexp_node;
164 event_editor(CWnd* pParent = NULL); // standard constructor
167 //{{AFX_DATA(event_editor)
168 enum { IDD = IDD_EVENT_EDITOR };
169 sexp_event_tree m_event_tree;
176 CString m_obj_key_text;
177 CString m_avi_filename;
178 CString m_message_name;
179 CString m_message_text;
181 CString m_wave_filename;
185 int m_last_message_node;
191 // ClassWizard generated virtual function overrides
192 //{{AFX_VIRTUAL(event_editor)
194 virtual BOOL DestroyWindow();
196 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
202 // Generated message map functions
203 //{{AFX_MSG(event_editor)
204 virtual BOOL OnInitDialog();
205 afx_msg void OnRclickEventTree(NMHDR* pNMHDR, LRESULT* pResult);
206 afx_msg void OnBeginlabeleditEventTree(NMHDR* pNMHDR, LRESULT* pResult);
207 afx_msg void OnEndlabeleditEventTree(NMHDR* pNMHDR, LRESULT* pResult);
208 afx_msg void OnButtonNewEvent();
209 afx_msg void OnDelete();
211 afx_msg void OnClose();
212 afx_msg void OnSelchangedEventTree(NMHDR* pNMHDR, LRESULT* pResult);
213 afx_msg void OnUpdateRepeatCount();
214 afx_msg void OnChained();
215 afx_msg void OnInsert();
216 afx_msg void OnSelchangeMessageList();
217 afx_msg void OnNewMsg();
218 afx_msg void OnDeleteMsg();
219 afx_msg void OnBrowseAvi();
220 afx_msg void OnBrowseWave();
221 afx_msg void OnSelchangeWaveFilename();
222 afx_msg void OnPlay();
223 afx_msg void OnUpdate();
224 afx_msg void On_Cancel();
225 afx_msg void OnSelchangeTeam();
226 afx_msg void OnSelchangeMessageTeam();
227 afx_msg void OnDblclkMessageList();
229 DECLARE_MESSAGE_MAP()
233 void update_cur_event();
235 int m_sig[MAX_MISSION_EVENTS];
236 mission_event m_events[MAX_MISSION_EVENTS];
238 MMessage m_messages[MAX_MISSION_MESSAGES];
239 int m_msg_sig[MAX_MISSION_MESSAGES];
242 extern event_editor *Event_editor_dlg; // global reference needed by event tree class