MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / OnOpenDocument

Method OnOpenDocument

editor/editorDoc.cpp:201–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201BOOL CEditorDoc::OnOpenDocument(LPCTSTR lpszPathName) {
202 BOOL opened;
203
204 // If Dallas is running, don't open the document
205 if (theApp.m_DallasModelessDlgPtr != NULL) {
206 OutrageMessageBox("The Dallas Script Editor is open!\n\n"
207 "You must close down Dallas before loading a new level...");
208 return FALSE;
209 }
210
211 // if (!COleServerDoc::OnOpenDocument(lpszPathName))
212 // return FALSE;
213
214 // TODO: Add your specialized creation code here
215 // does the level always load correctly?
216 mprintf(0, "Opening level %s...\n", lpszPathName);
217
218 theApp.pause();
219 CKeypadDialog::Deactivate();
220 opened = EditorLoadLevel((char *)lpszPathName);
221 CKeypadDialog::Activate();
222 theApp.resume();
223
224 if (!opened) {
225 SetModifiedFlag(TRUE); // say that the old level was trashed
226 return FALSE;
227 }
228
229 if (D3EditState.objmodeless_on)
230 theApp.main_frame->m_ObjModeless->Refresh();
231
232 SetModifiedFlag(FALSE);
233 theApp.main_doc = this;
234
235 return true;
236}
237
238BOOL CEditorDoc::OnSaveDocument(LPCTSTR lpszPathName) {
239 // TODO: Add your specialized code here and/or call the base class

Callers 1

OpenDocumentFileMethod · 0.80

Calls 5

OutrageMessageBoxFunction · 0.85
EditorLoadLevelFunction · 0.85
pauseMethod · 0.80
resumeMethod · 0.45
RefreshMethod · 0.45

Tested by

no test coverage detected