| Line 227... |
Line 227... |
| 227 |
|
227 |
|
| 228 |
CCatFile cat;
|
228 |
CCatFile cat;
|
| 229 |
if ( CCatFile::Opened(cat.Open(mod, m_sAddon, CATREAD_JUSTCONTENTS, false), false) )
|
229 |
if ( CCatFile::Opened(cat.Open(mod, m_sAddon, CATREAD_JUSTCONTENTS, false), false) )
|
| 230 |
{
|
230 |
{
|
| 231 |
for ( CListNode<SInCatFile> *c = cat.GetFiles()->Front(); c; c = c->next() ) {
|
231 |
for ( CListNode<SInCatFile> *c = cat.GetFiles()->Front(); c; c = c->next() ) {
|
| 232 |
this->_addModFile(CFileIO(c->Data()->sFile).GetFullFilename().ToString(), mod, m_pModMap);
|
232 |
this->_addModFile(CFileIO(c->Data()->sFile).fullFilename(), mod, m_pModMap);
|
| 233 |
loaded = true;
|
233 |
loaded = true;
|
| 234 |
}
|
234 |
}
|
| 235 |
}
|
235 |
}
|
| 236 |
|
236 |
|
| 237 |
return loaded;
|
237 |
return loaded;
|
| Line 246... |
Line 246... |
| 246 |
CCatFile cat;
|
246 |
CCatFile cat;
|
| 247 |
if ( CCatFile::Opened(cat.Open(mod, m_sAddon, CATREAD_JUSTCONTENTS, false), false) )
|
247 |
if ( CCatFile::Opened(cat.Open(mod, m_sAddon, CATREAD_JUSTCONTENTS, false), false) )
|
| 248 |
{
|
248 |
{
|
| 249 |
for ( CListNode<SInCatFile> *c = cat.GetFiles()->Front(); c; c = c->next() )
|
249 |
for ( CListNode<SInCatFile> *c = cat.GetFiles()->Front(); c; c = c->next() )
|
| 250 |
{
|
250 |
{
|
| 251 |
this->_addModFile(CFileIO(c->Data()->sFile).GetFullFilename().ToString(), mod, m_pMap);
|
251 |
this->_addModFile(CFileIO(c->Data()->sFile).fullFilename(), mod, m_pMap);
|
| 252 |
loaded = true;
|
252 |
loaded = true;
|
| 253 |
}
|
253 |
}
|
| 254 |
}
|
254 |
}
|
| 255 |
|
255 |
|
| 256 |
return loaded;
|
256 |
return loaded;
|
| Line 304... |
Line 304... |
| 304 |
{
|
304 |
{
|
| 305 |
Utils::String toFile = file.findReplace("\\", "/").lower();
|
305 |
Utils::String toFile = file.findReplace("\\", "/").lower();
|
| 306 |
|
306 |
|
| 307 |
if ( m_pModMap && !m_pModMap->empty() ) {
|
307 |
if ( m_pModMap && !m_pModMap->empty() ) {
|
| 308 |
if ( !m_sAddon.empty() ) {
|
308 |
if ( !m_sAddon.empty() ) {
|
| 309 |
FileListItr aitr = m_pModMap->find(CFileIO(m_sAddon + "/" + toFile).GetFullFilename().ToLower().c_str());
|
309 |
FileListItr aitr = m_pModMap->find(CFileIO(m_sAddon + "/" + toFile).fullFilename().lower().c_str());
|
| 310 |
if ( aitr == m_pModMap->end() ) aitr = m_pModMap->find(CFileIO(_convertExtension(m_sAddon + "/" + toFile)).GetFullFilename().ToLower().c_str());
|
310 |
if ( aitr == m_pModMap->end() ) aitr = m_pModMap->find(CFileIO(_convertExtension(m_sAddon + "/" + toFile)).fullFilename().lower().c_str());
|
| 311 |
if ( aitr != m_pModMap->end() ) return aitr->second;
|
311 |
if ( aitr != m_pModMap->end() ) return aitr->second;
|
| 312 |
}
|
312 |
}
|
| 313 |
FileListItr itr = m_pModMap->find(CFileIO(toFile).GetFullFilename().ToLower().c_str());
|
313 |
FileListItr itr = m_pModMap->find(CFileIO(toFile).fullFilename().lower().c_str());
|
| 314 |
if ( itr == m_pModMap->end() ) itr = m_pModMap->find(CFileIO(_convertExtension(toFile)).GetFullFilename().ToLower().c_str());
|
314 |
if ( itr == m_pModMap->end() ) itr = m_pModMap->find(CFileIO(_convertExtension(toFile)).fullFilename().lower().c_str());
|
| 315 |
if ( itr != m_pModMap->end() ) return itr->second;
|
315 |
if ( itr != m_pModMap->end() ) return itr->second;
|
| 316 |
}
|
316 |
}
|
| 317 |
else if ( m_pMap && !m_pMap->empty() ) {
|
317 |
else if ( m_pMap && !m_pMap->empty() ) {
|
| 318 |
if ( !m_sAddon.empty() ) {
|
318 |
if ( !m_sAddon.empty() ) {
|
| 319 |
FileListItr aitr = m_pMap->find(CFileIO(m_sAddon + "/" + toFile).fullFilename().lower().c_str());
|
319 |
FileListItr aitr = m_pMap->find(CFileIO(m_sAddon + "/" + toFile).fullFilename().lower().c_str());
|
| 320 |
if ( aitr == m_pMap->end() ) aitr = m_pMap->find(CFileIO(_convertExtension(m_sAddon + "/" + file)).fullFilename().lower().c_str());
|
320 |
if ( aitr == m_pMap->end() ) aitr = m_pMap->find(CFileIO(_convertExtension(m_sAddon + "/" + file)).fullFilename().lower().c_str());
|
| 321 |
if ( aitr != m_pMap->end() ) return aitr->second;
|
321 |
if ( aitr != m_pMap->end() ) return aitr->second;
|
| 322 |
}
|
322 |
}
|
| 323 |
FileListItr itr = m_pMap->find(CFileIO(file).GetFullFilename().ToLower().c_str());
|
323 |
FileListItr itr = m_pMap->find(CFileIO(file).fullFilename().lower().c_str());
|
| 324 |
if ( itr == m_pMap->end() ) itr = m_pMap->find(CFileIO(_convertExtension(file)).GetFullFilename().ToLower().c_str());
|
324 |
if ( itr == m_pMap->end() ) itr = m_pMap->find(CFileIO(_convertExtension(file)).fullFilename().lower().c_str());
|
| 325 |
if ( itr != m_pMap->end() ) return itr->second;
|
325 |
if ( itr != m_pMap->end() ) return itr->second;
|
| 326 |
}
|
326 |
}
|
| 327 |
return "";
|
327 |
return "";
|
| 328 |
}
|
328 |
}
|
| 329 |
|
329 |
|
| Line 412... |
Line 412... |
| 412 |
{
|
412 |
{
|
| 413 |
Utils::String to = this->ExtractGameFile(sFile, CPackages::tempDirectory() + "tmp.dat");
|
413 |
Utils::String to = this->ExtractGameFile(sFile, CPackages::tempDirectory() + "tmp.dat");
|
| 414 |
if ( !to.empty() ) {
|
414 |
if ( !to.empty() ) {
|
| 415 |
CFileIO File(to);
|
415 |
CFileIO File(to);
|
| 416 |
|
416 |
|
| 417 |
C_File *f = pPackage->AddFile(CFileIO(sTo).GetFilename(), CFileIO(sTo).GetDir(), iFileType);
|
417 |
C_File *f = pPackage->AddFile(CFileIO(sTo).filename(), CFileIO(sTo).dir(), iFileType);
|
| 418 |
if ( f ) {
|
418 |
if ( f ) {
|
| 419 |
if ( f->ReadFromFile(CPackages::GetTempDirectory() + "tmp.dat") ) {
|
419 |
if ( f->ReadFromFile(CPackages::GetTempDirectory() + "tmp.dat") ) {
|
| 420 |
File.remove();
|
420 |
File.remove();
|
| 421 |
return f;
|
421 |
return f;
|
| 422 |
}
|
422 |
}
|