2 * $Logfile: /Freespace2/code/Fred2/ShipEditorDlg.h $
7 * Single ship editing dialog
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 4 5/20/99 7:00p Dave
15 * Added alternate type names for ships. Changed swarm missile table
18 * 3 2/11/99 2:15p Andsager
19 * Add ship explosion modification to FRED
21 * 2 10/07/98 6:28p Dave
22 * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
23 * Fred. Globalized mission and campaign file extensions. Removed Silent
24 * Threat specific code.
26 * 1 10/07/98 3:01p Dave
28 * 1 10/07/98 3:00p Dave
30 * 65 4/07/98 9:42a Allender
31 * put in persona combo box into ship editor. Removed code to assign
32 * personas based on message
34 * 64 3/27/98 12:02p Sandeep
36 * 63 3/25/98 4:14p Hoffoss
37 * Split ship editor up into ship editor and a misc dialog, which tracks
40 * 62 3/16/98 8:27p Allender
41 * Fred support for two new AI flags -- kamikaze and no dynamic goals.
43 * 61 3/09/98 4:30p Allender
44 * multiplayer secondary weapon changes. red-alert and cargo-known-delay
45 * sexpressions. Add time cargo revealed to ship structure
47 * 60 2/17/98 11:42a Hoffoss
48 * Added support for hidden from sensors condition.
50 * 59 2/06/98 2:54p Hoffoss
51 * Fixed some bugs in dialog init, and cleared up some of the confusion
52 * about how it works by renaming some variables and adding comments.
54 * 58 1/29/98 5:14p Hoffoss
55 * Added support for a SF_INVULNERABLE ship flag in Fred.
57 * 57 11/13/97 4:14p Allender
58 * automatic assignment of hotkeys for starting wings. Appripriate
59 * warnings when they are incorrectly used. hotkeys correctly assigned to
60 * ships/wing arriving after mission start
62 * 56 11/10/97 10:13p Allender
63 * added departure anchor to Fred and Freespace in preparation for using
64 * docking bays. Functional in Fred, not in FreeSpace.
66 * 55 10/21/97 4:49p Allender
67 * added flags to Fred and FreeSpace to forgo warp effect (toggle in ship
70 * 54 10/14/97 5:33p Hoffoss
71 * Added Fred support (and fsm support) for the no_arrival_music flags in
74 * 53 9/17/97 5:43p Hoffoss
75 * Added Fred support for new player start information.
77 * 52 9/04/97 4:31p Hoffoss
78 * Fixed bug: Changed ship editor to not touch wing info (arrival or
79 * departure cues) to avoid conflicts with wing editor's changes.
81 * 51 8/30/97 9:52p Hoffoss
82 * Implemented arrival location, distance, and anchor in Fred.
84 * 50 8/25/97 5:56p Hoffoss
85 * Added multiple asteroid field support, loading and saving of asteroid
86 * fields, and ship score field to Fred.
88 * 49 8/20/97 6:53p Hoffoss
89 * Implemented escort flag support in Fred.
91 * 48 8/16/97 12:06p Hoffoss
92 * Fixed bug where a whole wing is deleted that is being referenced.
94 * 47 8/12/97 7:17p Hoffoss
95 * Added previous button to ship and wing editors.
97 * 46 8/12/97 6:32p Hoffoss
98 * Added code to allow hiding of arrival and departure cues in editors.
100 * 45 8/08/97 1:31p Hoffoss
101 * Added syncronization protection to cur_object_index changes.
106 #ifndef _SHIPEDITORDLG_H
107 #define _SHIPEDITORDLG_H
109 #include "sexp_tree.h"
110 #include "shipgoalsdlg.h"
111 #include "management.h"
113 /////////////////////////////////////////////////////////////////////////////
114 // CShipEditorDlg dialog
116 #define WM_GOODBYE (WM_USER+5)
117 #define ID_ALWAYS_ON_TOP 0x0f00
119 class numeric_edit_control
127 void setup(int id, CWnd *wnd);
128 void blank() { unique = 0; }
136 class CShipEditorDlg : public CDialog
139 int make_ship_list(int *arr);
140 int update_ship(int ship);
145 int mission_type; // indicates if single player(1) or multiplayer(0)
147 CCriticalSection CS_update;
151 int player_ship, single_ship;
154 int select_sexp_node;
158 int enable; // used to enable(1)/disable(0) controls based on if any ship selected
159 int p_enable; // used to enable(1)/disable(0) controls based on if a player ship
161 int tristate_set(int val, int cur_state);
162 void show_hide_sexp_help();
163 void calc_cue_height();
165 void OnInitMenu(CMenu *m);
167 int update_data(int redraw = 1);
168 void initialize_data(int full);
169 CShipEditorDlg(CWnd* pParent = NULL); // standard constructor
170 CShipEditorDlg(CView* pView);
172 // alternate ship name stuff
173 void ship_alt_name_init(int base_ship);
174 void ship_alt_name_close(int base_ship);
179 //{{AFX_DATA(CShipEditorDlg)
180 enum { IDD = IDD_SHIP_EDITOR };
181 CButton m_no_departure_warp;
182 CButton m_no_arrival_warp;
183 CButton m_player_ship;
184 CSpinButtonCtrl m_destroy_spin;
185 CSpinButtonCtrl m_departure_delay_spin;
186 CSpinButtonCtrl m_arrival_delay_spin;
187 sexp_tree m_departure_tree;
188 sexp_tree m_arrival_tree;
193 int m_arrival_location;
194 int m_departure_location;
196 numeric_edit_control m_arrival_delay;
197 numeric_edit_control m_departure_delay;
199 BOOL m_update_arrival;
200 BOOL m_update_departure;
201 numeric_edit_control m_destroy_value;
202 numeric_edit_control m_score;
203 numeric_edit_control m_arrival_dist;
204 numeric_edit_control m_kdamage;
205 int m_arrival_target;
206 int m_departure_target;
211 // ClassWizard generated virtual function overrides
212 //{{AFX_VIRTUAL(CShipEditorDlg)
214 virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
216 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
217 virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
223 // Generated message map functions
224 //{{AFX_MSG(CShipEditorDlg)
225 afx_msg void OnClose();
226 afx_msg void OnRclickArrivalTree(NMHDR* pNMHDR, LRESULT* pResult);
227 afx_msg void OnRclickDepartureTree(NMHDR* pNMHDR, LRESULT* pResult);
228 afx_msg void OnBeginlabeleditArrivalTree(NMHDR* pNMHDR, LRESULT* pResult);
229 afx_msg void OnBeginlabeleditDepartureTree(NMHDR* pNMHDR, LRESULT* pResult);
230 afx_msg void OnEndlabeleditArrivalTree(NMHDR* pNMHDR, LRESULT* pResult);
231 afx_msg void OnEndlabeleditDepartureTree(NMHDR* pNMHDR, LRESULT* pResult);
232 afx_msg void OnGoals();
233 afx_msg void OnSelchangeShipClass();
234 afx_msg void OnInitialStatus();
235 afx_msg void OnWeapons();
236 afx_msg void OnShipReset();
237 afx_msg void OnDeleteShip();
238 afx_msg void OnShipTbl();
239 afx_msg void OnNext();
240 afx_msg void OnSelchangedArrivalTree(NMHDR* pNMHDR, LRESULT* pResult);
241 afx_msg void OnSelchangedDepartureTree(NMHDR* pNMHDR, LRESULT* pResult);
242 afx_msg void OnHideCues();
243 afx_msg void OnPrev();
244 afx_msg void OnSelchangeArrivalLocation();
245 afx_msg void OnPlayerShip();
246 afx_msg void OnNoArrivalWarp();
247 afx_msg void OnNoDepartureWarp();
248 afx_msg void OnSelchangeDepartureLocation();
249 afx_msg void OnSelchangeHotkey();
250 afx_msg void OnFlags();
251 afx_msg void OnIgnoreOrders();
252 afx_msg void OnSpecialExp();
254 DECLARE_MESSAGE_MAP()