| 199 | } |
| 200 | |
| 201 | BOOL 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 | |
| 238 | BOOL CEditorDoc::OnSaveDocument(LPCTSTR lpszPathName) { |
| 239 | // TODO: Add your specialized code here and/or call the base class |
no test coverage detected