| 164 | // CEditorDoc commands |
| 165 | |
| 166 | BOOL 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 | |
| 201 | BOOL CEditorDoc::OnOpenDocument(LPCTSTR lpszPathName) { |
| 202 | BOOL opened; |
nothing calls this directly
no test coverage detected