2 * $Logfile: /Freespace2/code/FRED2/FREDDoc.h $
7 * FREDDoc.h : interface of the CFREDDoc class
8 * Document class for document/view architechure, which we don't really use in
9 * Fred, but MFC forces you do use like it or not. Handles loading/saving
10 * mainly. Most of the MFC related stuff is handled in FredView.
13 * Revision 1.1 2002/05/03 03:28:12 root
17 * 2 10/07/98 6:28p Dave
18 * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
19 * Fred. Globalized mission and campaign file extensions. Removed Silent
20 * Threat specific code.
22 * 1 10/07/98 3:01p Dave
24 * 1 10/07/98 3:00p Dave
26 * 15 8/17/97 10:22p Hoffoss
27 * Fixed several bugs in Fred with Undo feature. In the process, recoded
30 * 14 8/13/97 5:49p Hoffoss
31 * Fixed bugs, made additions.
33 * 13 8/13/97 12:46p Hoffoss
34 * Added campaign error checker, accelerator table, and mission goal data
35 * listings to sexp tree right click menu.
37 * 12 6/09/97 4:57p Hoffoss
38 * Added autosave and undo to Fred.
40 * 11 6/05/97 6:10p Hoffoss
41 * Added features: Autosaving, object hiding. Also fixed some minor bugs.
43 * 10 5/21/97 5:42p Hoffoss
44 * Added features requested on Todo list.
46 * 9 2/20/97 4:03p Hoffoss
47 * Several ToDo items: new reinforcement clears arrival cue, reinforcement
48 * control from ship and wing dialogs, show grid toggle.
50 * 8 2/17/97 5:28p Hoffoss
51 * Checked RCS headers, added them were missing, changing description to
52 * something better, etc where needed.
54 * 14 2/12/97 12:25p Hoffoss
55 * Expanded on global error checker, added initial orders conflict
56 * checking and warning, added waypoint editor dialog and code.
58 * 13 1/30/97 2:24p Hoffoss
59 * Added remaining mission file structures and implemented load/save of
69 #include "missionsave.h"
71 #define MISSION_BACKUP_NAME "Backup"
73 #define US_WORLD_CHANGED 0x01
74 #define US_VIEW_CHANGED 0x02
76 class CFREDDoc : public CDocument
78 protected: // create from serialization only
80 DECLARE_DYNCREATE(CFREDDoc)
86 int load_mission(char *pathname);
87 int autosave(char *desc);
88 int save_matrix(matrix &m, FILE *fp);
89 int save_vector(vector &v, FILE *fp);
90 BOOL confirm_deleting;
91 BOOL show_capital_ships;
95 BOOL show_misc_objects;
99 char mission_pathname[256];
103 CString undo_desc[BACKUP_DEPTH + 1];
106 // ClassWizard generated virtual function overrides
107 //{{AFX_VIRTUAL(CFREDDoc)
109 virtual BOOL OnNewDocument();
110 virtual void Serialize(CArchive& ar);
111 virtual void OnEditClearAll();
112 virtual void DeleteContents();
113 virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
114 virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
120 static void UpdateStatus(int flags = US_WORLD_CHANGED);
123 virtual void AssertValid() const;
124 virtual void Dump(CDumpContext &dc) const;
129 // Generated message map functions
131 //{{AFX_MSG(CFREDDoc)
132 afx_msg void OnEditDelete();
133 afx_msg void OnDuplicate();
134 afx_msg void OnEditCopy();
135 afx_msg void OnEditCut();
136 afx_msg void OnEditHold();
137 afx_msg void OnEditFetch();
138 afx_msg void OnEditPaste();
139 afx_msg void OnEditUndo();
140 afx_msg void OnFilePreferences();
141 afx_msg void OnFileSave();
142 afx_msg void OnFileNew();
143 afx_msg void editor_init_mission();
145 DECLARE_MESSAGE_MAP()
148 int save_waypoint_list(waypoint_list &w, FILE *fp);
149 int save_waypoints(FILE *fp);
150 int save_goals(FILE *fp);
151 int save_wings(FILE *fp);
152 int save_objects(FILE *fp);
153 int save_players(FILE *fp);
154 int save_briefing_info(FILE *fp);
155 int save_plot_info(FILE *fp);
156 int save_mission_info(FILE *FP);
159 extern int Local_modified;
160 extern int Undo_available;
161 extern int Undo_count;
162 extern CFREDDoc *FREDDoc_ptr;
164 void set_modified(BOOL arg = TRUE);
166 /////////////////////////////////////////////////////////////////////////////