Subversion Repositories spk

Rev

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

Rev 191 Rev 196
Line 144... Line 144...
144
			if ( !package->pFile )
144
			if ( !package->pFile )
145
				continue;
145
				continue;
146
			if ( package->pFile->icon() )
146
			if ( package->pFile->icon() )
147
			{
147
			{
148
				package->pFile->ReadIconFileToMemory();
148
				package->pFile->ReadIconFileToMemory();
149
				Utils::String sIconFile = _S(IO::Path::GetTempPath()) + "\\" + CFileIO(package->sName).baseName() + "." + package->pFile->iconExt();
149
				Utils::WString sIconFile = _WS(IO::Path::GetTempPath()) + L"\\" + CFileIO(package->sName).baseName() + L"." + package->pFile->iconExt().toWString();
150
				if ( package->pFile->extractFile(package->pFile->icon(), CFileIO(sIconFile).fullFilename(), false) )
150
				if ( package->pFile->extractFile(package->pFile->icon(), CFileIO(sIconFile).fullFilename().toString(), false))
151
				{
151
				{
152
					String ^iconFile = _US(sIconFile);
152
					String ^iconFile = _US(sIconFile);
153
					if ( IO::File::Exists(iconFile) )
153
					if ( IO::File::Exists(iconFile) )
154
					{
154
					{
155
						String ^file = _US(package->sName);
155
						String ^file = _US(package->sName);
Line 258... Line 258...
258
			}
258
			}
259
		}
259
		}
260
		else if ( System::IO::File::Exists(filename) )
260
		else if ( System::IO::File::Exists(filename) )
261
		{
261
		{
262
			Utils::String sF = _S(filename);
262
			Utils::String sF = _S(filename);
263
			if ( CFileIO(sF).isFileExtension("bmp") )
263
			if ( CFileIO(sF).isFileExtension(L"bmp") )
264
			{
264
			{
265
				list->Images->Add(key, Bitmap::FromFile(filename));
265
				list->Images->Add(key, Bitmap::FromFile(filename));
266
				added = true;
266
				added = true;
267
			}
267
			}
268
			else
268
			else
Line 544... Line 544...
544
		// remove the dat or cat file as well
544
		// remove the dat or cat file as well
545
		if ( f->GetFileType() == FILETYPE_MOD )
545
		if ( f->GetFileType() == FILETYPE_MOD )
546
		{
546
		{
547
			if ( f->checkFileExt("cat") )
547
			if ( f->checkFileExt("cat") )
548
			{
548
			{
549
				C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension("dat"), FILETYPE_MOD, "", f->GetGame());
549
				C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension(L"dat").toString(), FILETYPE_MOD, "", f->GetGame());
550
				if ( datFile )
550
				if ( datFile )
551
					ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
551
					ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
552
			}
552
			}
553
			else if ( f->checkFileExt("dat") )
553
			else if ( f->checkFileExt("dat") )
554
			{
554
			{
555
				C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension("cat"), FILETYPE_MOD, "", f->GetGame());
555
				C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension(L"cat").toString(), FILETYPE_MOD, "", f->GetGame());
556
				if ( datFile )
556
				if ( datFile )
557
					ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
557
					ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
558
			}
558
			}
559
		}
559
		}
560
		ad->ShowDialog(this);
560
		ad->ShowDialog(this);
Line 578... Line 578...
578
			// remove the dat or cat file as well
578
			// remove the dat or cat file as well
579
			if ( f->GetFileType() == FILETYPE_MOD )
579
			if ( f->GetFileType() == FILETYPE_MOD )
580
			{
580
			{
581
				if ( f->checkFileExt("cat") )
581
				if ( f->checkFileExt("cat") )
582
				{
582
				{
583
					C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension("dat"), FILETYPE_MOD, "", f->GetGame());
583
					C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension(L"dat").toString(), FILETYPE_MOD, "", f->GetGame());
584
					if ( datFile )
584
					if ( datFile )
585
						ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
585
						ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
586
				}
586
				}
587
				else if ( f->checkFileExt("dat") )
587
				else if ( f->checkFileExt("dat") )
588
				{
588
				{
589
					C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension("cat"), FILETYPE_MOD, "", f->GetGame());
589
					C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension(L"cat").toString(), FILETYPE_MOD, "", f->GetGame());
590
					if ( datFile )
590
					if ( datFile )
591
						ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
591
						ad->AddFile(_US(datFile->name()), _US(datFile->dir()), datFile->GetFileType(), datFile->GetGame());
592
				}
592
				}
593
			}
593
			}
594
		}
594
		}
Line 708... Line 708...
708
				for(auto itr = fileList.begin(); itr != fileList.end(); itr++)
708
				for(auto itr = fileList.begin(); itr != fileList.end(); itr++)
709
				{
709
				{
710
					if ((*itr)->data != "-1")
710
					if ((*itr)->data != "-1")
711
						continue;
711
						continue;
712
 
712
 
713
					Utils::String ext = CFileIO((*itr)->str).extension();
713
					Utils::WString ext = CFileIO((*itr)->str).extension();
714
					if ( !ext.Compare("xsp") && !ext.Compare("spk") )
714
					if ( !ext.Compare(L"xsp") && !ext.Compare(L"spk") )
715
						continue;
715
						continue;
716
					
716
					
717
					ad->AddFile(_US((*itr)->str), "", -1, 0);
717
					ad->AddFile(_US((*itr)->str), "", -1, 0);
718
				}
718
				}
719
 
719
 
Line 1003... Line 1003...
1003
				case FILETYPE_MOD:
1003
				case FILETYPE_MOD:
1004
					if ( m_pPackage->extractFile(f, _S(IO::Path::GetTempPath()), false) )
1004
					if ( m_pPackage->extractFile(f, _S(IO::Path::GetTempPath()), false) )
1005
					{
1005
					{
1006
						if ( f->checkFileExt("cat") )
1006
						if ( f->checkFileExt("cat") )
1007
						{
1007
						{
1008
							C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension("dat"), FILETYPE_MOD, "");
1008
							C_File *datFile = m_pPackage->findFile(CFileIO(f).changeFileExtension(L"dat").toString(), FILETYPE_MOD, "");
1009
							if ( datFile )
1009
							if ( datFile )
1010
							{
1010
							{
1011
								if ( m_pPackage->extractFile(datFile, _S(IO::Path::GetTempPath()), false) )
1011
								if ( m_pPackage->extractFile(datFile, _S(IO::Path::GetTempPath()), false) )
1012
									process->StartInfo->FileName = IO::Path::GetTempPath() + "\\" + _US(f->name());
1012
									process->StartInfo->FileName = IO::Path::GetTempPath() + "\\" + _US(f->name());
1013
							}
1013
							}
1014
						}
1014
						}
1015
						else if ( f->checkFileExt("dat") )
1015
						else if ( f->checkFileExt("dat") )
1016
						{
1016
						{
1017
							C_File *catFile = m_pPackage->findFile(CFileIO(f).changeFileExtension("cat"), FILETYPE_MOD, "");
1017
							C_File *catFile = m_pPackage->findFile(CFileIO(f).changeFileExtension(L"cat").toString(), FILETYPE_MOD, "");
1018
							if ( catFile )
1018
							if ( catFile )
1019
							{
1019
							{
1020
								if ( m_pPackage->extractFile(catFile, _S(IO::Path::GetTempPath()), false) )
1020
								if ( m_pPackage->extractFile(catFile, _S(IO::Path::GetTempPath()), false) )
1021
									process->StartInfo->FileName = IO::Path::GetTempPath() + "\\" + _US(catFile->name());
1021
									process->StartInfo->FileName = IO::Path::GetTempPath() + "\\" + _US(catFile->name());
1022
							}
1022
							}