@@ -664,80 +664,6 @@ BOOL CMUSHclientDoc::OnNewDocument()
664
664
SetDefaults (false ); // set up numeric/boolean defaults
665
665
SetAlphaDefaults (false ); // set up alpha defaults
666
666
667
- if (App.m_TypeOfNewDocument == App.eNormalNewDocument ) // only ask on normal new world
668
- {
669
- int i = ::TMessageBox (" Preload world defaults from an existing world?" ,
670
- MB_YESNOCANCEL | MB_ICONQUESTION);
671
-
672
- if (i == IDCANCEL)
673
- return FALSE ;
674
-
675
- if (i == IDYES)
676
- while (TRUE ) // loop until successful read of file, or cancel
677
- {
678
- // Get file
679
- CString strFilter (MAKEINTRESOURCE (IDS_OPEN_WORLD_FILTER));
680
- CString strTitle (MAKEINTRESOURCE (IDS_OPEN_WORLD_TITLE));
681
- CFileDialog dlg (TRUE , // TRUE for FileOpen
682
- NULL , // default extension
683
- NULL , // no initial file name
684
- OFN_HIDEREADONLY|OFN_FILEMUSTEXIST,
685
- strFilter);
686
- dlg.m_ofn .lpstrTitle = strTitle;
687
-
688
- // use default world file directory
689
- dlg.m_ofn .lpstrInitialDir = Make_Absolute_Path (App.m_strDefaultWorldFileDirectory );
690
-
691
- ChangeToFileBrowsingDirectory ();
692
- int nResult = dlg.DoModal ();
693
- ChangeToStartupDirectory ();
694
-
695
- if (nResult != IDOK)
696
- break ;
697
- CString strFileName = dlg.GetPathName ();
698
-
699
- CWaitCursor wait;
700
-
701
- try
702
- {
703
-
704
- // Open existing world file
705
- CFile fileWorld (strFileName, CFile::modeRead|CFile::shareDenyWrite);
706
-
707
- CArchive ar (&fileWorld, CArchive::load);
708
-
709
- try
710
- {
711
- Serialize (ar);
712
- }
713
- catch (CException* e)
714
- {
715
- ::TMessageBox (" Unexpected file format - invalid world file" , MB_ICONEXCLAMATION);
716
- e->Delete ();
717
- ar.Close ();
718
- continue ;
719
- }
720
-
721
- ar.Close ();
722
-
723
- }
724
- catch (CException* e)
725
- {
726
- ::TMessageBox (" Unable to open world file" , MB_ICONEXCLAMATION);
727
- e->Delete ();
728
- continue ;
729
- }
730
-
731
- // if we got here, we successfully loaded the world!
732
-
733
- SetModifiedFlag ();
734
- m_strWorldID = GetUniqueID (); // new world ID
735
-
736
- break ;
737
-
738
- } // end of preloading defaults
739
- } // end of normal new world
740
-
741
667
// if defaults are wanted, overwrite what we loaded with them :)
742
668
743
669
if (m_bLoaded)
0 commit comments