Subversion Repositories spk

Rev

Rev 211 | Rev 274 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 211 Rev 264
Line 447... Line 447...
447
	return this->extractGameFileToPackage(pPackage, sFile, iFileType, sFile);
447
	return this->extractGameFileToPackage(pPackage, sFile, iFileType, sFile);
448
}
448
}
449
 
449
 
450
C_File *CVirtualFileSystem::extractGameFileToPackage(CBaseFile *pPackage, const Utils::WString &sFile, FileType iFileType, const Utils::WString &sTo)
450
C_File *CVirtualFileSystem::extractGameFileToPackage(CBaseFile *pPackage, const Utils::WString &sFile, FileType iFileType, const Utils::WString &sTo)
451
{
451
{
452
	Utils::WString to = this->extractGameFile(sFile, CPackages::tempDirectory() + L"tmp.dat");
452
	Utils::WString to = this->extractGameFile(sFile, CPackages::tempDirectory() + L"/tmp.dat");
453
	if ( !to.empty() ) {
453
	if ( !to.empty() ) {
454
		CFileIO File(to);
454
		CFileIO File(to);
455
 
455
 
456
		C_File *f = pPackage->addFile(CFileIO(sTo).filename(), CFileIO(sTo).dir(), iFileType);
456
		C_File *f = pPackage->addFile(CFileIO(sTo).filename(), CFileIO(sTo).dir(), iFileType);
457
		if ( f ) {
457
		if ( f ) {
458
			if ( f->readFromFile(CPackages::tempDirectory() + L"tmp.dat") ) {
458
			if ( f->readFromFile(CPackages::tempDirectory() + L"/tmp.dat") ) {
459
				File.remove();
459
				File.remove();
460
				return f;
460
				return f;
461
			}
461
			}
462
		}
462
		}
463
 
463
 
Line 486... Line 486...
486
		else {
486
		else {
487
			if ( !str.left(2).Compare(L"t\\") && !str.left(2).Compare(L"t/") && !str.left(8).Compare(L"addon\t\\") && !str.left(8).Compare(L"addon/t/") )
487
			if ( !str.left(2).Compare(L"t\\") && !str.left(2).Compare(L"t/") && !str.left(8).Compare(L"addon\t\\") && !str.left(8).Compare(L"addon/t/") )
488
				continue;
488
				continue;
489
		}
489
		}
490
 
490
 
491
		Utils::WString sTo = this->extractGameFile(str, CPackages::tempDirectory() + L"tmp.dat");
491
		Utils::WString sTo = this->extractGameFile(str, CPackages::tempDirectory() + L"/tmp.dat");
492
		if ( !sTo.empty() ) {
492
		if ( !sTo.empty() ) {
493
			pPackage->addTextFromFile(sTo, textId);
493
			pPackage->addTextFromFile(sTo, textId);
494
			CFileIO::Remove(sTo);
494
			CFileIO::Remove(sTo);
495
		}
495
		}
496
	}
496
	}
Line 545... Line 545...
545
		else {
545
		else {
546
			if ( !str.left(2).Compare(L"t\\") && !str.left(2).Compare(L"t/") )
546
			if ( !str.left(2).Compare(L"t\\") && !str.left(2).Compare(L"t/") )
547
				continue;
547
				continue;
548
		}
548
		}
549
 
549
 
550
		Utils::WString sTo = this->extractGameFile(str, CPackages::tempDirectory() + L"tmp.dat");
550
		Utils::WString sTo = this->extractGameFile(str, CPackages::tempDirectory() + L"/tmp.dat");
551
		if ( !sTo.empty() ) {
551
		if ( !sTo.empty() ) {
552
			// add all texts into the map, id=(pageid, tid) data=text
552
			// add all texts into the map, id=(pageid, tid) data=text
553
			Utils::WString baseFile = CFileIO(str).baseName();
553
			Utils::WString baseFile = CFileIO(str).baseName();
554
			int lang = (baseFile.contains(L"-L")) ? baseFile.right(3) : baseFile.truncate(-4);
554
			int lang = (baseFile.contains(L"-L")) ? baseFile.right(3) : baseFile.truncate(-4);
555
 
555