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