[Sphere-axis-commits] CVS: Axis/S_Sphere55 ScriptsMain.cpp,1.1,1.2
Brought to you by:
pesterle
From: Philip E. <pes...@us...> - 2004-04-22 18:54:50
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere55 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28532 Modified Files: ScriptsMain.cpp Log Message: no message Index: ScriptsMain.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere55/ScriptsMain.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** ScriptsMain.cpp 16 Apr 2004 20:59:34 -0000 1.1 --- ScriptsMain.cpp 22 Apr 2004 18:54:39 -0000 1.2 *************** *** 2838,2843 **** if ( csaScripts.GetSize() > 0 ) { - // Load the specified scripts - //this->m_bNewFormat = true; /* m_pRemote->SetDialog(m_pDlg); --- 2838,2841 ---- *************** *** 2921,2925 **** { this->LoadFile(_T("custloc.scp")); - // this->m_bNewFormat = true; CategorizeLocations(); CategorizeItems(); --- 2919,2922 ---- *************** *** 3000,3090 **** } } ! if ( this->m_tables.m_resources.GetSize() > 0 ) ! { ! TCHAR szCount[MAX_BUFFER]; ! _stprintf(szCount, _T("%ld"), m_tables.m_resources.GetSize()); ! LOG( locale->String(IDS_SCRIPTS_FOUNDRESOURCES), szCount); ! LOG( locale->String(IDS_SCRIPTS_NEWSCRIPTS)); ! //m_bNewFormat = true; ! // We've got resources to deal with here ! for ( int index = 0; index < this->m_tables.m_resources.GetSize(); index++ ) ! { ! CString csFilename = this->m_tables.m_resources.GetAt(index); ! if ( csFilename.Find(_T("//")) != -1 ) ! csFilename = csFilename.Left(csFilename.Find(_T("//"))); ! if ( csFilename == _T("") ) ! continue; ! if ( Main->GetProfileType() == PROFILE_REMOTE ) ! { ! CString csFile; ! if ( csFilename.GetAt(0) == _T('\\') || csFilename.GetAt(0) == _T('/')) ! csFile = csFilename.Mid(1); ! else ! csFile = csFilename; ! csFilename = csFile; ! } ! // See if there was no path specified here...if not, try using the SCPFILES path ! if ( csFilename.Find(_T('\\')) == -1 && csFilename.Find(_T('/')) == -1 ) ! { ! CString csScpPath = Main->m_pScripts->m_config.m_sSCPBaseDir; ! if ( csScpPath.GetLength() > 0 && ( csScpPath.GetAt(csScpPath.GetLength() - 1) == _T('\\') || csScpPath.GetAt(csScpPath.GetLength() -1) == _T('/') ) ) ! csScpPath.SetAt(csScpPath.GetLength() - 1, 0x00); ! if ( csScpPath.GetLength() > 0 ) ! csLoadFile.Format(_T("%s\\%s"), csScpPath, csFilename); ! else ! csLoadFile = csFilename; ! if ( Main->GetProfileType() == PROFILE_REMOTE ) ! csFilename = csLoadFile; ! } else { ! if ( csFilename.Find(_T(":")) == -1 ) ! { ! if ( this->m_csRootDirectory.GetLength() > 0 ) ! csLoadFile.Format(_T("%s\\%s"), this->m_csRootDirectory, csFilename); ! else ! csLoadFile = csFilename; ! } else csLoadFile = csFilename; } ! if ( Main->GetProfileType() == PROFILE_REMOTE ) ! { ! csFilename.Replace(_T(':'), _T('!')); ! csLoadFile.Format(_T("%s\\%s\\%s"), cwd, Main->GetProfileString(), csFilename); ! } ! CString csTest = csFilename; ! csTest.MakeLower(); ! if ( csTest.Find(TABLE_FILE) == -1 ) ! LoadFile(csLoadFile); } ! this->LoadFile(_T("hoglocs.scp")); ! this->LoadFile(_T("custloc.scp")); ! } ! else ! { ! // This must be the old script format ! LOG( locale->String(IDS_SCRIPTS_OLDSCRIPTS)); ! CreateProgressDialog(); ! this->LoadDefs(); ! this->LoadItems(); ! this->LoadLocations(); ! this->LoadMap(); ! this->LoadNames(); ! this->LoadNPCs(); ! this->LoadSpeechBlocks(); ! this->LoadTables(); ! this->LoadTemplates(); ! this->LoadTriggers(); } this->CategorizeItems(); this->CategorizeLocations(); this->CategorizeNPCs(); LOG( locale->String(IDS_SCRIPTS_FINISHEDLOADING)); - /* - if ( m_pRemote ) - m_pRemote->SetDialog(NULL); - */ m_bDeleteDialog = true; DestroyProgressDialog(); --- 2997,3063 ---- } } ! TCHAR szCount[MAX_BUFFER]; ! _stprintf(szCount, _T("%ld"), m_tables.m_resources.GetSize()); ! LOG( locale->String(IDS_SCRIPTS_FOUNDRESOURCES), szCount); ! LOG( locale->String(IDS_SCRIPTS_NEWSCRIPTS)); ! for ( int index = 0; index < this->m_tables.m_resources.GetSize(); index++ ) ! { ! CString csFilename = this->m_tables.m_resources.GetAt(index); ! if ( csFilename.Find(_T("//")) != -1 ) ! csFilename = csFilename.Left(csFilename.Find(_T("//"))); ! if ( csFilename == _T("") ) ! continue; ! if ( Main->GetProfileType() == PROFILE_REMOTE ) ! { ! CString csFile; ! if ( csFilename.GetAt(0) == _T('\\') || csFilename.GetAt(0) == _T('/')) ! csFile = csFilename.Mid(1); ! else ! csFile = csFilename; ! csFilename = csFile; ! } ! // See if there was no path specified here...if not, try using the SCPFILES path ! if ( csFilename.Find(_T('\\')) == -1 && csFilename.Find(_T('/')) == -1 ) ! { ! CString csScpPath = Main->m_pScripts->m_config.m_sSCPBaseDir; ! if ( csScpPath.GetLength() > 0 && ( csScpPath.GetAt(csScpPath.GetLength() - 1) == _T('\\') || csScpPath.GetAt(csScpPath.GetLength() -1) == _T('/') ) ) ! csScpPath.SetAt(csScpPath.GetLength() - 1, 0x00); ! if ( csScpPath.GetLength() > 0 ) ! csLoadFile.Format(_T("%s\\%s"), csScpPath, csFilename); else + csLoadFile = csFilename; + if ( Main->GetProfileType() == PROFILE_REMOTE ) + csFilename = csLoadFile; + } + else + { + if ( csFilename.Find(_T(":")) == -1 ) { ! if ( this->m_csRootDirectory.GetLength() > 0 ) ! csLoadFile.Format(_T("%s\\%s"), this->m_csRootDirectory, csFilename); else csLoadFile = csFilename; } ! else ! csLoadFile = csFilename; } ! if ( Main->GetProfileType() == PROFILE_REMOTE ) ! { ! csFilename.Replace(_T(':'), _T('!')); ! csLoadFile.Format(_T("%s\\%s\\%s"), cwd, Main->GetProfileString(), csFilename); ! } ! CString csTest = csFilename; ! csTest.MakeLower(); ! if ( csTest.Find(TABLE_FILE) == -1 ) ! LoadFile(csLoadFile); } + this->LoadFile(_T("hoglocs.scp")); + this->LoadFile(_T("custloc.scp")); + this->CategorizeItems(); this->CategorizeLocations(); this->CategorizeNPCs(); LOG( locale->String(IDS_SCRIPTS_FINISHEDLOADING)); m_bDeleteDialog = true; DestroyProgressDialog(); |