Skip to content

Commit 579afc0

Browse files
committed
Got rid of 'preload world defaults' dialog on making a new world
1 parent c295f84 commit 579afc0

File tree

2 files changed

+1
-75
lines changed

2 files changed

+1
-75
lines changed

doc_construct.cpp

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -664,80 +664,6 @@ BOOL CMUSHclientDoc::OnNewDocument()
664664
SetDefaults (false); // set up numeric/boolean defaults
665665
SetAlphaDefaults (false); // set up alpha defaults
666666

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-
741667
// if defaults are wanted, overwrite what we loaded with them :)
742668

743669
if (m_bLoaded)

xml/xml_serialize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void CMUSHclientDoc::Serialize_World_XML (CArchive& ar)
4646
m_CurrentPlugin = pSavedPlugin;
4747
}
4848
else
49-
{ // loaidng
49+
{ // loading
5050
Load_World_XML (ar, (unsigned long) ~(XML_PLUGINS | XML_NO_PLUGINS)); // load all options, except plugins
5151
m_bLoaded = true; // this world has been loaded from disk
5252
}

0 commit comments

Comments
 (0)