]> icculus.org git repositories - taylor/freespace2.git/blob - include/shipeditordlg.h
Initial revision
[taylor/freespace2.git] / include / shipeditordlg.h
1 /*
2  * $Logfile: /Freespace2/code/Fred2/ShipEditorDlg.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Single ship editing dialog
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 4     5/20/99 7:00p Dave
15  * Added alternate type names for ships. Changed swarm missile table
16  * entries.
17  * 
18  * 3     2/11/99 2:15p Andsager
19  * Add ship explosion modification to FRED
20  * 
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.
25  * 
26  * 1     10/07/98 3:01p Dave
27  * 
28  * 1     10/07/98 3:00p Dave
29  * 
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
33  * 
34  * 64    3/27/98 12:02p Sandeep
35  * 
36  * 63    3/25/98 4:14p Hoffoss
37  * Split ship editor up into ship editor and a misc dialog, which tracks
38  * flags and such.
39  * 
40  * 62    3/16/98 8:27p Allender
41  * Fred support for two new AI flags -- kamikaze and no dynamic goals.
42  * 
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
46  * 
47  * 60    2/17/98 11:42a Hoffoss
48  * Added support for hidden from sensors condition.
49  * 
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.
53  * 
54  * 58    1/29/98 5:14p Hoffoss
55  * Added support for a SF_INVULNERABLE ship flag in Fred.
56  * 
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
61  * 
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.
65  * 
66  * 55    10/21/97 4:49p Allender
67  * added flags to Fred and FreeSpace to forgo warp effect (toggle in ship
68  * editor in Fred)
69  * 
70  * 54    10/14/97 5:33p Hoffoss
71  * Added Fred support (and fsm support) for the no_arrival_music flags in
72  * ships and wings.
73  * 
74  * 53    9/17/97 5:43p Hoffoss
75  * Added Fred support for new player start information.
76  * 
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.
80  * 
81  * 51    8/30/97 9:52p Hoffoss
82  * Implemented arrival location, distance, and anchor in Fred.
83  * 
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.
87  * 
88  * 49    8/20/97 6:53p Hoffoss
89  * Implemented escort flag support in Fred.
90  * 
91  * 48    8/16/97 12:06p Hoffoss
92  * Fixed bug where a whole wing is deleted that is being referenced.
93  * 
94  * 47    8/12/97 7:17p Hoffoss
95  * Added previous button to ship and wing editors.
96  * 
97  * 46    8/12/97 6:32p Hoffoss
98  * Added code to allow hiding of arrival and departure cues in editors.
99  * 
100  * 45    8/08/97 1:31p Hoffoss
101  * Added syncronization protection to cur_object_index changes.
102  *
103  * $NoKeywords: $
104  */
105
106 #ifndef _SHIPEDITORDLG_H
107 #define _SHIPEDITORDLG_H
108
109 #include "sexp_tree.h"
110 #include "shipgoalsdlg.h"
111 #include "management.h"
112
113 /////////////////////////////////////////////////////////////////////////////
114 // CShipEditorDlg dialog
115
116 #define WM_GOODBYE      (WM_USER+5)
117 #define ID_ALWAYS_ON_TOP        0x0f00
118
119 class numeric_edit_control
120 {
121         int value;
122         int unique;
123         int control_id;
124         CWnd *dlg;
125
126 public:
127         void setup(int id, CWnd *wnd);
128         void blank() { unique = 0; }
129         void init(int n);
130         void set(int n);
131         void display();
132         void save(int *n);
133         void fix(int n);
134 };
135
136 class CShipEditorDlg : public CDialog
137 {
138 private:
139         int make_ship_list(int *arr);
140         int update_ship(int ship);
141         int initialized;
142         int multi_edit;
143         int always_on_top;
144         int cue_height;
145         int mission_type;  // indicates if single player(1) or multiplayer(0)
146         CView*  m_pSEView;
147         CCriticalSection CS_update;
148
149 // Construction
150 public:
151         int player_ship, single_ship;
152         int editing;
153         int modified;
154         int select_sexp_node;
155         int bypass_errors;
156         int bypass_all;
157
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
160
161         int tristate_set(int val, int cur_state);
162         void show_hide_sexp_help();
163         void calc_cue_height();
164         int verify();
165         void OnInitMenu(CMenu *m);
166         void OnOK();
167         int update_data(int redraw = 1);
168         void initialize_data(int full);
169         CShipEditorDlg(CWnd* pParent = NULL);   // standard constructor
170         CShipEditorDlg(CView* pView);
171
172         // alternate ship name stuff
173         void ship_alt_name_init(int base_ship);
174         void ship_alt_name_close(int base_ship);
175
176         BOOL Create();
177
178 // Dialog Data
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;
189         CString m_ship_name;
190         CString m_cargo1;
191         int             m_ship_class;
192         int             m_team;
193         int             m_arrival_location;
194         int             m_departure_location;
195         int             m_ai_class;
196         numeric_edit_control    m_arrival_delay;
197         numeric_edit_control    m_departure_delay;
198         int             m_hotkey;
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;
207         int             m_persona;      
208         //}}AFX_DATA
209
210 // Overrides
211         // ClassWizard generated virtual function overrides
212         //{{AFX_VIRTUAL(CShipEditorDlg)
213         public:
214         virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
215         protected:
216         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
217         virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
218         //}}AFX_VIRTUAL
219
220 // Implementation
221 protected:
222
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();
253         //}}AFX_MSG
254         DECLARE_MESSAGE_MAP()
255 };
256
257 #endif
258