Subversion Repositories spk

Rev

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

Rev 196 Rev 197
Line 129... Line 129...
129
 
129
 
130
		String ^FindText(int game, int page, int id)
130
		String ^FindText(int game, int page, int id)
131
		{
131
		{
132
			this->LoadText(false, false, NULL);
132
			this->LoadText(false, false, NULL);
133
 
133
 
134
			Utils::String text = _pGameDir->findText(game, 44, page, id);
134
			Utils::WString text = _pGameDir->findText(game, 44, page, id);
135
			if ( !text.empty() ) {
135
			if ( !text.empty() ) {
136
				return ParseText(game, _US(text));
136
				return ParseText(game, _US(text));
137
			}
137
			}
138
 
138
 
139
			return nullptr;
139
			return nullptr;
Line 226... Line 226...
226
 
226
 
227
	protected: 
227
	protected: 
228
		bool			 m_bAutoClose;
228
		bool			 m_bAutoClose;
229
		int				 m_iLocX;
229
		int				 m_iLocX;
230
		int				 m_iLocY;
230
		int				 m_iLocY;
231
		CyStringList	*m_pLoadedList;
231
		Utils::WStringList	*m_pLoadedList;
232
		CPackages *m_pPackages;
232
		CPackages *m_pPackages;
233
		SPK::CGameDirectories	*_pGameDir;
233
		SPK::CGameDirectories	*_pGameDir;
234
 
234
 
235
		SSettings		*m_settings;
235
		SSettings		*m_settings;
236
		String			^m_sConvertFile;
236
		String			^m_sConvertFile;
Line 450... Line 450...
450
			}			
450
			}			
451
		}
451
		}
452
 
452
 
453
		void ExportPackage(String ^file)
453
		void ExportPackage(String ^file)
454
		{
454
		{
455
			Utils::String sFile = _S(file);
455
			Utils::WString sFile = _WS(file);
456
			int error = 0;
456
			int error = 0;
457
 
457
 
458
			CBaseFile *p = m_pPackages->openPackage(sFile, &error, 0, SPKREAD_NODATA);
458
			CBaseFile *p = m_pPackages->openPackage(sFile.toString(), &error, 0, SPKREAD_NODATA);
459
			if ( !p ) {
459
			if ( !p ) {
460
				MessageBox::Show(this, "Error: Unable to open package file\n" + file, "Error Opening", MessageBoxButtons::OK, MessageBoxIcon::Error);
460
				MessageBox::Show(this, "Error: Unable to open package file\n" + file, "Error Opening", MessageBoxButtons::OK, MessageBoxIcon::Error);
461
			}
461
			}
462
			else {
462
			else {
463
				String ^to = IO::FileInfo(file).DirectoryName;
463
				String ^to = IO::FileInfo(file).DirectoryName;
Line 475... Line 475...
475
				}
475
				}
476
 
476
 
477
				if ( to && to->Length ) {
477
				if ( to && to->Length ) {
478
					Utils::WString exportFilename = CFileIO(sFile).changeFileExtension(L"zip");
478
					Utils::WString exportFilename = CFileIO(sFile).changeFileExtension(L"zip");
479
					if ( game ) {
479
					if ( game ) {
480
						exportFilename = CFileIO(exportFilename).dir() + L"/" + CFileIO(exportFilename).baseName() + L"_" + CBaseFile::ConvertGameToString(game).toWString() + L".zip";
480
						exportFilename = CFileIO(exportFilename).dir() + L"/" + CFileIO(exportFilename).baseName() + L"_" + CBaseFile::ConvertGameToString(game) + L".zip";
481
					}
481
					}
482
					if ( p->saveToArchive(exportFilename.toString(), game, m_pPackages->GetGameExe())) {
482
					if ( p->saveToArchive(exportFilename.toString(), game, m_pPackages->GetGameExe())) {
483
						String ^message = "Export: " + file + "\nTo: " + _US(CFileIO(exportFilename).filename());
483
						String ^message = "Export: " + file + "\nTo: " + _US(CFileIO(exportFilename).filename());
484
						if ( game ) {
484
						if ( game ) {
485
							message += "\nGame: " + _US(m_pPackages->GetGameExe()->GetGame(game - 1)->sName);
485
							message += "\nGame: " + _US(m_pPackages->GetGameExe()->game(game - 1)->sName);
486
						}
486
						}
487
						MessageBox::Show(this, message, "Exported Package", MessageBoxButtons::OK, MessageBoxIcon::Information);
487
						MessageBox::Show(this, message, "Exported Package", MessageBoxButtons::OK, MessageBoxIcon::Information);
488
					}
488
					}
489
					else {
489
					else {
490
						MessageBox::Show(this, "Error: Unable to export to:\n" + _US(exportFilename), "Error Export", MessageBoxButtons::OK, MessageBoxIcon::Error);					}
490
						MessageBox::Show(this, "Error: Unable to export to:\n" + _US(exportFilename), "Error Export", MessageBoxButtons::OK, MessageBoxIcon::Error);					}
Line 492... Line 492...
492
			}
492
			}
493
		}
493
		}
494
 
494
 
495
		void ExtractPackage(String ^file, bool here)
495
		void ExtractPackage(String ^file, bool here)
496
		{
496
		{
497
			Utils::String sFile = _S(file);
497
			Utils::WString sFile = _WS(file);
498
			int error = 0;
498
			int error = 0;
499
 
499
 
500
			CBaseFile *p = m_pPackages->openPackage(sFile, &error, 0, SPKREAD_NODATA);
500
			CBaseFile *p = m_pPackages->openPackage(sFile.toString(), &error, 0, SPKREAD_NODATA);
501
			if ( !p ) {
501
			if ( !p ) {
502
				MessageBox::Show(this, "Error: Unable to open package file\n" + file, "Error Opening", MessageBoxButtons::OK, MessageBoxIcon::Error);
502
				MessageBox::Show(this, "Error: Unable to open package file\n" + file, "Error Opening", MessageBoxButtons::OK, MessageBoxIcon::Error);
503
			}
503
			}
504
			else {
504
			else {
505
				String ^to = nullptr;
505
				String ^to = nullptr;
506
				if ( here ) {
506
				if ( here ) {
507
					to = IO::FileInfo(file).DirectoryName;
507
					to = IO::FileInfo(file).DirectoryName;
508
				}
508
				}
Line 532... Line 532...
532
					{
532
					{
533
						if (m_pPackages->extractAll(p, _S(to), game, true)) 
533
						if (m_pPackages->extractAll(p, _S(to), game, true)) 
534
						{
534
						{
535
							String ^message = "Extracted: " + file + "\nTo: " + to;
535
							String ^message = "Extracted: " + file + "\nTo: " + to;
536
							if ( game )
536
							if ( game )
537
								message += "\nGame: " + _US(m_pPackages->GetGameExe()->GetGame(game - 1)->sName);
537
								message += "\nGame: " + _US(m_pPackages->GetGameExe()->game(game - 1)->sName);
538
							MessageBox::Show(this, message, "Extracted Package", MessageBoxButtons::OK, MessageBoxIcon::Information);
538
							MessageBox::Show(this, message, "Extracted Package", MessageBoxButtons::OK, MessageBoxIcon::Information);
539
						}
539
						}
540
						else 
540
						else 
541
							MessageBox::Show(this, "Error: Unable to extract to:\n" + to, "Error Extracting", MessageBoxButtons::OK, MessageBoxIcon::Error);
541
							MessageBox::Show(this, "Error: Unable to extract to:\n" + to, "Error Extracting", MessageBoxButtons::OK, MessageBoxIcon::Error);
542
					}
542
					}
Line 545... Line 545...
545
		}
545
		}
546
 
546
 
547
		void SavePackagerScript(String ^file)
547
		void SavePackagerScript(String ^file)
548
		{
548
		{
549
			Utils::WString sFile = _WS(file);
549
			Utils::WString sFile = _WS(file);
550
			Utils::CStringList malformed, unknown;
550
			Utils::WStringList malformed, unknown;
551
			CBaseFile *package = m_pPackages->LoadPackagerScript(sFile.toString(), -1, NULL, &malformed, &unknown);
551
			CBaseFile *package = m_pPackages->loadPackagerScript(sFile.toString(), -1, NULL, &malformed, &unknown);
552
			if ( package )
552
			if ( package )
553
			{
553
			{
554
				Utils::WString saveto = package->filename();
554
				Utils::WString saveto = package->filename();
555
				saveto = saveto.findReplace(L"$DEFAULTDIR", CFileIO(sFile).dir() + L"/");
555
				saveto = saveto.findReplace(L"$DEFAULTDIR", CFileIO(sFile).dir() + L"/");
556
				saveto = saveto.findReplace(L"$PATH", CFileIO(sFile).dir());
556
				saveto = saveto.findReplace(L"$PATH", CFileIO(sFile).dir());
Line 571... Line 571...
571
						exportto = exportto.findReplace(L"$PATH", CFileIO(sFile).dir());
571
						exportto = exportto.findReplace(L"$PATH", CFileIO(sFile).dir());
572
						exportto = exportto.asFilename();
572
						exportto = exportto.asFilename();
573
						if ( package->saveToArchive(exportto.toString(), 0, m_pPackages->GetGameExe())) {
573
						if ( package->saveToArchive(exportto.toString(), 0, m_pPackages->GetGameExe())) {
574
							message += "\nExported to:\n" + _US(exportto) + "\n";
574
							message += "\nExported to:\n" + _US(exportto) + "\n";
575
							if ( package->IsAnyGameInPackage() ) {
575
							if ( package->IsAnyGameInPackage() ) {
576
								for ( int i = 0; i < m_pPackages->GetGameExe()->GetNumGames(); i++ ) {
576
								for ( int i = 0; i < m_pPackages->GetGameExe()->numGames(); i++ ) {
577
									if ( package->IsGameInPackage(i + 1) ) {
577
									if ( package->IsGameInPackage(i + 1) ) {
578
										Utils::WString exportFile = CFileIO(saveto).dir() + L"/" + CFileIO(saveto).baseName() + L"_" + CBaseFile::ConvertGameToString(i + 1).toWString() + L"." + CFileIO(exportto).extension();
578
										Utils::WString exportFile = CFileIO(saveto).dir() + L"/" + CFileIO(saveto).baseName() + L"_" + CBaseFile::ConvertGameToString(i + 1) + L"." + CFileIO(exportto).extension();
579
										if ( package->saveToArchive(exportFile.toString(), i + 1, m_pPackages->GetGameExe())) {
579
										if ( package->saveToArchive(exportFile.toString(), i + 1, m_pPackages->GetGameExe())) {
580
											message += _US(CFileIO(exportFile).filename()) + "\n";
580
											message += _US(CFileIO(exportFile).filename()) + "\n";
581
										}
581
										}
582
									}
582
									}
583
								}
583
								}
Line 591... Line 591...
591
			}
591
			}
592
		}
592
		}
593
 
593
 
594
		void OpenPackagerScript(String ^file)
594
		void OpenPackagerScript(String ^file)
595
		{
595
		{
596
			Utils::CStringList malformed, unknown;
596
			Utils::WStringList malformed, unknown;
597
			CBaseFile *package = m_pPackages->LoadPackagerScript(_S(file), SPKCOMPRESS_NONE, NULL, &malformed, &unknown);
597
			CBaseFile *package = m_pPackages->loadPackagerScript(_S(file), SPKCOMPRESS_NONE, NULL, &malformed, &unknown);
598
			if ( package )
598
			if ( package )
599
			{
599
			{
600
				package->SetDataCompression(SPKCOMPRESS_7ZIP);
600
				package->SetDataCompression(SPKCOMPRESS_7ZIP);
601
				PackageForm ^childForm = this->OpenPackage(true, package, file, "");
601
				PackageForm ^childForm = this->OpenPackage(true, package, file, "");
602
				childForm->Text = _US(package->filename());
602
				childForm->Text = _US(package->filename());
Line 638... Line 638...
638
			childForm->WindowState = Windows::Forms::FormWindowState::Maximized;
638
			childForm->WindowState = Windows::Forms::FormWindowState::Maximized;
639
			return childForm;
639
			return childForm;
640
		}
640
		}
641
		PackageForm ^OpenPackage(bool display, CBaseFile *package, String ^file, String ^title)
641
		PackageForm ^OpenPackage(bool display, CBaseFile *package, String ^file, String ^title)
642
		{
642
		{
643
			Utils::String sFile = _S(file);
643
			Utils::WString sFile = _WS(file);
644
 
644
 
645
			if ( this->imageList1->Images->IndexOfKey(file) == -1 )
645
			if ( this->imageList1->Images->IndexOfKey(file) == -1 )
646
			{
646
			{
647
				if ( package->icon() )
647
				if ( package->icon() )
648
				{
648
				{
649
					package->ReadIconFileToMemory();
649
					package->ReadIconFileToMemory();
650
					Utils::WString sIconFile = _WS(IO::Path::GetTempPath()) + L"\\" + CFileIO(sFile).baseName() + L"." + package->iconExt().toWString();
650
					Utils::WString sIconFile = _WS(IO::Path::GetTempPath()) + L"\\" + CFileIO(sFile).baseName() + L"." + package->iconExt();
651
					if ( package->extractFile(package->icon(), CFileIO(sIconFile).fullFilename().toString(), false))
651
					if ( package->extractFile(package->icon(), CFileIO(sIconFile).fullFilename().toString(), false))
652
					{
652
					{
653
						String ^iconFile = _US(sIconFile);
653
						String ^iconFile = _US(sIconFile);
654
						if ( IO::File::Exists(iconFile) )
654
						if ( IO::File::Exists(iconFile) )
655
						{
655
						{
Line 716... Line 716...
716
					else
716
					else
717
						break;
717
						break;
718
 
718
 
719
					for ( int i = 0; i < Files->Length; i++ )
719
					for ( int i = 0; i < Files->Length; i++ )
720
					{
720
					{
721
						Utils::String file = _S(Files[i]);
721
						Utils::WString file = _WS(Files[i]);
722
						int error = 0;
722
						int error = 0;
723
						CBaseFile *p = m_pPackages->openPackage(file, &error, 0, SPKREAD_NODATA);
723
						CBaseFile *p = m_pPackages->openPackage(file.toString(), &error, 0, SPKREAD_NODATA);
724
						if ( !p )
724
						if ( !p )
725
							continue;
725
							continue;
726
 
726
 
727
						Utils::WString ufile = p->createUpdateFile(_WS(fbd->SelectedPath));
727
						Utils::WString ufile = p->createUpdateFile(_WS(fbd->SelectedPath));
728
						if ( !ufile.empty() )
728
						if ( !ufile.empty() )
Line 742... Line 742...
742
		{
742
		{
743
			FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
743
			FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
744
			fbd->Description = "Select the path to generate the list from";
744
			fbd->Description = "Select the path to generate the list from";
745
			if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
745
			if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
746
			{
746
			{
747
				Utils::CStringList filedata;
747
				Utils::WStringList filedata;
748
				for ( int type = 0; type < 2; type++ )
748
				for ( int type = 0; type < 2; type++ )
749
				{
749
				{
750
					array <System::String ^> ^Files = nullptr;
750
					array <System::String ^> ^Files = nullptr;
751
					if ( type == 0 )
751
					if ( type == 0 )
752
						Files = Directory::GetFiles(fbd->SelectedPath, "*.spk");
752
						Files = Directory::GetFiles(fbd->SelectedPath, "*.spk");
Line 755... Line 755...
755
					else
755
					else
756
						break;
756
						break;
757
 
757
 
758
					for ( int i = 0; i < Files->Length; i++ )
758
					for ( int i = 0; i < Files->Length; i++ )
759
					{
759
					{
760
						Utils::String file = _S(Files[i]);
760
						Utils::WString file = _WS(Files[i]);
761
						int error = 0;
761
						int error = 0;
762
						CBaseFile *p = m_pPackages->openPackage(file, &error, 0, SPKREAD_NODATA);
762
						CBaseFile *p = m_pPackages->openPackage(file, &error, 0, SPKREAD_NODATA);
763
						if ( !p )
763
						if ( !p )
764
							continue;
764
							continue;
765
 
765
 
Line 770... Line 770...
770
 
770
 
771
				if ( filedata.empty() )
771
				if ( filedata.empty() )
772
					MessageBox::Show(this, "No package files found in " + fbd->SelectedPath + "\nSelect a directory that contains spk/xsp files", "No Packages", MessageBoxButtons::OK, MessageBoxIcon::Error);
772
					MessageBox::Show(this, "No package files found in " + fbd->SelectedPath + "\nSelect a directory that contains spk/xsp files", "No Packages", MessageBoxButtons::OK, MessageBoxIcon::Error);
773
				else
773
				else
774
				{
774
				{
775
					CFileIO File(_S(fbd->SelectedPath) + "/xpackagedata.dat");
775
					CFileIO File(_WS(fbd->SelectedPath) + L"/xpackagedata.dat");
776
					if ( File.writeFile(&filedata) )
776
					if ( File.writeFile(&filedata) )
777
						MessageBox::Show(this, "Data file generated for " + filedata.size() + " packages\nDirectory: " + fbd->SelectedPath, "Web File Generated", MessageBoxButtons::OK, MessageBoxIcon::Information);
777
						MessageBox::Show(this, "Data file generated for " + filedata.size() + " packages\nDirectory: " + fbd->SelectedPath, "Web File Generated", MessageBoxButtons::OK, MessageBoxIcon::Information);
778
					else
778
					else
779
						MessageBox::Show(this, "Unable to write web data file in " + fbd->SelectedPath, "File Write Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
779
						MessageBox::Show(this, "Unable to write web data file in " + fbd->SelectedPath, "File Write Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
780
				}
780
				}
Line 811... Line 811...
811
				OpenPackagerScript(file);
811
				OpenPackagerScript(file);
812
				return;
812
				return;
813
			}
813
			}
814
 
814
 
815
			float fVersion;
815
			float fVersion;
816
			Utils::String sFile = _S(file);
816
			Utils::WString sFile = _WS(file);
817
			int fileType = CSpkFile::CheckFile(sFile, &fVersion);
817
			int fileType = CSpkFile::CheckFile(sFile, &fVersion);
818
 
818
 
819
			if ( fVersion > (float)FILEVERSION )
819
			if ( fVersion > (float)FILEVERSION )
820
			{
820
			{
821
				if ( display )
821
				if ( display )
Line 862... Line 862...
862
			bool loaded = false;
862
			bool loaded = false;
863
 
863
 
864
			int error;
864
			int error;
865
			if ( fileType == SPKFILE_MULTI )
865
			if ( fileType == SPKFILE_MULTI )
866
			{
866
			{
867
				CMultiSpkFile *mspk = m_pPackages->openMultiPackage(sFile, &error);
867
				CMultiSpkFile *mspk = m_pPackages->openMultiPackage(sFile.toString(), &error);
868
				if ( mspk )
868
				if ( mspk )
869
				{
869
				{
870
					loaded = true;
870
					loaded = true;
871
					BaseForm ^childForm = this->OpenPackage(display, mspk, file, "");
871
					BaseForm ^childForm = this->OpenPackage(display, mspk, file, "");
872
					childForm->Text = file;
872
					childForm->Text = file;
873
				}
873
				}
874
			}
874
			}
875
			else
875
			else
876
			{
876
			{
877
				CBaseFile *package = (convertFile) ? convertFile : m_pPackages->openPackage(sFile, &error);
877
				CBaseFile *package = (convertFile) ? convertFile : m_pPackages->openPackage(sFile.toString(), &error);
878
				if ( package )
878
				if ( package )
879
				{
879
				{
880
					loaded = true;
880
					loaded = true;
881
					PackageForm ^childForm = this->OpenPackage(display, package, file, "");
881
					PackageForm ^childForm = this->OpenPackage(display, package, file, "");
882
					if ( convertFile )
882
					if ( convertFile )
Line 888... Line 888...
888
			}
888
			}
889
 
889
 
890
			if ( loaded )
890
			if ( loaded )
891
			{
891
			{
892
				// adjust the loaded list
892
				// adjust the loaded list
893
				sFile = sFile.findReplace("/", "\\").remove(9).remove('\r').remove('\n');
893
				sFile = sFile.findReplace(L"/", L"\\").remove(9).remove('\r').remove('\n');
894
				m_pLoadedList->Remove(sFile, true);
894
				m_pLoadedList->remove(sFile, true);
895
				m_pLoadedList->PushFront(CyString(sFile));
895
				m_pLoadedList->pushFront(sFile);
896
 
896
 
897
				while ( m_pLoadedList->Count() > 15 )
897
				while ( m_pLoadedList->size() > 15 )
898
					m_pLoadedList->PopBack();
898
					m_pLoadedList->popBack();
899
 
899
 
900
				this->SaveData();
900
				this->SaveData();
901
 
901
 
902
				this->UpdateDropDownOpen();
902
				this->UpdateDropDownOpen();
903
			}	
903
			}	
Line 1008... Line 1008...
1008
			newItem->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1008
			newItem->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1009
			this->toolStripSplitButton1->DropDownItems->Add(newItem);
1009
			this->toolStripSplitButton1->DropDownItems->Add(newItem);
1010
 
1010
 
1011
			// add all none open items
1011
			// add all none open items
1012
			bool sep = false;
1012
			bool sep = false;
1013
			for ( SStringList *str = m_pLoadedList->Head(); str; str = str->next )
1013
			for ( auto itr = m_pLoadedList->begin(); itr != m_pLoadedList->end(); itr++ )
1014
			{
1014
			{
1015
				// check if we have it open
1015
				// check if we have it open
-
 
1016
				Utils::WString str = (*itr)->str;
1016
				System::String ^sFile = _US(str-&gt;str.findreplace("/", "\\").ToString());
1017
				System::String ^sFile = _US(str.findReplace(L"/&quot;, L"\\"));
1017
				if ( this->IsOpen(sFile) )
1018
				if ( this->IsOpen(sFile) )
1018
					continue;
1019
					continue;
1019
				if ( this->IsOpen(_US(str-&gt;str.findreplace("\\", "/").ToString())) )
1020
				if ( this->IsOpen(_US(str.findReplace(L"\\&quot;, L"/"))) )
1020
					continue;
1021
					continue;
1021
 
1022
 
1022
				if ( !IO::File::Exists(sFile) )
1023
				if ( !IO::File::Exists(sFile) )
1023
					continue;
1024
					continue;
1024
 
1025
 
Line 1030... Line 1031...
1030
				}
1031
				}
1031
 
1032
 
1032
				// work out the type
1033
				// work out the type
1033
				float fVersion;
1034
				float fVersion;
1034
				int iconType = -1;
1035
				int iconType = -1;
1035
				int check = CBaseFile::CheckFile(str->str.ToString(), &fVersion);
1036
				int check = CBaseFile::CheckFile(str, &fVersion);
1036
				switch ( check )
1037
				switch ( check )
1037
				{
1038
				{
1038
					case SPKFILE_BASE:
1039
					case SPKFILE_BASE:
1039
						iconType = 5;
1040
						iconType = 5;
1040
						break;
1041
						break;
Line 1136... Line 1137...
1136
 
1137
 
1137
		void SaveData()
1138
		void SaveData()
1138
		{
1139
		{
1139
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
1140
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
1140
			CFileIO Config(_S(mydoc) + "/Egosoft/creator.dat");
1141
			CFileIO Config(_S(mydoc) + "/Egosoft/creator.dat");
1141
			Utils::CStringList lines;
1142
			Utils::WStringList lines;
1142
 
1143
 
1143
			if ( this->WindowState == FormWindowState::Normal )
1144
			if ( this->WindowState == FormWindowState::Normal )
1144
			{
1145
			{
1145
				lines.pushBack(Utils::String("CreatorSize:") + (long)this->Size.Width + &quot; &quot; + (long)this->Size.Height);
1146
				lines.pushBack(Utils::WString(L"CreatorSize:") + Utils::WString::Number(this->Size.Width) + L&quot; &quot; + Utils::WString::Number(this->Size.Height));
1146
				lines.pushBack(Utils::String("CreatorPos:") + (long)this->Location.X + &quot; &quot; + (long)this->Location.Y);
1147
				lines.pushBack(Utils::WString(L"CreatorPos:") + Utils::WString::Number(this->Location.X) + L&quot; &quot; + Utils::WString::Number(this->Location.Y));
1147
			}
1148
			}
1148
			else
1149
			else
1149
			{
1150
			{
1150
				lines.pushBack(Utils::String("CreatorPos:") + (long)this->RestoreBounds.Location.X + &quot; &quot; + (long)this->RestoreBounds.Location.Y);
1151
				lines.pushBack(Utils::WString(L"CreatorPos:") + Utils::WString::Number(this->RestoreBounds.Location.X) + L&quot; &quot; + Utils::WString::Number(this->RestoreBounds.Location.Y));
1151
				lines.pushBack(Utils::String("CreatorSize:") + (long)this->RestoreBounds.Size.Width + &quot; &quot; + (long)this->RestoreBounds.Size.Height);
1152
				lines.pushBack(Utils::WString(L"CreatorSize:") + Utils::WString::Number(this->RestoreBounds.Size.Width) + L&quot; &quot; + Utils::WString::Number(this->RestoreBounds.Size.Height));
1152
			}
1153
			}
1153
 
1154
 
1154
			if ( this->WindowState == FormWindowState::Maximized )
1155
			if ( this->WindowState == FormWindowState::Maximized )
1155
				lines.pushBack("CreatorMax:");
1156
				lines.pushBack(L"CreatorMax:");
1156
 
1157
 
1157
			for ( SStringList *str = m_pLoadedList->Head(); str; str = str->next )
1158
			for (auto itr = m_pLoadedList->begin(); itr != m_pLoadedList->end(); itr++)
1158
				lines.pushBack(Utils::String("Loaded:") + str-&gt;data.ToString() + " " + str->str.ToString());
1159
				lines.pushBack(Utils::WString(L"Loaded:") + (*itr)-&gt;data + L" " + (*itr)->str);
1159
			_pGameDir->writeData(&lines);
1160
			_pGameDir->writeData(&lines);
1160
			if ( m_settings->bGenerateUpdate )
1161
			if ( m_settings->bGenerateUpdate )
1161
				lines.pushBack("GenerateUpdate:");
1162
				lines.pushBack(L"GenerateUpdate:");
1162
 
1163
 
1163
			Config.writeFile(&lines);
1164
			Config.writeFile(&lines);
1164
		}
1165
		}
1165
 
1166
 
1166
		void LoadData()
1167
		void LoadData()
Line 1183... Line 1184...
1183
						{
1184
						{
1184
							m_iLocX = rest.token(" ", 1).toInt();
1185
							m_iLocX = rest.token(" ", 1).toInt();
1185
							m_iLocY = rest.token(" ", 2).toInt();
1186
							m_iLocY = rest.token(" ", 2).toInt();
1186
						}
1187
						}
1187
						else if ( start.Compare("Loaded") )
1188
						else if ( start.Compare("Loaded") )
1188
							m_pLoadedList->PushBack(CyString(rest));
1189
							m_pLoadedList->pushBack(rest);
1189
						else if ( start.Compare("CreatorMax") )
1190
						else if ( start.Compare("CreatorMax") )
1190
							this->WindowState = FormWindowState::Maximized;
1191
							this->WindowState = FormWindowState::Maximized;
1191
						else if ( start.Compare("GenerateUpdate") )
1192
						else if ( start.Compare("GenerateUpdate") )
1192
							m_settings->bGenerateUpdate = true;
1193
							m_settings->bGenerateUpdate = true;
1193
						else if ( start.Compare("GameDir") )
1194
						else if ( start.Compare("GameDir") )