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

Method OnNewDocument

editor/editorDoc.cpp:166–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164// CEditorDoc commands
165
166BOOL CEditorDoc::OnNewDocument() {
167 // If Dallas is running, don't create a new document
168 if (theApp.m_DallasModelessDlgPtr != NULL) {
169 OutrageMessageBox("The Dallas Script Editor is open!\n\n"
170 "You must close down Dallas before creating a New Level...");
171 return FALSE;
172 }
173
174 if (!COleServerDoc::OnNewDocument())
175 return FALSE;
176
177 // TODO: add reinitialization code here
178 // (SDI documents will reuse this document)
179
180 // Reinitialize Editor State.
181 mprintf(0, "Creating new level...\n");
182 // D3EditState.texdlg_texture = 0;
183
184 // Create new mine
185 CreateNewMine();
186 SetModifiedFlag(FALSE);
187 theApp.main_doc = this;
188
189 // Remove any "Untitled" dallas script files
190 char fullpath[_MAX_PATH];
191 ddio_MakePath(fullpath, LocalScriptDir, "Untitled.cpp", NULL);
192 ddio_DeleteFile(fullpath);
193 ddio_MakePath(fullpath, LocalScriptDir, "Untitled.dll", NULL);
194 ddio_DeleteFile(fullpath);
195 ddio_MakePath(fullpath, LocalScriptDir, "Untitled.msg", NULL);
196 ddio_DeleteFile(fullpath);
197
198 return TRUE;
199}
200
201BOOL CEditorDoc::OnOpenDocument(LPCTSTR lpszPathName) {
202 BOOL opened;

Callers

nothing calls this directly

Calls 4

OutrageMessageBoxFunction · 0.85
CreateNewMineFunction · 0.85
ddio_MakePathFunction · 0.50
ddio_DeleteFileFunction · 0.50

Tested by

no test coverage detected