Subversion Repositories spk

Rev

Rev 227 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
#include "PackageForm.h"
4
#include "MultiForm.h"
5
#include "Options.h"
6
#include "LoadShip.h"
7
#include "ImportShip.h"
8
#include "CreationWizard.h"
9
#include "LoadText.h"
2 cycrow 10
//TODO: remove this dependacy
11
#include "../../ModMerge/src/Forms/Form1.h"
1 cycrow 12
#include "ModDiff.h"
13
#include "Waiting.h"
14
#include "FileExplorer.h"
15
#include "SelectGame.h"
36 cycrow 16
#include "SelectFilesystem.h"
17
#include <VirtualFileSystem.h>
1 cycrow 18
 
36 cycrow 19
 
1 cycrow 20
using namespace System;
21
using namespace System::IO;
22
 
23
namespace Creator {
24
 
25
	enum {SWITCH_NONE, SWITCH_CREATE, SWITCH_EXTRACT, SWITCH_EXTRACTHERE, SWITCH_EXPORT};
26
 
27
	using namespace System;
28
	using namespace System::ComponentModel;
29
	using namespace System::Collections;
30
	using namespace System::Windows::Forms;
31
	using namespace System::Data;
32
	using namespace System::Drawing;
33
 
34
	/// <summary>
35
	/// Summary for Form1
36
	///
37
	/// WARNING: If you change the name of this class, you will need to change the
38
	///          'Resource File Name' property for the managed resource compiler tool
39
	///          associated with all .resx files this class depends on.  Otherwise,
40
	///          the designers will not be able to interact properly with localized
41
	///          resources associated with this form.
42
	/// </summary>
43
	public ref class Form1 : public System::Windows::Forms::Form
44
	{
45
	public:
109 cycrow 46
		static bool CheckCommandArguments(array<System::String ^> ^args);
47
 
48
	public:
36 cycrow 49
		Form1(array<System::String ^> ^args);
110 cycrow 50
		!Form1();
1 cycrow 51
 
36 cycrow 52
		void parseCommandArguments(array<System::String ^> ^args);
1 cycrow 53
 
54
		void ModMerge()
55
		{
56
			ModMerge::Form1 ^merge = gcnew ModMerge::Form1();
57
			merge->StartPosition = Windows::Forms::FormStartPosition::CenterParent;
58
			merge->TopMost = true;
94 cycrow 59
			if ( !_pGameDir->isEmpty() ) 
60
				merge->SetGameDir(-1, _US(_pGameDir->first()));
1 cycrow 61
			merge->ShowDialog(this);
62
		}
63
 
64
		void ModDiffDialog()
65
		{
94 cycrow 66
			ModDiff ^diff = gcnew ModDiff(_pGameDir, m_pPackages);
1 cycrow 67
			diff->ShowDialog(this);
68
		}
69
 
70
		void OpenArchive()
71
		{
72
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
73
			ofd->Filter = "All Supported Archives|*.zip; *.rar|Zip Archive (*.zip)|*.zip|Rar Archive (*.rar)|*.rar";
74
			ofd->Title = "Select archive file you wish to import from";
75
			ofd->FilterIndex = 1;
76
			ofd->RestoreDirectory = true;
77
			ofd->Multiselect = false;
78
 
79
			if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
80
			{
81
				m_sConvertFile = ofd->FileName;
82
				m_pWait = gcnew Waiting("Converting Archive");
83
				this->backgroundWorker1->RunWorkerAsync();
84
				m_pWait->ShowDialog(this);
85
			}
86
		}
87
 
88
		String ^ParseText(int game, String ^text)
89
		{
90
			String ^t = text;
91
 
92
			bool found = true;
93
			int pos = 0;
94
			while (found)
95
			{
295 cycrow 96
				pos = t->IndexOf(L'{', pos);
1 cycrow 97
				found = false;
98
				if ( pos > -1 )
99
				{
100
					int page = -1;
101
					int id = -1;
102
 
295 cycrow 103
					int commaPos = t->IndexOf(L',', pos);
1 cycrow 104
					if ( commaPos > -1 )
105
					{
106
						page = Convert::ToInt32(t->Substring(pos + 1, commaPos - (pos + 1)));
295 cycrow 107
						int endPos = t->IndexOf(L'}', commaPos);
1 cycrow 108
						if ( endPos > -1 )
109
						{
110
							id = Convert::ToInt32(t->Substring(commaPos + 1, endPos - (commaPos + 1)));
111
							found = true;
112
							t = t->Replace(t->Substring(pos, endPos - pos + 1 ), this->FindText(game, page, id));
113
						}
114
					}
115
				}
116
			}
117
			return t;
118
		}
119
 
94 cycrow 120
		CGameDirectories *gameDirectories()
36 cycrow 121
		{
94 cycrow 122
			return _pGameDir;
123
		}
36 cycrow 124
 
101 cycrow 125
		void LoadText(CVirtualFileSystem *vfs)
94 cycrow 126
		{
101 cycrow 127
			this->LoadText(false, false, vfs);
36 cycrow 128
		}
129
 
1 cycrow 130
		String ^FindText(int game, int page, int id)
131
		{
101 cycrow 132
			this->LoadText(false, false, NULL);
36 cycrow 133
 
197 cycrow 134
			Utils::WString text = _pGameDir->findText(game, 44, page, id);
94 cycrow 135
			if ( !text.empty() ) {
136
				return ParseText(game, _US(text));
1 cycrow 137
			}
138
 
94 cycrow 139
			return nullptr;
1 cycrow 140
		}
141
 
142
		void UpdateStatus()
143
		{
144
			bool e = (this->tabControl1->HasChildren) ? true : false;
145
 
146
			BaseForm ^active = this->GetActiveChild();
147
			if ( active && active->GetFormType() == FORMTYPE_SINGLE )
148
			{
149
				CBaseFile *activePackage = ((PackageForm ^)active)->GetPackage();
150
				if ( !activePackage )
151
					e = false;
152
				else
170 cycrow 153
					this->StatusFiles->Text = "Files: " + activePackage->fileList().size() + " (" + _US(activePackage->fileSizeString()) + ")";
1 cycrow 154
			}
155
			else if ( active && active->GetFormType() == FORMTYPE_MULTI )
156
			{
157
				CMultiSpkFile *activePackage = ((MultiForm ^)active)->GetPackage();
158
				if ( !activePackage )
159
					e = false;
160
				else
170 cycrow 161
					this->StatusFiles->Text = "Files: " + activePackage->GetAvailableFiles() + " (" + _US(SPK::GetSizeString(activePackage->GetFileSize())) + ")";
1 cycrow 162
			}
163
			else
164
				e = false;
165
 
166
			if ( !e  )
167
				this->StatusFiles->Text = "";
168
		}
169
 
170
		void UpdateDisplay()
171
		{
172
			bool e = (this->tabControl1->HasChildren) ? true : false;
173
 
174
			BaseForm ^active = this->GetActiveChild();
175
			if ( !active )
176
				e = false;
177
			else if ( active->GetFormType() != FORMTYPE_SINGLE && active->GetFormType() != FORMTYPE_MULTI)
178
				e = false;
179
 
180
			this->saveAsToolStripMenuItem->Enabled = e;
181
			this->saveToolStripMenuItem->Enabled = e;
182
			this->tabControl1->Visible = e;
183
 
184
			if ( !this->PanelTab->Visible && e )
185
			{
186
				this->PanelTab->Visible = e;
187
				this->toolStrip1->SendToBack();
188
				this->menuStrip1->SendToBack();
189
			}
190
			else if ( !e )
191
				this->PanelTab->Visible = e;
192
 
193
			this->UpdateStatus();
194
			this->UpdateDropDownOpen();
195
		}
196
 
197
		void OpenFileExplorer()
198
		{
199
			FileExplorer ^file = gcnew FileExplorer(this, m_pPackages);
200
			file->Show(this);
201
		}
202
 
203
		void OpenFile(String ^filename)
204
		{
205
			ArrayList ^a = gcnew ArrayList();
206
			a->Add(filename);
207
 
208
			this->OpenFiles(a, false, true);
209
		}
210
 
211
	protected:
212
		/// <summary>
213
		/// Clean up any resources being used.
214
		/// </summary>
215
		~Form1()
216
		{
217
			if (components)
218
			{
219
				delete components;
220
			}
110 cycrow 221
				delete m_settings;
222
				delete m_pPackages;
223
				delete m_pLoadedList;
224
				delete _pGameDir;
1 cycrow 225
		}
226
 
227
	protected: 
228
		bool			 m_bAutoClose;
229
		int				 m_iLocX;
230
		int				 m_iLocY;
197 cycrow 231
		Utils::WStringList	*m_pLoadedList;
1 cycrow 232
		CPackages *m_pPackages;
94 cycrow 233
		SPK::CGameDirectories	*_pGameDir;
234
 
1 cycrow 235
		SSettings		*m_settings;
236
		String			^m_sConvertFile;
237
		Waiting			^m_pWait;
238
		CBaseFile		*m_pConverted;
239
 
36 cycrow 240
		//System::Collections::Hashtable ^textList;
1 cycrow 241
 
242
	private: System::Windows::Forms::MenuStrip^  menuStrip1;
243
	private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem;
244
	private: System::Windows::Forms::ToolStripMenuItem^  newToolStripMenuItem;
245
	private: System::Windows::Forms::ToolStripMenuItem^  packageToolStripMenuItem;
246
	private: System::Windows::Forms::ToolStripMenuItem^  shipToolStripMenuItem;
247
	private: System::Windows::Forms::ToolStripMenuItem^  windowsToolStripMenuItem;
248
	private: System::Windows::Forms::ToolStripMenuItem^  layoutToolStripMenuItem;
249
	private: System::Windows::Forms::ToolStripMenuItem^  cascadeToolStripMenuItem;
250
	private: System::Windows::Forms::ToolStripMenuItem^  horizontalToolStripMenuItem;
251
	private: System::Windows::Forms::ToolStripMenuItem^  verticalToolStripMenuItem;
252
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
253
	private: System::Windows::Forms::ToolStripMenuItem^  openToolStripMenuItem;
254
	private: System::Windows::Forms::ToolStripMenuItem^  saveToolStripMenuItem;
255
	private: System::Windows::Forms::ToolStripMenuItem^  saveAsToolStripMenuItem;
256
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
257
	private: System::Windows::Forms::Panel^  PanelTab;
258
	private: System::Windows::Forms::TabControl^  tabControl1;
259
	private: System::Windows::Forms::Button^  button1;
260
	private: System::Windows::Forms::ToolStrip^  toolStrip1;
261
	private: System::Windows::Forms::ToolStripSplitButton^  toolStripSplitButton1;
262
 
263
	private: System::Windows::Forms::ImageList^  imageList1;
264
	private: System::Windows::Forms::ToolStripDropDownButton^  toolStripButton1;
265
	private: System::Windows::Forms::ToolStripMenuItem^  packageToolStripMenuItem1;
266
	private: System::Windows::Forms::ToolStripMenuItem^  shipToolStripMenuItem1;
267
 
268
 
269
	private: System::Windows::Forms::Timer^  timer1;
270
	private: System::Windows::Forms::StatusStrip^  statusStrip1;
271
	private: System::Windows::Forms::ToolStripStatusLabel^  StatusFiles;
272
private: System::Windows::Forms::ToolStripMenuItem^  settingsToolStripMenuItem;
273
private: System::Windows::Forms::ToolStripMenuItem^  configToolStripMenuItem;
274
private: System::Windows::Forms::ImageList^  imageListGames;
275
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;
276
private: System::Windows::Forms::ToolStripButton^  toolStripButton2;
277
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator5;
278
private: System::Windows::Forms::ToolStripMenuItem^  fromPackagerScriptToolStripMenuItem1;
279
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator4;
280
private: System::Windows::Forms::ToolStripMenuItem^  fromPackagerScriptToolStripMenuItem;
281
private: System::Windows::Forms::ToolStripMenuItem^  importShipFromModToolStripMenuItem1;
282
private: System::Windows::Forms::ToolStripMenuItem^  importShipFromModToolStripMenuItem;
283
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator6;
284
private: System::Windows::Forms::ToolStripMenuItem^  packageCreationWizardToolStripMenuItem;
285
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator7;
286
private: System::Windows::Forms::ToolStripMenuItem^  packageCreationWizardToolStripMenuItem1;
287
private: System::Windows::Forms::ToolTip^  toolTip1;
288
private: System::Windows::Forms::ImageList^  imageListSmall;
289
private: System::Windows::Forms::ImageList^  imageListLarge;
290
private: System::Windows::Forms::ImageList^  imageListFiles;
291
private: System::Windows::Forms::ToolStripMenuItem^  multiPackageToolStripMenuItem;
292
private: System::Windows::Forms::ToolStripMenuItem^  toolsToolStripMenuItem;
293
private: System::Windows::Forms::ToolStripMenuItem^  modMergeToolStripMenuItem;
294
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator8;
295
private: System::Windows::Forms::ToolStripDropDownButton^  toolStripDropDownButton1;
296
private: System::Windows::Forms::ToolStripMenuItem^  modMergeToolStripMenuItem1;
297
private: System::Windows::Forms::ToolStripMenuItem^  modDiffToolStripMenuItem;
298
private: System::Windows::Forms::ToolStripMenuItem^  modDiffToolStripMenuItem1;
299
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator10;
300
private: System::Windows::Forms::ToolStripMenuItem^  generatePackageWebListToolStripMenuItem1;
301
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator9;
302
private: System::Windows::Forms::ToolStripMenuItem^  generatePackageWebListToolStripMenuItem;
303
private: System::Windows::Forms::ToolStripMenuItem^  fromArchiveToolStripMenuItem;
304
private: System::ComponentModel::BackgroundWorker^  backgroundWorker1;
305
private: System::Windows::Forms::ToolStripMenuItem^  generatePackageUpdatesToolStripMenuItem;
306
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator11;
307
private: System::Windows::Forms::ToolStripMenuItem^  fileExplorerToolStripMenuItem;
36 cycrow 308
private: System::Windows::Forms::ToolStripMenuItem^  importShipFromVFSToolStripMenuItem;
107 cycrow 309
private: System::Windows::Forms::ToolStripMenuItem^  multiPackageToolStripMenuItem1;
310
private: System::Windows::Forms::ToolStripMenuItem^  fromArchiveToolStripMenuItem1;
311
private: System::Windows::Forms::ToolStripMenuItem^  importShipFromVFSToolStripMenuItem1;
1 cycrow 312
 
313
	private: System::Windows::Forms::ToolStripMenuItem^  exitToolStripMenuItem;
314
 
315
 
316
	private:
317
		BaseForm ^GetActiveChild()
318
		{
319
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
320
			 for ( int i = 0; i < children->Length; i++ )
321
			 {
322
				 BaseForm ^childForm = (BaseForm ^)children[i];
323
				 if ( !childForm->TabPage() )
324
					 continue;
325
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
326
					 return childForm;
327
			 }
328
 
329
			 return nullptr;
330
		}
331
 
36 cycrow 332
		void ImportShip();
333
		void ImportShipFromVFS();
1 cycrow 334
 
116 cycrow 335
		String ^getShipSelection(CVirtualFileSystem *pVfs, System::String ^*shipName);
1 cycrow 336
 
337
 
338
		void OpenDirectory(System::String ^dir)
339
		{
340
			if ( !System::IO::Directory::Exists(dir) )
341
			{
342
				MessageBox::Show(this, "Unable to open packages from directory\nDirectory not found\n\n" + dir, "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
343
				return;
344
			}
345
 
346
			this->OpenFiles(System::IO::Directory::GetFiles(dir, "*.spk"), false, false);
347
			this->OpenFiles(System::IO::Directory::GetFiles(dir, "*.xsp"), false, false);
348
		}
349
 
350
		void OpenFiles(cli::array<System::String ^> ^list, bool checkExtension, bool display)
351
		{
352
			if ( !list )
353
				return;
354
 
355
			for ( int i = 0; i < list->Length; i++ )
356
				this->Open(list[i], display, checkExtension);
357
 
358
			cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
359
			for ( int i = 0; i < children->Length; i++ )
360
			{
361
				BaseForm ^childForm = (BaseForm ^)children[i];
362
				if ( !childForm->TabPage()->Visible )
363
				{
364
					childForm->Show();
365
					childForm->TabPage()->Show();
366
				}
367
			}
368
		}
369
 
370
		void OpenOptionsMenu()
371
		{
94 cycrow 372
			 Options ^opt = gcnew Options(this->imageListGames, _pGameDir, m_pPackages, m_settings);
1 cycrow 373
			 if ( opt->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
374
			 {
375
				 m_settings->bGenerateUpdate = opt->GetGenerateUpdate();
376
			 }
377
 
378
			 if ( opt->LoadText() )
101 cycrow 379
				 this->LoadText(false, true, NULL);
1 cycrow 380
		}
381
 
382
		void OpenFiles(ArrayList ^list, bool checkExtension, bool display)
383
		{
384
			if ( !list )
385
				return;
386
 
387
			for ( int i = 0; i < list->Count; i++ )
388
				this->Open(cli::safe_cast<String ^>(list[i]), display, checkExtension);
389
 
390
			cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
391
			for ( int i = 0; i < children->Length; i++ )
392
			{
393
				BaseForm ^childForm = (BaseForm ^)children[i];
394
				if ( !childForm->TabPage()->Visible )
395
				{
396
					childForm->Show();
397
					childForm->TabPage()->Show();
398
				}
399
			}
400
		}
401
 
402
		void Open()
403
		{
404
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
405
			ofd->Filter = "All (*.spk *.xsp)|*.spk;*.xsp|Package Files (*.spk)|*.spk|Ship Files (*.xsp)|*.xsp";
406
			ofd->Title = "Select the package/ship file to open";
407
			ofd->FilterIndex = 1;
408
			ofd->RestoreDirectory = true;
409
			ofd->Multiselect = true;
410
 
411
			if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
412
				this->OpenFiles(ofd->FileNames, false, true);
413
		}
414
 
415
		void LoadFiles(String ^loadFrom)
416
		{
417
			if ( System::IO::File::Exists(loadFrom) )
418
			{
419
				System::String ^lines = System::IO::File::ReadAllText(loadFrom);
420
				try { System::IO::File::Delete(loadFrom); }
421
				catch (System::IO::IOException ^) {}
422
				catch (System::Exception ^) {}
423
 
424
				if ( lines )
425
				{
191 cycrow 426
					Utils::WString strLines = _WS(lines);
1 cycrow 427
					int num;
191 cycrow 428
					Utils::WString *aLines = strLines.tokenise(L"\n", &num);
1 cycrow 429
					if ( num && aLines )
430
					{
431
						ArrayList ^list = gcnew ArrayList();
432
						for ( int i = 0; i < num; i++ )
433
						{
191 cycrow 434
							Utils::WString l = aLines[i];
435
							l = l.remove('\r');
436
							Utils::WString first = l.token(L":", 1);
437
							Utils::WString rest = l.tokens(L":", 2);
438
							rest.removeFirstSpace();
1 cycrow 439
 
226 cycrow 440
							if ( first.Compare(L"File") )
191 cycrow 441
								list->Add(_US(rest));
1 cycrow 442
						}
443
 
444
						CLEANSPLIT(aLines, num)
445
 
446
						this->OpenFiles(list, true, true);
447
					}
448
 
449
				}
450
			}			
451
		}
452
 
453
		void ExportPackage(String ^file)
454
		{
197 cycrow 455
			Utils::WString sFile = _WS(file);
1 cycrow 456
			int error = 0;
457
 
223 cycrow 458
			CBaseFile *p = m_pPackages->openPackage(sFile, &error, 0, SPKREAD_NODATA);
1 cycrow 459
			if ( !p ) {
460
				MessageBox::Show(this, "Error: Unable to open package file\n" + file, "Error Opening", MessageBoxButtons::OK, MessageBoxIcon::Error);
461
			}
462
			else {
463
				String ^to = IO::FileInfo(file).DirectoryName;
464
				int game = 0;
465
				if ( p->IsMultipleGamesInPackage() ) {
466
					SelectGame ^selGame = gcnew SelectGame("Select game to extract package:\n" + file, m_pPackages);
467
					if ( selGame->ShowDialog(this) == Windows::Forms::DialogResult::OK ) {
468
						game = selGame->GetGame() + 1;
469
					}
470
					else
471
						to = nullptr;
472
				}
473
				else if ( p->IsAnyGameInPackage() ) {
474
					game = p->FindFirstGameInPackage();
475
				}
476
 
477
				if ( to && to->Length ) {
196 cycrow 478
					Utils::WString exportFilename = CFileIO(sFile).changeFileExtension(L"zip");
1 cycrow 479
					if ( game ) {
197 cycrow 480
						exportFilename = CFileIO(exportFilename).dir() + L"/" + CFileIO(exportFilename).baseName() + L"_" + CBaseFile::ConvertGameToString(game) + L".zip";
1 cycrow 481
					}
223 cycrow 482
					if ( p->saveToArchive(exportFilename, game, m_pPackages->GetGameExe())) {
102 cycrow 483
						String ^message = "Export: " + file + "\nTo: " + _US(CFileIO(exportFilename).filename());
1 cycrow 484
						if ( game ) {
197 cycrow 485
							message += "\nGame: " + _US(m_pPackages->GetGameExe()->game(game - 1)->sName);
1 cycrow 486
						}
487
						MessageBox::Show(this, message, "Exported Package", MessageBoxButtons::OK, MessageBoxIcon::Information);
488
					}
489
					else {
102 cycrow 490
						MessageBox::Show(this, "Error: Unable to export to:\n" + _US(exportFilename), "Error Export", MessageBoxButtons::OK, MessageBoxIcon::Error);					}
1 cycrow 491
				}
492
			}
493
		}
494
 
495
		void ExtractPackage(String ^file, bool here)
496
		{
197 cycrow 497
			Utils::WString sFile = _WS(file);
1 cycrow 498
			int error = 0;
499
 
223 cycrow 500
			CBaseFile *p = m_pPackages->openPackage(sFile, &error, 0, SPKREAD_NODATA);
1 cycrow 501
			if ( !p ) {
502
				MessageBox::Show(this, "Error: Unable to open package file\n" + file, "Error Opening", MessageBoxButtons::OK, MessageBoxIcon::Error);
503
			}
504
			else {
505
				String ^to = nullptr;
506
				if ( here ) {
507
					to = IO::FileInfo(file).DirectoryName;
508
				}
509
				else {
510
					FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
511
					fbd->Description = "Select the path to extract package to";
512
					if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
513
						to = fbd->SelectedPath;
514
				}
515
 
516
				if ( to && to->Length ) {
517
					// check if theres multiple games in package
518
					int game = 0;
519
					if ( p->IsMultipleGamesInPackage() ) {
520
						SelectGame ^selGame = gcnew SelectGame("Select game to extract package:\n" + file, m_pPackages);
521
						if ( selGame->ShowDialog(this) == Windows::Forms::DialogResult::OK ) {
522
							game = selGame->GetGame() + 1;
523
						}
524
						else
525
							to = nullptr;
526
					}
527
					else if ( p->IsAnyGameInPackage() ) {
528
						game = p->FindFirstGameInPackage();
529
					}
530
 
129 cycrow 531
					if ( to && to->Length ) 
532
					{
224 cycrow 533
						if (m_pPackages->extractAll(p, _WS(to), game, true)) 
129 cycrow 534
						{
1 cycrow 535
							String ^message = "Extracted: " + file + "\nTo: " + to;
129 cycrow 536
							if ( game )
197 cycrow 537
								message += "\nGame: " + _US(m_pPackages->GetGameExe()->game(game - 1)->sName);
1 cycrow 538
							MessageBox::Show(this, message, "Extracted Package", MessageBoxButtons::OK, MessageBoxIcon::Information);
539
						}
129 cycrow 540
						else 
1 cycrow 541
							MessageBox::Show(this, "Error: Unable to extract to:\n" + to, "Error Extracting", MessageBoxButtons::OK, MessageBoxIcon::Error);
542
					}
543
				}
544
			}
545
		}
546
 
547
		void SavePackagerScript(String ^file)
548
		{
196 cycrow 549
			Utils::WString sFile = _WS(file);
197 cycrow 550
			Utils::WStringList malformed, unknown;
224 cycrow 551
			CBaseFile *package = m_pPackages->loadPackagerScript(sFile, -1, NULL, &malformed, &unknown);
1 cycrow 552
			if ( package )
553
			{
196 cycrow 554
				Utils::WString saveto = package->filename();
555
				saveto = saveto.findReplace(L"$DEFAULTDIR", CFileIO(sFile).dir() + L"/");
556
				saveto = saveto.findReplace(L"$PATH", CFileIO(sFile).dir());
102 cycrow 557
				saveto = saveto.asFilename();
558
 
196 cycrow 559
				if ( !saveto.right(4).Compare(L".spk") && package->GetType() != TYPE_XSP )
560
					saveto += L".spk";
561
				else if ( !saveto.right(4).Compare(L".xsp") && package->GetType() == TYPE_XSP )
562
					saveto += L".xsp";
1 cycrow 563
				// write script
224 cycrow 564
				if ( package->writeFile(saveto) ) {
102 cycrow 565
					String ^message = "Package: " + _US(saveto) + " has been created\n";
1 cycrow 566
					if ( package->AutoGenerateUpdateFile() )
134 cycrow 567
						package->createUpdateFile(CFileIO(saveto).dir());
196 cycrow 568
					Utils::WString exportto = package->exportFilename();
102 cycrow 569
					if ( !exportto.empty() ) {
196 cycrow 570
						exportto = exportto.findReplace(L"$DEFAULTDIR", CFileIO(sFile).dir() + L"/");
571
						exportto = exportto.findReplace(L"$PATH", CFileIO(sFile).dir());
102 cycrow 572
						exportto = exportto.asFilename();
224 cycrow 573
						if ( package->saveToArchive(exportto, 0, m_pPackages->GetGameExe())) {
102 cycrow 574
							message += "\nExported to:\n" + _US(exportto) + "\n";
1 cycrow 575
							if ( package->IsAnyGameInPackage() ) {
197 cycrow 576
								for ( int i = 0; i < m_pPackages->GetGameExe()->numGames(); i++ ) {
1 cycrow 577
									if ( package->IsGameInPackage(i + 1) ) {
197 cycrow 578
										Utils::WString exportFile = CFileIO(saveto).dir() + L"/" + CFileIO(saveto).baseName() + L"_" + CBaseFile::ConvertGameToString(i + 1) + L"." + CFileIO(exportto).extension();
224 cycrow 579
										if ( package->saveToArchive(exportFile, i + 1, m_pPackages->GetGameExe())) {
102 cycrow 580
											message += _US(CFileIO(exportFile).filename()) + "\n";
1 cycrow 581
										}
582
									}
583
								}
584
							}
585
						}
586
					}
587
					MessageBox::Show(this, message, "Package Created", MessageBoxButtons::OK, MessageBoxIcon::Information);
588
				}
589
				else
590
					MessageBox::Show(this, "Error: Unable to create package from script\n" + file, "Error Creating Package", MessageBoxButtons::OK, MessageBoxIcon::Error);
591
			}
592
		}
593
 
594
		void OpenPackagerScript(String ^file)
595
		{
197 cycrow 596
			Utils::WStringList malformed, unknown;
199 cycrow 597
			CBaseFile *package = m_pPackages->loadPackagerScript(_WS(file), SPKCOMPRESS_NONE, NULL, &malformed, &unknown);
1 cycrow 598
			if ( package )
599
			{
600
				package->SetDataCompression(SPKCOMPRESS_7ZIP);
601
				PackageForm ^childForm = this->OpenPackage(true, package, file, "");
50 cycrow 602
				childForm->Text = _US(package->filename());
1 cycrow 603
			}
604
		}
605
		void OpenPackagerScript()
606
		{
607
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
608
			ofd->Filter = "Packager Script (*.sps)|*.sps";
609
			ofd->FilterIndex = 1;
610
			ofd->Title = "Select the packager script to create a package from";
611
			ofd->RestoreDirectory = true;
612
			ofd->Multiselect = false;
613
 
614
			if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
615
				OpenPackagerScript(ofd->FileName);
616
		}
617
 
618
		MultiForm ^OpenPackage(bool display, CMultiSpkFile *package, String ^file, String ^title)
619
		{
225 cycrow 620
			Utils::WString sFile = _WS(file);
1 cycrow 621
			TabPage ^tp = gcnew TabPage();
622
			tp->Text = title;
623
			tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
624
			if ( tp->ImageIndex == -1 )
625
				tp->ImageIndex = 0;
626
 
627
			ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
36 cycrow 628
			MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1 cycrow 629
 
630
			childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
631
			this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
632
			childForm->WindowState = FormWindowState::Minimized;
633
 
634
			this->ProcessOpen(false, tp, childForm);
635
			childForm->LoadPackage(package, file);
636
			this->ProcessOpen(display, tp, childForm);
637
 
108 cycrow 638
			childForm->WindowState = Windows::Forms::FormWindowState::Maximized;
1 cycrow 639
			return childForm;
640
		}
641
		PackageForm ^OpenPackage(bool display, CBaseFile *package, String ^file, String ^title)
642
		{
197 cycrow 643
			Utils::WString sFile = _WS(file);
1 cycrow 644
 
645
			if ( this->imageList1->Images->IndexOfKey(file) == -1 )
646
			{
170 cycrow 647
				if ( package->icon() )
1 cycrow 648
				{
649
					package->ReadIconFileToMemory();
197 cycrow 650
					Utils::WString sIconFile = _WS(IO::Path::GetTempPath()) + L"\\" + CFileIO(sFile).baseName() + L"." + package->iconExt();
224 cycrow 651
					if ( package->extractFile(package->icon(), CFileIO(sIconFile).fullFilename(), false))
1 cycrow 652
					{
102 cycrow 653
						String ^iconFile = _US(sIconFile);
1 cycrow 654
						if ( IO::File::Exists(iconFile) )
655
						{
656
							String ^ext = System::IO::FileInfo(iconFile).Extension;
657
							if ( !String::Compare(ext, "bmp", false) || !String::Compare(ext, "ico", false) )
658
								this->imageList1->Images->Add(file, Bitmap::FromFile(iconFile));
659
							else
660
							{
661
								Bitmap ^myBitmap = gcnew Bitmap(iconFile);
662
								if ( myBitmap )
663
									this->imageList1->Images->Add(file, myBitmap);
664
							}
665
						}
666
					}
667
				}
668
			}
669
 
670
			TabPage ^tp = gcnew TabPage();
671
			tp->Text = title;
672
			tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
673
			if ( tp->ImageIndex == -1 )
674
				tp->ImageIndex = 0;
675
 
676
			ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
36 cycrow 677
			PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1 cycrow 678
			childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
679
			this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
680
			childForm->WindowState = FormWindowState::Minimized;
681
 
682
			this->ProcessOpen(false, tp, childForm);
683
			childForm->LoadPackage(package, file);
684
			this->ProcessOpen(display, tp, childForm);
685
 
686
			return childForm;
687
		}
688
 
689
		void ProcessOpen(bool display, TabPage ^tp, BaseForm ^childForm)
690
		{
691
			tp->Parent = tabControl1;
692
			if ( display || !this->HasChildren )
693
			{
694
				tabControl1->SelectedTab = tp;
695
				tp->Show();
696
				childForm->Show();
697
				childForm->WindowState = FormWindowState::Maximized;
698
				this->UpdateStatus();
699
			}
700
		}
701
 
702
		void GeneratePackageUpdates()
703
		{
704
			FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
705
			fbd->Description = "Select the path to generate the updates from";
706
			if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
707
			{
708
				int count = 0;
709
				for ( int type = 0; type < 2; type++ )
710
				{
711
					array <System::String ^> ^Files = nullptr;
712
					if ( type == 0 )
713
						Files = Directory::GetFiles(fbd->SelectedPath, "*.spk");
714
					else if ( type == 1 )
715
						Files = Directory::GetFiles(fbd->SelectedPath, "*.xsp");
716
					else
717
						break;
718
 
719
					for ( int i = 0; i < Files->Length; i++ )
720
					{
197 cycrow 721
						Utils::WString file = _WS(Files[i]);
1 cycrow 722
						int error = 0;
224 cycrow 723
						CBaseFile *p = m_pPackages->openPackage(file, &error, 0, SPKREAD_NODATA);
1 cycrow 724
						if ( !p )
725
							continue;
726
 
196 cycrow 727
						Utils::WString ufile = p->createUpdateFile(_WS(fbd->SelectedPath));
134 cycrow 728
						if ( !ufile.empty() )
1 cycrow 729
							++count;
730
						delete p;
731
					}
732
				}
733
 
734
				if ( !count )
735
					MessageBox::Show(this, "No package files with updates found in " + fbd->SelectedPath + "\nSelect a directory that contains spk/xsp files", "No Packages", MessageBoxButtons::OK, MessageBoxIcon::Error);
736
				else
737
					MessageBox::Show(this, "Update files generated for " + count + " packages\nDirectory: " + fbd->SelectedPath, "Update File Generated", MessageBoxButtons::OK, MessageBoxIcon::Information);
738
			}
739
		}
740
 
741
		void GeneratePackageWebList()
742
		{
743
			FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
744
			fbd->Description = "Select the path to generate the list from";
745
			if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
746
			{
197 cycrow 747
				Utils::WStringList filedata;
1 cycrow 748
				for ( int type = 0; type < 2; type++ )
749
				{
750
					array <System::String ^> ^Files = nullptr;
751
					if ( type == 0 )
752
						Files = Directory::GetFiles(fbd->SelectedPath, "*.spk");
753
					else if ( type == 1 )
754
						Files = Directory::GetFiles(fbd->SelectedPath, "*.xsp");
755
					else
756
						break;
757
 
758
					for ( int i = 0; i < Files->Length; i++ )
759
					{
197 cycrow 760
						Utils::WString file = _WS(Files[i]);
1 cycrow 761
						int error = 0;
182 cycrow 762
						CBaseFile *p = m_pPackages->openPackage(file, &error, 0, SPKREAD_NODATA);
1 cycrow 763
						if ( !p )
764
							continue;
765
 
126 cycrow 766
						filedata.pushBack(CPackages::FormatAvailablePackageData(p));
1 cycrow 767
						delete p;
768
					}
769
				}
770
 
126 cycrow 771
				if ( filedata.empty() )
1 cycrow 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
774
				{
197 cycrow 775
					CFileIO File(_WS(fbd->SelectedPath) + L"/xpackagedata.dat");
126 cycrow 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);
1 cycrow 778
					else
779
						MessageBox::Show(this, "Unable to write web data file in " + fbd->SelectedPath, "File Write Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
780
				}
781
			}
782
		}
783
 
784
		void Open(System::String ^file, bool display, bool checkExtension)
785
		{
786
			CBaseFile *convertFile = NULL;
787
			if ( checkExtension )
788
			{
789
				if ( String::Compare(IO::FileInfo(file).Extension, ".spk") != 0 && String::Compare(IO::FileInfo(file).Extension, ".xsp") != 0 && String::Compare(IO::FileInfo(file).Extension, ".sps") != 0 )
790
					return;
791
			}
792
 
793
			if ( !System::IO::File::Exists(file) )
794
			{
795
				if ( display )
796
					MessageBox::Show(this, "Unable to open package file:\n" + file + "\n\nFile doesn't exist", "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
797
				return;
798
			}
799
 
800
			// check if its already open
801
			if ( this->IsOpen(file) )
802
			{
803
				if ( display )
804
					MessageBox::Show(this, "The package is currently open\n" + file, "Already Open", MessageBoxButtons::OK, MessageBoxIcon::Information);
805
				return;
806
			}
807
 
808
			// sps
809
			if ( String::Compare(IO::FileInfo(file).Extension, ".sps") == 0 )
810
			{
811
				OpenPackagerScript(file);
812
				return;
813
			}
814
 
815
			float fVersion;
197 cycrow 816
			Utils::WString sFile = _WS(file);
1 cycrow 817
			int fileType = CSpkFile::CheckFile(sFile, &fVersion);
818
 
819
			if ( fVersion > (float)FILEVERSION )
820
			{
821
				if ( display )
822
					MessageBox::Show(this, "Package file is created with a newer version, unable to open", "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
823
				return;
824
			}
825
 
9 cycrow 826
			if ( fileType == SPKFILE_INVALID || fileType == SPKFILE_OLD )
1 cycrow 827
			{
828
				bool loaded = false;
829
				if ( String::Compare(IO::FileInfo(file).Extension, ".xsp") == 0 )
830
				{
831
					CXspFile *shipFile = new CXspFile;
218 cycrow 832
					loaded = shipFile->convertOld(_WS(file));
1 cycrow 833
					if ( loaded )
834
					{
50 cycrow 835
						shipFile->adjustChanged(true);
218 cycrow 836
						shipFile->setFilename(_WS(file));
1 cycrow 837
						convertFile = shipFile;
838
					}
839
					else 
840
						delete shipFile;
841
				}
9 cycrow 842
				else if ( String::Compare(IO::FileInfo(file).Extension, ".spk") == 0 )
843
				{
218 cycrow 844
					CSpkFile *spkFile = CSpkFile::convertFromOld(_WS(file));
9 cycrow 845
					if ( spkFile ) {
846
						loaded = true;
50 cycrow 847
						spkFile->adjustChanged(true);
224 cycrow 848
						spkFile->setFilename(_WS(file));
9 cycrow 849
						convertFile = spkFile;
850
					}
851
				}
1 cycrow 852
 
853
				if ( !loaded )
854
				{
855
					if ( display )
856
						MessageBox::Show(this, "Invalid package file:\n" + file + "\n\nDoesn't appear to be a valid package", "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
857
					return;				
858
				}
859
			}
860
 
861
			// open multi package
862
			bool loaded = false;
863
 
864
			int error;
865
			if ( fileType == SPKFILE_MULTI )
866
			{
224 cycrow 867
				CMultiSpkFile *mspk = m_pPackages->openMultiPackage(sFile, &error);
1 cycrow 868
				if ( mspk )
869
				{
870
					loaded = true;
871
					BaseForm ^childForm = this->OpenPackage(display, mspk, file, "");
872
					childForm->Text = file;
873
				}
874
			}
875
			else
876
			{
224 cycrow 877
				CBaseFile *package = (convertFile) ? convertFile : m_pPackages->openPackage(sFile, &error);
1 cycrow 878
				if ( package )
879
				{
880
					loaded = true;
881
					PackageForm ^childForm = this->OpenPackage(display, package, file, "");
882
					if ( convertFile )
883
					{
50 cycrow 884
						convertFile->adjustChanged(true);
1 cycrow 885
						childForm->UpdateChanged();
886
					}
887
				}
888
			}
889
 
890
			if ( loaded )
891
			{
892
				// adjust the loaded list
197 cycrow 893
				sFile = sFile.findReplace(L"/", L"\\").remove(9).remove('\r').remove('\n');
894
				m_pLoadedList->remove(sFile, true);
895
				m_pLoadedList->pushFront(sFile);
1 cycrow 896
 
197 cycrow 897
				while ( m_pLoadedList->size() > 15 )
898
					m_pLoadedList->popBack();
1 cycrow 899
 
900
				this->SaveData();
901
 
902
				this->UpdateDropDownOpen();
903
			}	
904
			else
905
			{
906
				if ( display )
907
				{
191 cycrow 908
					System::String ^sError = "Unknown Error (" + _US(Utils::WString::Number(error)) + ")";
1 cycrow 909
					switch ( error )
910
					{
911
						case INSTALLERR_OLD:
912
							sError = "Old unsupported package file";
913
							break;
914
						case INSTALLERR_INVALID:
915
							sError = "Invalid Package File";
916
							break;
917
						case INSTALLERR_NOMULTI:
918
							sError = "Multi-Packages not currently supported";
919
							break;
920
					}
921
					MessageBox::Show(this, "Unable to open package file:\n" + file + "\n\nError: " + sError, "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
922
				}
923
			}
924
		}
925
 
926
		void NewPackage(bool ship)
927
		{
928
			 TabPage ^tp = gcnew TabPage();
929
  			 tp->ImageIndex = 0;
930
			 if ( ship )
931
				tp->Text = "New Ship";
932
			 else
933
				tp->Text = "New Package";
934
			 ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
935
 			 this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
36 cycrow 936
			 PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1 cycrow 937
			 childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
938
			 tp->Parent = tabControl1;
939
			 tabControl1->SelectedTab = tp;
940
 
941
			 if ( ship )
942
				childForm->CreateShip();
943
			 else
944
				childForm->CreatePackage();
945
 
946
			 childForm->WindowState = FormWindowState::Maximized;
947
			 tp->Show();
948
			 childForm->Show();
949
		}
950
 
951
		void NewMultiPackage()
952
		{
953
			 TabPage ^tp = gcnew TabPage();
954
  			 tp->ImageIndex = 0;
955
			 tp->Text = "New Mutli Package";
956
			 ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
957
 			 this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
36 cycrow 958
			 MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1 cycrow 959
			 childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
960
			 tp->Parent = tabControl1;
961
			 tabControl1->SelectedTab = tp;
962
 
963
			 childForm->CreatePackage();
964
 
965
			 childForm->WindowState = FormWindowState::Maximized;
966
			 tp->Show();
967
			 childForm->Show();
968
 
969
		}
970
 
971
		void CloseAll()
972
		{
973
			cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
974
			for ( int i = 0; i < children->Length; i++ )
975
			{
976
				delete ((BaseForm ^)children[i])->TabPage();
977
				//((BaseForm ^)children[i])->
978
				delete children[i];
979
			}
980
			this->UpdateDisplay();
981
		}
982
 
983
		void CloseEvent(System::Object ^Sender, System::EventArgs ^E) 
984
		{
985
			this->CloseAll();
986
			this->SaveData();
987
		}
988
 
989
		void UpdateDropDownOpen()
990
		{
991
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
992
 
993
			// clear them all
994
			this->toolStripSplitButton1->DropDownItems->Clear();
995
			this->openToolStripMenuItem->DropDownItems->Clear();
996
 
997
			System::Windows::Forms::ToolStripMenuItem ^openPackage = gcnew System::Windows::Forms::ToolStripMenuItem;
998
			openPackage->Text = "Open Package";
999
			openPackage->Tag = "$PACKAGE";
1000
			openPackage->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1001
			openPackage->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripSplitButton1.Image")));
1002
			this->openToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripSplitButton1.Image")));
1003
			this->openToolStripMenuItem->DropDownItems->Add(openPackage);
1004
 
1005
			System::Windows::Forms::ToolStripMenuItem ^newItem = gcnew System::Windows::Forms::ToolStripMenuItem;
1006
			newItem->Text = "Open Directory";
1007
			newItem->Tag = "$DIR";
1008
			newItem->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1009
			this->toolStripSplitButton1->DropDownItems->Add(newItem);
1010
 
1011
			// add all none open items
1012
			bool sep = false;
197 cycrow 1013
			for ( auto itr = m_pLoadedList->begin(); itr != m_pLoadedList->end(); itr++ )
1 cycrow 1014
			{
1015
				// check if we have it open
197 cycrow 1016
				Utils::WString str = (*itr)->str;
1017
				System::String ^sFile = _US(str.findReplace(L"/", L"\\"));
1 cycrow 1018
				if ( this->IsOpen(sFile) )
1019
					continue;
197 cycrow 1020
				if ( this->IsOpen(_US(str.findReplace(L"\\", L"/"))) )
1 cycrow 1021
					continue;
1022
 
1023
				if ( !IO::File::Exists(sFile) )
1024
					continue;
1025
 
1026
				if ( !sep )
1027
				{
1028
					sep = true;
1029
					this->toolStripSplitButton1->DropDownItems->Add(gcnew System::Windows::Forms::ToolStripSeparator());
1030
					this->openToolStripMenuItem->DropDownItems->Add(gcnew System::Windows::Forms::ToolStripSeparator());
1031
				}
1032
 
1033
				// work out the type
1034
				float fVersion;
1035
				int iconType = -1;
197 cycrow 1036
				int check = CBaseFile::CheckFile(str, &fVersion);
1 cycrow 1037
				switch ( check )
1038
				{
1039
					case SPKFILE_BASE:
1040
						iconType = 5;
1041
						break;
1042
					case SPKFILE_SINGLE:
1043
						iconType = 0;
1044
						break;
1045
					case SPKFILE_SINGLESHIP:
1046
						iconType = 1;
1047
						break;
1048
					case SPKFILE_MULTI:
1049
						iconType = 4;
1050
						break;
1051
				}
1052
 
1053
				// otherwise add it to the list
1054
				System::Windows::Forms::ToolStripMenuItem ^newItem = gcnew System::Windows::Forms::ToolStripMenuItem;
1055
				newItem->Text = sFile;
1056
				newItem->Tag = newItem->Text;
1057
				newItem->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1058
				if ( iconType > -1 )
1059
					newItem->Image = this->imageList1->Images[iconType];
1060
				this->toolStripSplitButton1->DropDownItems->Add(newItem);
1061
 
1062
				System::Windows::Forms::ToolStripMenuItem ^newItem2 = gcnew System::Windows::Forms::ToolStripMenuItem;
1063
				newItem2->Text = sFile;
1064
				newItem2->Tag = newItem->Text;
1065
				newItem2->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1066
				if ( iconType > -1 )
1067
					newItem2->Image = this->imageList1->Images[iconType];
1068
				this->openToolStripMenuItem->DropDownItems->Add(newItem2);
1069
			}
1070
		}
1071
 
1072
		bool IsOpen(System::String ^file)
1073
		{
1074
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1075
			 for ( int i = 0; i < children->Length; i++ )
1076
			 {
1077
				 BaseForm ^childForm = (BaseForm ^)children[i];
1078
				 if ( childForm->IsClosing() )
1079
					 continue;
1080
				 if ( childForm->CheckFilename(file) )
1081
					 return true;
1082
			 }
1083
 
1084
			 return false;
1085
		}
1086
 
1087
		void Save()
1088
		{
1089
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1090
			 for ( int i = 0; i < children->Length; i++ )
1091
			 {
1092
				 BaseForm ^childForm = (BaseForm ^)children[i];
1093
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
1094
				 {
1095
					 if ( childForm->GetFormType() == FORMTYPE_SINGLE )
1096
						((PackageForm ^)childForm)->Save();
1097
					 else if ( childForm->GetFormType() == FORMTYPE_MULTI )
1098
						((MultiForm ^)childForm)->Save();
1099
					 else
1100
						childForm->Save();
1101
					 this->UpdateDropDownOpen();
1102
					 break;
1103
				 }
1104
			 }
1105
		}
1106
 
1107
		void SaveAs()
1108
		{
1109
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1110
			 for ( int i = 0; i < children->Length; i++ )
1111
			 {
1112
				 BaseForm ^childForm = (BaseForm ^)children[i];
1113
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
1114
				 {
1115
					 if ( childForm->GetFormType() == FORMTYPE_SINGLE )
1116
						((PackageForm ^)childForm)->SaveAs();
1117
					 else if ( childForm->GetFormType() == FORMTYPE_MULTI )
1118
						((MultiForm ^)childForm)->SaveAs();
1119
					 else
1120
						childForm->SaveAs();
1121
					 this->UpdateDropDownOpen();
1122
					 break;
1123
				 }
1124
			 }
1125
		}
1126
 
1127
		void PackageCreationWizard()
1128
		{
1129
			MessageBox::Show(this, "The creation wizard is currently not available", "Feature Missing", MessageBoxButtons::OK, MessageBoxIcon::Error);
1130
			return;
1131
 
1132
			CreationWizard ^wizard = gcnew CreationWizard();
1133
			if ( wizard->ShowDialog(this) == Windows::Forms::DialogResult::OK )
1134
			{
1135
			}
1136
		}
1137
 
1138
		void SaveData()
1139
		{
1140
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
224 cycrow 1141
			CFileIO Config(_WS(mydoc) + L"/Egosoft/creator.dat");
227 cycrow 1142
			std::vector<Utils::WString> lines;
1 cycrow 1143
 
1144
			if ( this->WindowState == FormWindowState::Normal )
1145
			{
227 cycrow 1146
				lines.push_back(Utils::WString(L"CreatorSize:") + Utils::WString::Number(this->Size.Width) + L" " + Utils::WString::Number(this->Size.Height));
1147
				lines.push_back(Utils::WString(L"CreatorPos:") + Utils::WString::Number(this->Location.X) + L" " + Utils::WString::Number(this->Location.Y));
1 cycrow 1148
			}
1149
			else
1150
			{
227 cycrow 1151
				lines.push_back(Utils::WString(L"CreatorPos:") + Utils::WString::Number(this->RestoreBounds.Location.X) + L" " + Utils::WString::Number(this->RestoreBounds.Location.Y));
1152
				lines.push_back(Utils::WString(L"CreatorSize:") + Utils::WString::Number(this->RestoreBounds.Size.Width) + L" " + Utils::WString::Number(this->RestoreBounds.Size.Height));
1 cycrow 1153
			}
1154
 
1155
			if ( this->WindowState == FormWindowState::Maximized )
227 cycrow 1156
				lines.push_back(L"CreatorMax:");
1 cycrow 1157
 
197 cycrow 1158
			for (auto itr = m_pLoadedList->begin(); itr != m_pLoadedList->end(); itr++)
227 cycrow 1159
				lines.push_back(Utils::WString(L"Loaded:") + (*itr)->data + L" " + (*itr)->str);
1160
			_pGameDir->writeData(lines);
1 cycrow 1161
			if ( m_settings->bGenerateUpdate )
227 cycrow 1162
				lines.push_back(L"GenerateUpdate:");
1 cycrow 1163
 
227 cycrow 1164
			Config.writeFileUTF(&lines);
1 cycrow 1165
		}
1166
 
1167
		void LoadData()
1168
		{
1169
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
1170
			CFileIO Config;
223 cycrow 1171
			if ( Config.open(_WS(mydoc) + L"/Egosoft/creator.dat") )
1 cycrow 1172
			{
223 cycrow 1173
				std::vector<Utils::WString> lines;
1174
				if(Config.readLines(lines))
1 cycrow 1175
				{
223 cycrow 1176
					for (size_t i = 0; i < (int)lines.size(); i++ )
1 cycrow 1177
					{
223 cycrow 1178
						Utils::WString line(lines.at(i));
1179
						Utils::WString start = line.token(L":", 1).toLower();
1180
						Utils::WString rest = line.tokens(L":", 2).removeFirstSpace();
1181
						if ( start.Compare(L"CreatorSize") )
1182
							this->Size = System::Drawing::Size(rest.token(L" ", 1).toInt(), rest.token(L" ", 2).toInt());
1183
						else if ( start.Compare(L"CreatorPos") )
1 cycrow 1184
						{
223 cycrow 1185
							m_iLocX = rest.token(L" ", 1).toInt();
1186
							m_iLocY = rest.token(L" ", 2).toInt();
1 cycrow 1187
						}
223 cycrow 1188
						else if ( start.Compare(L"Loaded") )
197 cycrow 1189
							m_pLoadedList->pushBack(rest);
223 cycrow 1190
						else if ( start.Compare(L"CreatorMax") )
1 cycrow 1191
							this->WindowState = FormWindowState::Maximized;
223 cycrow 1192
						else if ( start.Compare(L"GenerateUpdate") )
1 cycrow 1193
							m_settings->bGenerateUpdate = true;
223 cycrow 1194
						else if ( start.Compare(L"GameDir") )
160 cycrow 1195
							_pGameDir->parse(rest, m_pPackages);
1 cycrow 1196
					}
1197
				}
1198
			}
1199
		}
101 cycrow 1200
 
1201
		void LoadText(bool center, bool reload, CVirtualFileSystem *vfs)
1 cycrow 1202
		{
101 cycrow 1203
			if ( !reload ) {
1204
				// check if the text has been updated
1205
				if ( vfs && vfs->isTextUpdated() ) return;
1206
 
1207
				// check if all text as been updated
1208
				if ( !vfs && _pGameDir->isAllTextLoaded() ) return;
1209
			}
1 cycrow 1210
 
94 cycrow 1211
			if ( _pGameDir->isEmpty() ) return;
1 cycrow 1212
 
101 cycrow 1213
			Creator::LoadText ^load = nullptr;
1214
			if ( vfs ) 
1215
				load = gcnew Creator::LoadText(vfs);
1216
			else 
1217
				load = gcnew Creator::LoadText(_pGameDir, reload);
1218
 
1 cycrow 1219
			if ( center )
1220
				load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
1221
 
1222
			load->ShowDialog(this);
1223
		}
1224
 
1225
 
1226
private: System::ComponentModel::IContainer^  components;
1227
 
1228
 
1229
		/// <summary>
1230
		/// Required designer variable.
1231
		/// </summary>
1232
 
1233
 
1234
#pragma region Windows Form Designer generated code
1235
		/// <summary>
1236
		/// Required method for Designer support - do not modify
1237
		/// the contents of this method with the code editor.
1238
		/// </summary>
1239
		void InitializeComponent(void)
1240
		{
1241
			this->components = (gcnew System::ComponentModel::Container());
1242
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
1243
			this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
1244
			this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1245
			this->newToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1246
			this->packageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1247
			this->shipToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1248
			this->multiPackageToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1249
			this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());
1250
			this->fromPackagerScriptToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1251
			this->fromArchiveToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1252
			this->importShipFromModToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1253
			this->importShipFromVFSToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1254
			this->toolStripSeparator6 = (gcnew System::Windows::Forms::ToolStripSeparator());
1255
			this->packageCreationWizardToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1256
			this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1257
			this->saveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1258
			this->saveAsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1259
			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
1260
			this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1261
			this->windowsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1262
			this->layoutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1263
			this->cascadeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1264
			this->horizontalToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1265
			this->verticalToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1266
			this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
1267
			this->settingsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1268
			this->configToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1269
			this->toolsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1270
			this->modMergeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1271
			this->modDiffToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1272
			this->toolStripSeparator10 = (gcnew System::Windows::Forms::ToolStripSeparator());
1273
			this->generatePackageWebListToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1274
			this->PanelTab = (gcnew System::Windows::Forms::Panel());
1275
			this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
1276
			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
1277
			this->button1 = (gcnew System::Windows::Forms::Button());
1278
			this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
1279
			this->toolStripButton1 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
1280
			this->packageToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1281
			this->shipToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1282
			this->multiPackageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1283
			this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
1284
			this->fromPackagerScriptToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1285
			this->fromArchiveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1286
			this->importShipFromModToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1287
			this->importShipFromVFSToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1288
			this->toolStripSeparator7 = (gcnew System::Windows::Forms::ToolStripSeparator());
1289
			this->packageCreationWizardToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1290
			this->toolStripSplitButton1 = (gcnew System::Windows::Forms::ToolStripSplitButton());
1291
			this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
1292
			this->toolStripButton2 = (gcnew System::Windows::Forms::ToolStripButton());
1293
			this->toolStripSeparator8 = (gcnew System::Windows::Forms::ToolStripSeparator());
1294
			this->toolStripDropDownButton1 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
1295
			this->modMergeToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1296
			this->modDiffToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1297
			this->toolStripSeparator9 = (gcnew System::Windows::Forms::ToolStripSeparator());
1298
			this->generatePackageWebListToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1299
			this->generatePackageUpdatesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1300
			this->toolStripSeparator11 = (gcnew System::Windows::Forms::ToolStripSeparator());
1301
			this->fileExplorerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1302
			this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
1303
			this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
1304
			this->StatusFiles = (gcnew System::Windows::Forms::ToolStripStatusLabel());
1305
			this->imageListGames = (gcnew System::Windows::Forms::ImageList(this->components));
1306
			this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
1307
			this->imageListSmall = (gcnew System::Windows::Forms::ImageList(this->components));
1308
			this->imageListLarge = (gcnew System::Windows::Forms::ImageList(this->components));
1309
			this->imageListFiles = (gcnew System::Windows::Forms::ImageList(this->components));
1310
			this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
1311
			this->menuStrip1->SuspendLayout();
1312
			this->PanelTab->SuspendLayout();
1313
			this->toolStrip1->SuspendLayout();
1314
			this->statusStrip1->SuspendLayout();
1315
			this->SuspendLayout();
1316
			// 
1317
			// menuStrip1
1318
			// 
127 cycrow 1319
			this->menuStrip1->ImageScalingSize = System::Drawing::Size(20, 20);
1320
			this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {
1321
				this->fileToolStripMenuItem,
1322
					this->windowsToolStripMenuItem, this->settingsToolStripMenuItem, this->toolsToolStripMenuItem
1323
			});
1 cycrow 1324
			this->menuStrip1->Location = System::Drawing::Point(0, 0);
1325
			this->menuStrip1->Name = L"menuStrip1";
127 cycrow 1326
			this->menuStrip1->Padding = System::Windows::Forms::Padding(8, 2, 0, 2);
1327
			this->menuStrip1->Size = System::Drawing::Size(996, 28);
1 cycrow 1328
			this->menuStrip1->TabIndex = 2;
1329
			this->menuStrip1->Text = L"menuStrip1";
1330
			// 
1331
			// fileToolStripMenuItem
1332
			// 
127 cycrow 1333
			this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(6) {
1334
				this->newToolStripMenuItem,
1335
					this->openToolStripMenuItem, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem, this->toolStripSeparator2, this->exitToolStripMenuItem
1336
			});
1 cycrow 1337
			this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
127 cycrow 1338
			this->fileToolStripMenuItem->Size = System::Drawing::Size(44, 24);
1 cycrow 1339
			this->fileToolStripMenuItem->Text = L"&File";
1340
			// 
1341
			// newToolStripMenuItem
1342
			// 
127 cycrow 1343
			this->newToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(10) {
1344
				this->packageToolStripMenuItem,
1345
					this->shipToolStripMenuItem, this->multiPackageToolStripMenuItem1, this->toolStripSeparator5, this->fromPackagerScriptToolStripMenuItem1,
1346
					this->fromArchiveToolStripMenuItem1, this->importShipFromModToolStripMenuItem1, this->importShipFromVFSToolStripMenuItem1, this->toolStripSeparator6,
1347
					this->packageCreationWizardToolStripMenuItem
1348
			});
1349
			this->newToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"newToolStripMenuItem.Image")));
1 cycrow 1350
			this->newToolStripMenuItem->Name = L"newToolStripMenuItem";
127 cycrow 1351
			this->newToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1352
			this->newToolStripMenuItem->Text = L"&New";
1353
			// 
1354
			// packageToolStripMenuItem
1355
			// 
127 cycrow 1356
			this->packageToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageToolStripMenuItem.Image")));
1 cycrow 1357
			this->packageToolStripMenuItem->Name = L"packageToolStripMenuItem";
127 cycrow 1358
			this->packageToolStripMenuItem->Size = System::Drawing::Size(249, 26);
1 cycrow 1359
			this->packageToolStripMenuItem->Text = L"Package";
1360
			this->packageToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::packageToolStripMenuItem_Click);
1361
			// 
1362
			// shipToolStripMenuItem
1363
			// 
1364
			this->shipToolStripMenuItem->Name = L"shipToolStripMenuItem";
127 cycrow 1365
			this->shipToolStripMenuItem->Size = System::Drawing::Size(249, 26);
1 cycrow 1366
			this->shipToolStripMenuItem->Text = L"Ship";
1367
			this->shipToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::shipToolStripMenuItem_Click);
1368
			// 
107 cycrow 1369
			// multiPackageToolStripMenuItem1
1370
			// 
1371
			this->multiPackageToolStripMenuItem1->Name = L"multiPackageToolStripMenuItem1";
127 cycrow 1372
			this->multiPackageToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
107 cycrow 1373
			this->multiPackageToolStripMenuItem1->Text = L"Multi Package";
1374
			this->multiPackageToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::multiPackageToolStripMenuItem1_Click);
1375
			// 
1 cycrow 1376
			// toolStripSeparator5
1377
			// 
1378
			this->toolStripSeparator5->Name = L"toolStripSeparator5";
127 cycrow 1379
			this->toolStripSeparator5->Size = System::Drawing::Size(246, 6);
1 cycrow 1380
			// 
1381
			// fromPackagerScriptToolStripMenuItem1
1382
			// 
127 cycrow 1383
			this->fromPackagerScriptToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fromPackagerScriptToolStripMenuItem1.Image")));
1 cycrow 1384
			this->fromPackagerScriptToolStripMenuItem1->Name = L"fromPackagerScriptToolStripMenuItem1";
127 cycrow 1385
			this->fromPackagerScriptToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
1 cycrow 1386
			this->fromPackagerScriptToolStripMenuItem1->Text = L"From Packager Script";
1387
			this->fromPackagerScriptToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::fromPackagerScriptToolStripMenuItem1_Click);
1388
			// 
107 cycrow 1389
			// fromArchiveToolStripMenuItem1
1390
			// 
1391
			this->fromArchiveToolStripMenuItem1->Name = L"fromArchiveToolStripMenuItem1";
127 cycrow 1392
			this->fromArchiveToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
107 cycrow 1393
			this->fromArchiveToolStripMenuItem1->Text = L"From Archive";
1394
			this->fromArchiveToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::fromArchiveToolStripMenuItem1_Click);
1395
			// 
1 cycrow 1396
			// importShipFromModToolStripMenuItem1
1397
			// 
127 cycrow 1398
			this->importShipFromModToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"importShipFromModToolStripMenuItem1.Image")));
1 cycrow 1399
			this->importShipFromModToolStripMenuItem1->Name = L"importShipFromModToolStripMenuItem1";
127 cycrow 1400
			this->importShipFromModToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
1 cycrow 1401
			this->importShipFromModToolStripMenuItem1->Text = L"Import Ship From Mod";
1402
			this->importShipFromModToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::importShipFromModToolStripMenuItem1_Click);
1403
			// 
107 cycrow 1404
			// importShipFromVFSToolStripMenuItem1
1405
			// 
1406
			this->importShipFromVFSToolStripMenuItem1->Name = L"importShipFromVFSToolStripMenuItem1";
127 cycrow 1407
			this->importShipFromVFSToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
107 cycrow 1408
			this->importShipFromVFSToolStripMenuItem1->Text = L"Import Ship from VFS";
1409
			this->importShipFromVFSToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::importShipFromVFSToolStripMenuItem1_Click);
1410
			// 
1 cycrow 1411
			// toolStripSeparator6
1412
			// 
1413
			this->toolStripSeparator6->Name = L"toolStripSeparator6";
127 cycrow 1414
			this->toolStripSeparator6->Size = System::Drawing::Size(246, 6);
1 cycrow 1415
			// 
1416
			// packageCreationWizardToolStripMenuItem
1417
			// 
127 cycrow 1418
			this->packageCreationWizardToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageCreationWizardToolStripMenuItem.Image")));
1 cycrow 1419
			this->packageCreationWizardToolStripMenuItem->Name = L"packageCreationWizardToolStripMenuItem";
127 cycrow 1420
			this->packageCreationWizardToolStripMenuItem->Size = System::Drawing::Size(249, 26);
1 cycrow 1421
			this->packageCreationWizardToolStripMenuItem->Text = L"Package Creation Wizard";
1422
			this->packageCreationWizardToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::packageCreationWizardToolStripMenuItem_Click);
1423
			// 
1424
			// openToolStripMenuItem
1425
			// 
1426
			this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
127 cycrow 1427
			this->openToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1428
			this->openToolStripMenuItem->Text = L"&Open Package";
1429
			// 
1430
			// saveToolStripMenuItem
1431
			// 
127 cycrow 1432
			this->saveToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"saveToolStripMenuItem.Image")));
1 cycrow 1433
			this->saveToolStripMenuItem->Name = L"saveToolStripMenuItem";
127 cycrow 1434
			this->saveToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1435
			this->saveToolStripMenuItem->Text = L"&Save";
1436
			this->saveToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveToolStripMenuItem_Click);
1437
			// 
1438
			// saveAsToolStripMenuItem
1439
			// 
127 cycrow 1440
			this->saveAsToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"saveAsToolStripMenuItem.Image")));
1 cycrow 1441
			this->saveAsToolStripMenuItem->Name = L"saveAsToolStripMenuItem";
127 cycrow 1442
			this->saveAsToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1443
			this->saveAsToolStripMenuItem->Text = L"Save &As";
1444
			this->saveAsToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveAsToolStripMenuItem_Click);
1445
			// 
1446
			// toolStripSeparator2
1447
			// 
1448
			this->toolStripSeparator2->Name = L"toolStripSeparator2";
127 cycrow 1449
			this->toolStripSeparator2->Size = System::Drawing::Size(175, 6);
1 cycrow 1450
			// 
1451
			// exitToolStripMenuItem
1452
			// 
127 cycrow 1453
			this->exitToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"exitToolStripMenuItem.Image")));
1 cycrow 1454
			this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
127 cycrow 1455
			this->exitToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1456
			this->exitToolStripMenuItem->Text = L"E&xit";
1457
			this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
1458
			// 
1459
			// windowsToolStripMenuItem
1460
			// 
127 cycrow 1461
			this->windowsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {
1462
				this->layoutToolStripMenuItem,
1463
					this->toolStripSeparator1
1464
			});
1 cycrow 1465
			this->windowsToolStripMenuItem->Name = L"windowsToolStripMenuItem";
127 cycrow 1466
			this->windowsToolStripMenuItem->Size = System::Drawing::Size(82, 24);
1 cycrow 1467
			this->windowsToolStripMenuItem->Text = L"&Windows";
1468
			// 
1469
			// layoutToolStripMenuItem
1470
			// 
127 cycrow 1471
			this->layoutToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {
1472
				this->cascadeToolStripMenuItem,
1473
					this->horizontalToolStripMenuItem, this->verticalToolStripMenuItem
1474
			});
1 cycrow 1475
			this->layoutToolStripMenuItem->Name = L"layoutToolStripMenuItem";
127 cycrow 1476
			this->layoutToolStripMenuItem->Size = System::Drawing::Size(128, 26);
1 cycrow 1477
			this->layoutToolStripMenuItem->Text = L"Layout";
1478
			// 
1479
			// cascadeToolStripMenuItem
1480
			// 
1481
			this->cascadeToolStripMenuItem->Name = L"cascadeToolStripMenuItem";
127 cycrow 1482
			this->cascadeToolStripMenuItem->Size = System::Drawing::Size(182, 26);
1 cycrow 1483
			this->cascadeToolStripMenuItem->Text = L"Cascade";
1484
			this->cascadeToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::cascadeToolStripMenuItem_Click);
1485
			// 
1486
			// horizontalToolStripMenuItem
1487
			// 
1488
			this->horizontalToolStripMenuItem->Name = L"horizontalToolStripMenuItem";
127 cycrow 1489
			this->horizontalToolStripMenuItem->Size = System::Drawing::Size(182, 26);
1 cycrow 1490
			this->horizontalToolStripMenuItem->Text = L"Tile Horizontal";
1491
			this->horizontalToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::horizontalToolStripMenuItem_Click);
1492
			// 
1493
			// verticalToolStripMenuItem
1494
			// 
1495
			this->verticalToolStripMenuItem->Name = L"verticalToolStripMenuItem";
127 cycrow 1496
			this->verticalToolStripMenuItem->Size = System::Drawing::Size(182, 26);
1 cycrow 1497
			this->verticalToolStripMenuItem->Text = L"Tile Vertical";
1498
			this->verticalToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::verticalToolStripMenuItem_Click);
1499
			// 
1500
			// toolStripSeparator1
1501
			// 
1502
			this->toolStripSeparator1->Name = L"toolStripSeparator1";
127 cycrow 1503
			this->toolStripSeparator1->Size = System::Drawing::Size(125, 6);
1 cycrow 1504
			// 
1505
			// settingsToolStripMenuItem
1506
			// 
127 cycrow 1507
			this->settingsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) { this->configToolStripMenuItem });
1 cycrow 1508
			this->settingsToolStripMenuItem->Name = L"settingsToolStripMenuItem";
127 cycrow 1509
			this->settingsToolStripMenuItem->Size = System::Drawing::Size(74, 24);
1 cycrow 1510
			this->settingsToolStripMenuItem->Text = L"Settings";
1511
			// 
1512
			// configToolStripMenuItem
1513
			// 
127 cycrow 1514
			this->configToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"configToolStripMenuItem.Image")));
1 cycrow 1515
			this->configToolStripMenuItem->Name = L"configToolStripMenuItem";
127 cycrow 1516
			this->configToolStripMenuItem->Size = System::Drawing::Size(128, 26);
1 cycrow 1517
			this->configToolStripMenuItem->Text = L"Config";
1518
			this->configToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::configToolStripMenuItem_Click);
1519
			// 
1520
			// toolsToolStripMenuItem
1521
			// 
127 cycrow 1522
			this->toolsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {
1523
				this->modMergeToolStripMenuItem,
1524
					this->modDiffToolStripMenuItem1, this->toolStripSeparator10, this->generatePackageWebListToolStripMenuItem1
1525
			});
1 cycrow 1526
			this->toolsToolStripMenuItem->Name = L"toolsToolStripMenuItem";
127 cycrow 1527
			this->toolsToolStripMenuItem->Size = System::Drawing::Size(56, 24);
1 cycrow 1528
			this->toolsToolStripMenuItem->Text = L"Tools";
1529
			// 
1530
			// modMergeToolStripMenuItem
1531
			// 
127 cycrow 1532
			this->modMergeToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modMergeToolStripMenuItem.Image")));
1 cycrow 1533
			this->modMergeToolStripMenuItem->Name = L"modMergeToolStripMenuItem";
127 cycrow 1534
			this->modMergeToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1535
			this->modMergeToolStripMenuItem->Text = L"Mod Merge";
1536
			this->modMergeToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::modMergeToolStripMenuItem_Click);
1537
			// 
1538
			// modDiffToolStripMenuItem1
1539
			// 
127 cycrow 1540
			this->modDiffToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modDiffToolStripMenuItem1.Image")));
1 cycrow 1541
			this->modDiffToolStripMenuItem1->Name = L"modDiffToolStripMenuItem1";
127 cycrow 1542
			this->modDiffToolStripMenuItem1->Size = System::Drawing::Size(262, 26);
1 cycrow 1543
			this->modDiffToolStripMenuItem1->Text = L"Mod Diff";
1544
			this->modDiffToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::modDiffToolStripMenuItem1_Click);
1545
			// 
1546
			// toolStripSeparator10
1547
			// 
1548
			this->toolStripSeparator10->Name = L"toolStripSeparator10";
127 cycrow 1549
			this->toolStripSeparator10->Size = System::Drawing::Size(259, 6);
1 cycrow 1550
			// 
1551
			// generatePackageWebListToolStripMenuItem1
1552
			// 
127 cycrow 1553
			this->generatePackageWebListToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"generatePackageWebListToolStripMenuItem1.Image")));
1 cycrow 1554
			this->generatePackageWebListToolStripMenuItem1->Name = L"generatePackageWebListToolStripMenuItem1";
127 cycrow 1555
			this->generatePackageWebListToolStripMenuItem1->Size = System::Drawing::Size(262, 26);
1 cycrow 1556
			this->generatePackageWebListToolStripMenuItem1->Text = L"Generate Package Web List";
1557
			this->generatePackageWebListToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::generatePackageWebListToolStripMenuItem1_Click);
1558
			// 
1559
			// PanelTab
1560
			// 
1561
			this->PanelTab->Controls->Add(this->tabControl1);
1562
			this->PanelTab->Controls->Add(this->button1);
1563
			this->PanelTab->Dock = System::Windows::Forms::DockStyle::Top;
127 cycrow 1564
			this->PanelTab->Location = System::Drawing::Point(0, 67);
1565
			this->PanelTab->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1566
			this->PanelTab->Name = L"PanelTab";
127 cycrow 1567
			this->PanelTab->Size = System::Drawing::Size(996, 33);
1 cycrow 1568
			this->PanelTab->TabIndex = 6;
1569
			// 
1570
			// tabControl1
1571
			// 
1572
			this->tabControl1->Dock = System::Windows::Forms::DockStyle::Fill;
1573
			this->tabControl1->ImageList = this->imageList1;
1574
			this->tabControl1->Location = System::Drawing::Point(0, 0);
127 cycrow 1575
			this->tabControl1->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1576
			this->tabControl1->Name = L"tabControl1";
1577
			this->tabControl1->SelectedIndex = 0;
127 cycrow 1578
			this->tabControl1->Size = System::Drawing::Size(968, 33);
1 cycrow 1579
			this->tabControl1->TabIndex = 3;
1580
			this->tabControl1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::tabControl1_SelectedIndexChanged_1);
1581
			// 
1582
			// imageList1
1583
			// 
127 cycrow 1584
			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageList1.ImageStream")));
1 cycrow 1585
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
1586
			this->imageList1->Images->SetKeyName(0, L"standard");
1587
			this->imageList1->Images->SetKeyName(1, L"ship");
1588
			this->imageList1->Images->SetKeyName(2, L"fake");
1589
			this->imageList1->Images->SetKeyName(3, L"library");
1590
			this->imageList1->Images->SetKeyName(4, L"multi");
1591
			this->imageList1->Images->SetKeyName(5, L"normal");
1592
			this->imageList1->Images->SetKeyName(6, L"update");
1593
			this->imageList1->Images->SetKeyName(7, L"patch");
1594
			this->imageList1->Images->SetKeyName(8, L"start");
1595
			// 
1596
			// button1
1597
			// 
1598
			this->button1->Dock = System::Windows::Forms::DockStyle::Right;
127 cycrow 1599
			this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
1 cycrow 1600
				static_cast<System::Byte>(0)));
1601
			this->button1->ForeColor = System::Drawing::Color::Red;
127 cycrow 1602
			this->button1->Location = System::Drawing::Point(968, 0);
1603
			this->button1->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1604
			this->button1->Name = L"button1";
127 cycrow 1605
			this->button1->Size = System::Drawing::Size(28, 33);
1 cycrow 1606
			this->button1->TabIndex = 4;
1607
			this->button1->Text = L"X";
1608
			this->button1->UseVisualStyleBackColor = true;
1609
			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
1610
			// 
1611
			// toolStrip1
1612
			// 
1613
			this->toolStrip1->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
1614
			this->toolStrip1->ImageScalingSize = System::Drawing::Size(32, 32);
127 cycrow 1615
			this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(6) {
1616
				this->toolStripButton1,
1617
					this->toolStripSplitButton1, this->toolStripSeparator3, this->toolStripButton2, this->toolStripSeparator8, this->toolStripDropDownButton1
1618
			});
1 cycrow 1619
			this->toolStrip1->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::HorizontalStackWithOverflow;
127 cycrow 1620
			this->toolStrip1->Location = System::Drawing::Point(0, 28);
1 cycrow 1621
			this->toolStrip1->Name = L"toolStrip1";
127 cycrow 1622
			this->toolStrip1->Size = System::Drawing::Size(996, 39);
1 cycrow 1623
			this->toolStrip1->TabIndex = 7;
1624
			this->toolStrip1->Text = L"toolStrip1";
1625
			// 
1626
			// toolStripButton1
1627
			// 
127 cycrow 1628
			this->toolStripButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(10) {
1629
				this->packageToolStripMenuItem1,
1630
					this->shipToolStripMenuItem1, this->multiPackageToolStripMenuItem, this->toolStripSeparator4, this->fromPackagerScriptToolStripMenuItem,
1631
					this->fromArchiveToolStripMenuItem, this->importShipFromModToolStripMenuItem, this->importShipFromVFSToolStripMenuItem, this->toolStripSeparator7,
1632
					this->packageCreationWizardToolStripMenuItem1
1633
			});
1634
			this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton1.Image")));
1 cycrow 1635
			this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1636
			this->toolStripButton1->Name = L"toolStripButton1";
127 cycrow 1637
			this->toolStripButton1->Size = System::Drawing::Size(85, 36);
1 cycrow 1638
			this->toolStripButton1->Text = L"New";
1639
			// 
1640
			// packageToolStripMenuItem1
1641
			// 
127 cycrow 1642
			this->packageToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageToolStripMenuItem1.Image")));
1 cycrow 1643
			this->packageToolStripMenuItem1->Name = L"packageToolStripMenuItem1";
127 cycrow 1644
			this->packageToolStripMenuItem1->Size = System::Drawing::Size(261, 38);
1 cycrow 1645
			this->packageToolStripMenuItem1->Text = L"Package";
1646
			this->packageToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::packageToolStripMenuItem1_Click);
1647
			// 
1648
			// shipToolStripMenuItem1
1649
			// 
1650
			this->shipToolStripMenuItem1->Name = L"shipToolStripMenuItem1";
127 cycrow 1651
			this->shipToolStripMenuItem1->Size = System::Drawing::Size(261, 38);
1 cycrow 1652
			this->shipToolStripMenuItem1->Text = L"Ship";
1653
			this->shipToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::shipToolStripMenuItem1_Click);
1654
			// 
1655
			// multiPackageToolStripMenuItem
1656
			// 
1657
			this->multiPackageToolStripMenuItem->Name = L"multiPackageToolStripMenuItem";
127 cycrow 1658
			this->multiPackageToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1659
			this->multiPackageToolStripMenuItem->Text = L"Multi Package";
1660
			this->multiPackageToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::multiPackageToolStripMenuItem_Click);
1661
			// 
1662
			// toolStripSeparator4
1663
			// 
1664
			this->toolStripSeparator4->Name = L"toolStripSeparator4";
127 cycrow 1665
			this->toolStripSeparator4->Size = System::Drawing::Size(258, 6);
1 cycrow 1666
			// 
1667
			// fromPackagerScriptToolStripMenuItem
1668
			// 
127 cycrow 1669
			this->fromPackagerScriptToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fromPackagerScriptToolStripMenuItem.Image")));
1 cycrow 1670
			this->fromPackagerScriptToolStripMenuItem->Name = L"fromPackagerScriptToolStripMenuItem";
127 cycrow 1671
			this->fromPackagerScriptToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1672
			this->fromPackagerScriptToolStripMenuItem->Text = L"From Packager Script";
1673
			this->fromPackagerScriptToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::fromPackagerScriptToolStripMenuItem_Click);
1674
			// 
1675
			// fromArchiveToolStripMenuItem
1676
			// 
127 cycrow 1677
			this->fromArchiveToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fromArchiveToolStripMenuItem.Image")));
1 cycrow 1678
			this->fromArchiveToolStripMenuItem->Name = L"fromArchiveToolStripMenuItem";
127 cycrow 1679
			this->fromArchiveToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1680
			this->fromArchiveToolStripMenuItem->Text = L"From Archive";
1681
			this->fromArchiveToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::fromArchiveToolStripMenuItem_Click);
1682
			// 
1683
			// importShipFromModToolStripMenuItem
1684
			// 
127 cycrow 1685
			this->importShipFromModToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"importShipFromModToolStripMenuItem.Image")));
1 cycrow 1686
			this->importShipFromModToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
1687
			this->importShipFromModToolStripMenuItem->Name = L"importShipFromModToolStripMenuItem";
127 cycrow 1688
			this->importShipFromModToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1689
			this->importShipFromModToolStripMenuItem->Text = L"Import Ship From Mod";
1690
			this->importShipFromModToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::importShipFromModToolStripMenuItem_Click);
1691
			// 
107 cycrow 1692
			// importShipFromVFSToolStripMenuItem
1693
			// 
1694
			this->importShipFromVFSToolStripMenuItem->Name = L"importShipFromVFSToolStripMenuItem";
127 cycrow 1695
			this->importShipFromVFSToolStripMenuItem->Size = System::Drawing::Size(261, 38);
107 cycrow 1696
			this->importShipFromVFSToolStripMenuItem->Text = L"Import Ship from VFS";
1697
			this->importShipFromVFSToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::importShipFromVFSToolStripMenuItem_Click);
1698
			// 
1 cycrow 1699
			// toolStripSeparator7
1700
			// 
1701
			this->toolStripSeparator7->Name = L"toolStripSeparator7";
127 cycrow 1702
			this->toolStripSeparator7->Size = System::Drawing::Size(258, 6);
1 cycrow 1703
			// 
1704
			// packageCreationWizardToolStripMenuItem1
1705
			// 
127 cycrow 1706
			this->packageCreationWizardToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageCreationWizardToolStripMenuItem1.Image")));
1 cycrow 1707
			this->packageCreationWizardToolStripMenuItem1->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
1708
			this->packageCreationWizardToolStripMenuItem1->Name = L"packageCreationWizardToolStripMenuItem1";
127 cycrow 1709
			this->packageCreationWizardToolStripMenuItem1->Size = System::Drawing::Size(261, 38);
1 cycrow 1710
			this->packageCreationWizardToolStripMenuItem1->Text = L"Package Creation Wizard";
1711
			this->packageCreationWizardToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::packageCreationWizardToolStripMenuItem1_Click);
1712
			// 
1713
			// toolStripSplitButton1
1714
			// 
127 cycrow 1715
			this->toolStripSplitButton1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripSplitButton1.Image")));
1 cycrow 1716
			this->toolStripSplitButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1717
			this->toolStripSplitButton1->Name = L"toolStripSplitButton1";
1718
			this->toolStripSplitButton1->RightToLeft = System::Windows::Forms::RightToLeft::No;
127 cycrow 1719
			this->toolStripSplitButton1->Size = System::Drawing::Size(96, 36);
1 cycrow 1720
			this->toolStripSplitButton1->Text = L"Open";
1721
			this->toolStripSplitButton1->ToolTipText = L"Open an existing package/ship";
1722
			this->toolStripSplitButton1->ButtonClick += gcnew System::EventHandler(this, &Form1::toolStripSplitButton1_ButtonClick);
1723
			// 
1724
			// toolStripSeparator3
1725
			// 
1726
			this->toolStripSeparator3->Name = L"toolStripSeparator3";
1727
			this->toolStripSeparator3->Size = System::Drawing::Size(6, 39);
1728
			// 
1729
			// toolStripButton2
1730
			// 
1731
			this->toolStripButton2->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
127 cycrow 1732
			this->toolStripButton2->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton2.Image")));
1 cycrow 1733
			this->toolStripButton2->ImageTransparentColor = System::Drawing::Color::Magenta;
1734
			this->toolStripButton2->Name = L"toolStripButton2";
1735
			this->toolStripButton2->Size = System::Drawing::Size(36, 36);
1736
			this->toolStripButton2->Text = L"toolStripButton2";
1737
			this->toolStripButton2->ToolTipText = L"Open the options menu";
1738
			this->toolStripButton2->Click += gcnew System::EventHandler(this, &Form1::toolStripButton2_Click);
1739
			// 
1740
			// toolStripSeparator8
1741
			// 
1742
			this->toolStripSeparator8->Name = L"toolStripSeparator8";
1743
			this->toolStripSeparator8->Size = System::Drawing::Size(6, 39);
1744
			// 
1745
			// toolStripDropDownButton1
1746
			// 
127 cycrow 1747
			this->toolStripDropDownButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(7) {
1748
				this->modMergeToolStripMenuItem1,
1749
					this->modDiffToolStripMenuItem, this->toolStripSeparator9, this->generatePackageWebListToolStripMenuItem, this->generatePackageUpdatesToolStripMenuItem,
1750
					this->toolStripSeparator11, this->fileExplorerToolStripMenuItem
1751
			});
1752
			this->toolStripDropDownButton1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripDropDownButton1.Image")));
1 cycrow 1753
			this->toolStripDropDownButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1754
			this->toolStripDropDownButton1->Name = L"toolStripDropDownButton1";
127 cycrow 1755
			this->toolStripDropDownButton1->Size = System::Drawing::Size(90, 36);
1 cycrow 1756
			this->toolStripDropDownButton1->Text = L"Tools";
1757
			// 
1758
			// modMergeToolStripMenuItem1
1759
			// 
127 cycrow 1760
			this->modMergeToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modMergeToolStripMenuItem1.Image")));
1 cycrow 1761
			this->modMergeToolStripMenuItem1->Name = L"modMergeToolStripMenuItem1";
127 cycrow 1762
			this->modMergeToolStripMenuItem1->Size = System::Drawing::Size(262, 26);
1 cycrow 1763
			this->modMergeToolStripMenuItem1->Text = L"Mod Merge";
1764
			this->modMergeToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::modMergeToolStripMenuItem1_Click);
1765
			// 
1766
			// modDiffToolStripMenuItem
1767
			// 
127 cycrow 1768
			this->modDiffToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modDiffToolStripMenuItem.Image")));
1 cycrow 1769
			this->modDiffToolStripMenuItem->Name = L"modDiffToolStripMenuItem";
127 cycrow 1770
			this->modDiffToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1771
			this->modDiffToolStripMenuItem->Text = L"Mod Diff";
1772
			this->modDiffToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::modDiffToolStripMenuItem_Click);
1773
			// 
1774
			// toolStripSeparator9
1775
			// 
1776
			this->toolStripSeparator9->Name = L"toolStripSeparator9";
127 cycrow 1777
			this->toolStripSeparator9->Size = System::Drawing::Size(259, 6);
1 cycrow 1778
			// 
1779
			// generatePackageWebListToolStripMenuItem
1780
			// 
127 cycrow 1781
			this->generatePackageWebListToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"generatePackageWebListToolStripMenuItem.Image")));
1 cycrow 1782
			this->generatePackageWebListToolStripMenuItem->Name = L"generatePackageWebListToolStripMenuItem";
127 cycrow 1783
			this->generatePackageWebListToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1784
			this->generatePackageWebListToolStripMenuItem->Text = L"Generate Package Web List";
1785
			this->generatePackageWebListToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::generatePackageWebListToolStripMenuItem_Click);
1786
			// 
1787
			// generatePackageUpdatesToolStripMenuItem
1788
			// 
127 cycrow 1789
			this->generatePackageUpdatesToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"generatePackageUpdatesToolStripMenuItem.Image")));
1 cycrow 1790
			this->generatePackageUpdatesToolStripMenuItem->Name = L"generatePackageUpdatesToolStripMenuItem";
127 cycrow 1791
			this->generatePackageUpdatesToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1792
			this->generatePackageUpdatesToolStripMenuItem->Text = L"Generate Package Updates";
1793
			this->generatePackageUpdatesToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::generatePackageUpdatesToolStripMenuItem_Click);
1794
			// 
1795
			// toolStripSeparator11
1796
			// 
1797
			this->toolStripSeparator11->Name = L"toolStripSeparator11";
127 cycrow 1798
			this->toolStripSeparator11->Size = System::Drawing::Size(259, 6);
1 cycrow 1799
			// 
1800
			// fileExplorerToolStripMenuItem
1801
			// 
127 cycrow 1802
			this->fileExplorerToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fileExplorerToolStripMenuItem.Image")));
1 cycrow 1803
			this->fileExplorerToolStripMenuItem->Name = L"fileExplorerToolStripMenuItem";
127 cycrow 1804
			this->fileExplorerToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1805
			this->fileExplorerToolStripMenuItem->Text = L"File Explorer";
1806
			this->fileExplorerToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::fileExplorerToolStripMenuItem_Click);
1807
			// 
1808
			// timer1
1809
			// 
1810
			this->timer1->Enabled = true;
1811
			this->timer1->Interval = 500;
1812
			this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
1813
			// 
1814
			// statusStrip1
1815
			// 
127 cycrow 1816
			this->statusStrip1->ImageScalingSize = System::Drawing::Size(20, 20);
1817
			this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) { this->StatusFiles });
1818
			this->statusStrip1->Location = System::Drawing::Point(0, 832);
1 cycrow 1819
			this->statusStrip1->Name = L"statusStrip1";
127 cycrow 1820
			this->statusStrip1->Padding = System::Windows::Forms::Padding(1, 0, 19, 0);
1821
			this->statusStrip1->Size = System::Drawing::Size(996, 25);
1 cycrow 1822
			this->statusStrip1->TabIndex = 9;
1823
			this->statusStrip1->Text = L"statusStrip1";
1824
			// 
1825
			// StatusFiles
1826
			// 
1827
			this->StatusFiles->Name = L"StatusFiles";
127 cycrow 1828
			this->StatusFiles->Size = System::Drawing::Size(101, 20);
1 cycrow 1829
			this->StatusFiles->Text = L"Files: 1 (10KB)";
1830
			// 
1831
			// imageListGames
1832
			// 
127 cycrow 1833
			this->imageListGames->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListGames.ImageStream")));
1 cycrow 1834
			this->imageListGames->TransparentColor = System::Drawing::Color::Transparent;
1835
			this->imageListGames->Images->SetKeyName(0, L"X2");
1836
			this->imageListGames->Images->SetKeyName(1, L"X3");
1837
			this->imageListGames->Images->SetKeyName(2, L"X3TC");
1838
			this->imageListGames->Images->SetKeyName(3, L"X3AP");
127 cycrow 1839
			this->imageListGames->Images->SetKeyName(4, L"X3FL");
1 cycrow 1840
			// 
1841
			// toolTip1
1842
			// 
1843
			this->toolTip1->AutomaticDelay = 1000;
1844
			this->toolTip1->IsBalloon = true;
1845
			this->toolTip1->ToolTipIcon = System::Windows::Forms::ToolTipIcon::Info;
1846
			this->toolTip1->ToolTipTitle = L"Close All Windows";
1847
			// 
1848
			// imageListSmall
1849
			// 
127 cycrow 1850
			this->imageListSmall->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListSmall.ImageStream")));
1 cycrow 1851
			this->imageListSmall->TransparentColor = System::Drawing::Color::Transparent;
1852
			this->imageListSmall->Images->SetKeyName(0, L"language");
1853
			this->imageListSmall->Images->SetKeyName(1, L"web");
1854
			this->imageListSmall->Images->SetKeyName(2, L"ware");
1855
			this->imageListSmall->Images->SetKeyName(3, L"components");
1856
			this->imageListSmall->Images->SetKeyName(4, L"dummies");
1857
			this->imageListSmall->Images->SetKeyName(5, L"cockpit");
1858
			this->imageListSmall->Images->SetKeyName(6, L"cutdata");
1859
			this->imageListSmall->Images->SetKeyName(7, L"bodies");
1860
			this->imageListSmall->Images->SetKeyName(8, L"animations");
1861
			this->imageListSmall->Images->SetKeyName(9, L"turret");
1862
			this->imageListSmall->Images->SetKeyName(10, L"gun");
1863
			// 
1864
			// imageListLarge
1865
			// 
127 cycrow 1866
			this->imageListLarge->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListLarge.ImageStream")));
1 cycrow 1867
			this->imageListLarge->TransparentColor = System::Drawing::Color::Transparent;
1868
			this->imageListLarge->Images->SetKeyName(0, L"language");
1869
			this->imageListLarge->Images->SetKeyName(1, L"web");
1870
			this->imageListLarge->Images->SetKeyName(2, L"ware");
1871
			this->imageListLarge->Images->SetKeyName(3, L"turret");
1872
			this->imageListLarge->Images->SetKeyName(4, L"gun");
1873
			// 
1874
			// imageListFiles
1875
			// 
127 cycrow 1876
			this->imageListFiles->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListFiles.ImageStream")));
1 cycrow 1877
			this->imageListFiles->TransparentColor = System::Drawing::Color::Transparent;
1878
			this->imageListFiles->Images->SetKeyName(0, L"script.png");
1879
			this->imageListFiles->Images->SetKeyName(1, L"textfile.png");
1880
			this->imageListFiles->Images->SetKeyName(2, L"readme.png");
1881
			this->imageListFiles->Images->SetKeyName(3, L"map.png");
1882
			this->imageListFiles->Images->SetKeyName(4, L"mods.png");
1883
			this->imageListFiles->Images->SetKeyName(5, L"uninstall.png");
1884
			this->imageListFiles->Images->SetKeyName(6, L"sound.png");
1885
			this->imageListFiles->Images->SetKeyName(7, L"extras.png");
1886
			this->imageListFiles->Images->SetKeyName(8, L"screenshot.png");
1887
			this->imageListFiles->Images->SetKeyName(9, L"mission.png");
1888
			this->imageListFiles->Images->SetKeyName(10, L"advert.png");
1889
			this->imageListFiles->Images->SetKeyName(11, L"shipother.png");
1890
			this->imageListFiles->Images->SetKeyName(12, L"shipmodel.png");
1891
			this->imageListFiles->Images->SetKeyName(13, L"shipscene.png");
1892
			this->imageListFiles->Images->SetKeyName(14, L"cockpitscene.png");
1893
			this->imageListFiles->Images->SetKeyName(15, L"package");
1894
			this->imageListFiles->Images->SetKeyName(16, L"backup.png");
1895
			this->imageListFiles->Images->SetKeyName(17, L"fakepatch");
1896
			// 
1897
			// backgroundWorker1
1898
			// 
1899
			this->backgroundWorker1->WorkerReportsProgress = true;
1900
			this->backgroundWorker1->WorkerSupportsCancellation = true;
1901
			this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &Form1::backgroundWorker1_DoWork);
1902
			this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &Form1::backgroundWorker1_RunWorkerCompleted);
1903
			// 
1904
			// Form1
1905
			// 
1906
			this->AllowDrop = true;
127 cycrow 1907
			this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
1 cycrow 1908
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
127 cycrow 1909
			this->ClientSize = System::Drawing::Size(996, 857);
1 cycrow 1910
			this->Controls->Add(this->statusStrip1);
1911
			this->Controls->Add(this->PanelTab);
1912
			this->Controls->Add(this->toolStrip1);
1913
			this->Controls->Add(this->menuStrip1);
127 cycrow 1914
			this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
1 cycrow 1915
			this->IsMdiContainer = true;
1916
			this->MainMenuStrip = this->menuStrip1;
127 cycrow 1917
			this->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1918
			this->Name = L"Form1";
1919
			this->Text = L"Package Creator";
127 cycrow 1920
			this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
1 cycrow 1921
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
1922
			this->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragDrop);
1923
			this->DragOver += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragOver);
1924
			this->menuStrip1->ResumeLayout(false);
1925
			this->menuStrip1->PerformLayout();
1926
			this->PanelTab->ResumeLayout(false);
1927
			this->toolStrip1->ResumeLayout(false);
1928
			this->toolStrip1->PerformLayout();
1929
			this->statusStrip1->ResumeLayout(false);
1930
			this->statusStrip1->PerformLayout();
1931
			this->ResumeLayout(false);
1932
			this->PerformLayout();
1933
 
1934
		}
1935
#pragma endregion
1936
	private: System::Void cascadeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1937
				 this->LayoutMdi(MdiLayout::Cascade);
1938
			 }
1939
private: System::Void horizontalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1940
			 this->LayoutMdi(MdiLayout::TileHorizontal);
1941
		 }
1942
private: System::Void verticalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1943
			 this->LayoutMdi(MdiLayout::TileVertical);
1944
		 }
1945
private: System::Void tabControl1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
1946
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1947
			 for ( int i = 0; i < children->Length; i++ )
1948
			 {
1949
				 BaseForm ^childForm = (BaseForm ^)children[i];
1950
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
1951
				 {
1952
					 childForm->Select();
1953
					 break;
1954
				 }
1955
			 }
1956
 
1957
		 }
1958
private: System::Void packageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1959
			 this->NewPackage(false);
1960
		 }
1961
private: System::Void shipToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1962
			 this->NewPackage(true);
1963
		 }
1964
private: System::Void exitToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1965
			 this->Close();
1966
		 }
1967
private: System::Void saveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1968
			 this->Save();
1969
		 }
1970
private: System::Void saveAsToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1971
			 this->SaveAs();
1972
		 }
1973
private: System::Void Event_Open(System::Object^  sender, System::EventArgs^  e) {
1974
			System::Windows::Forms::ToolStripMenuItem ^item = cli::safe_cast<System::Windows::Forms::ToolStripMenuItem ^>(sender);
1975
			if ( item->Tag == "$PACKAGE" )
1976
				this->Open();
1977
			else if ( item->Tag == "$DIR" )
1978
			{
1979
				FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
1980
				fbd->Description = "Select the path to load all valid files from";
1981
				if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
1982
					this->OpenDirectory(fbd->SelectedPath);
1983
			}
1984
			else
1985
			{
1986
				this->Open(cli::safe_cast<System::String ^>(item->Tag), true, false);
1987
			}
1988
		}
1989
 
1990
private: System::Void openPackageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1991
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
1992
			ofd->Filter = "All (*.spk *.xsp)|*.spk;*.xsp|Package Files (*.spk)|*.spk|Ship Files (*.xsp)|*.xsp";
1993
			ofd->FilterIndex = 1;
1994
			ofd->RestoreDirectory = true;
1995
			ofd->Multiselect = true;
1996
 
1997
			if ( ofd->ShowDialog() == System::Windows::Forms::DialogResult::OK )
1998
				this->OpenFiles(ofd->FileNames, false, true);
1999
		 }
2000
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
2001
				 this->CloseAll();
2002
			 }
2003
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
2004
			 if ( m_bAutoClose )
2005
				 this->Close();
2006
			 if ( m_iLocX != -1 && m_iLocY != -1 )
2007
				this->Location = System::Drawing::Point(m_iLocX, m_iLocY);
2008
			this->UpdateDropDownOpen();
2009
		 }
2010
private: System::Void toolStripSplitButton1_ButtonClick(System::Object^  sender, System::EventArgs^  e) {
2011
			 this->Open();
2012
		 }
2013
private: System::Void packageToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2014
			 this->NewPackage(false);
2015
		 }
2016
private: System::Void shipToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2017
			 this->NewPackage(true);
2018
		 }
2019
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
2020
			 if ( IO::File::Exists(IO::Path::GetTempPath() + "\\creator_load.dat") )
2021
				 this->LoadFiles(IO::Path::GetTempPath() + "\\creator_load.dat");
2022
		 }
2023
private: System::Void tabControl1_SelectedIndexChanged_1(System::Object^  sender, System::EventArgs^  e) {
2024
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
2025
			 for ( int i = 0; i < children->Length; i++ )
2026
			 {
2027
				 BaseForm ^childForm = (BaseForm ^)children[i];
2028
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
2029
				 {
2030
					 childForm->Select();
2031
					 break;
2032
				 }
2033
			 }
2034
		 }
2035
private: System::Void configToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2036
			 this->OpenOptionsMenu();
2037
		 }
2038
private: System::Void toolStripButton2_Click(System::Object^  sender, System::EventArgs^  e) {
2039
			 this->OpenOptionsMenu();
2040
		 }
2041
private: System::Void fromPackagerScriptToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2042
			 this->OpenPackagerScript();
2043
		 }
2044
private: System::Void fromPackagerScriptToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2045
			 this->OpenPackagerScript();
2046
		 }
2047
private: System::Void Form1_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
2048
			e->Effect = DragDropEffects::None;
2049
 
2050
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
2051
			{
2052
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
2053
				int i;
2054
				for(i = 0; i < a->Length; i++)
2055
				{
2056
					if ( String::Compare(IO::FileInfo(a[i]).Extension, ".xsp", true) == 0 || String::Compare(IO::FileInfo(a[i]).Extension, ".spk", true) == 0 )
2057
					{
2058
						e->Effect = DragDropEffects::Copy;
2059
						break;
2060
					}
2061
				}
2062
			}
2063
		 }
2064
private: System::Void Form1_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
2065
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
2066
			{
2067
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
2068
				this->OpenFiles(a, true, true);
2069
			}
2070
		 }
2071
private: System::Void importShipFromModToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2072
			 this->ImportShip();
2073
		 }
2074
private: System::Void importShipFromModToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2075
			 this->ImportShip();
2076
		 }
2077
private: System::Void Form1_FormClosing(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e) {
2078
			 this->CloseAll();
2079
			 e->Cancel = false;
2080
		 }
2081
private: System::Void packageCreationWizardToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2082
			 this->PackageCreationWizard();
2083
		 }
2084
private: System::Void packageCreationWizardToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2085
			 this->PackageCreationWizard();
2086
		 }
2087
private: System::Void multiPackageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2088
			 this->NewMultiPackage();
2089
		 }
2090
private: System::Void modMergeToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2091
			 ModMerge();
2092
		 }
2093
private: System::Void modMergeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2094
			 ModMerge();
2095
		 }
2096
private: System::Void modDiffToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2097
			 ModDiffDialog();
2098
		 }
2099
private: System::Void modDiffToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2100
			 ModDiffDialog();
2101
		 }
2102
private: System::Void generatePackageWebListToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2103
			 GeneratePackageWebList();
2104
		 }
2105
private: System::Void generatePackageWebListToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2106
			 GeneratePackageWebList();
2107
		 }
2108
private: System::Void fromArchiveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2109
			 OpenArchive();
2110
		 }
2111
private: System::Void backgroundWorker1_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
2112
			 Threading::Thread::Sleep(500);
224 cycrow 2113
			 m_pConverted = m_pPackages->createFromArchive(_WS(m_sConvertFile));
1 cycrow 2114
		 }
2115
private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^  sender, System::ComponentModel::RunWorkerCompletedEventArgs^  e) {
2116
			 if ( m_pWait ) 
2117
			 {
2118
				 m_pWait->Close();
2119
				 delete m_pWait;
2120
				 m_pWait = nullptr;
2121
			}
2122
 
2123
			 if ( !m_pConverted )
2124
				MessageBox::Show(this, "Unable to open archive file, " + m_sConvertFile, "Unable to open", MessageBoxButtons::OK, MessageBoxIcon::Error);
2125
			 else
2126
			 {
2127
				PackageForm ^childForm = this->OpenPackage(true, m_pConverted, m_sConvertFile, "");
50 cycrow 2128
				childForm->Text = _US(m_pConverted->filename());
1 cycrow 2129
			 }
2130
		 }
2131
private: System::Void generatePackageUpdatesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2132
			 GeneratePackageUpdates();
2133
		 }
2134
private: System::Void fileExplorerToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2135
			 OpenFileExplorer();
2136
		 }
36 cycrow 2137
private: System::Void importShipFromVFSToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2138
			 ImportShipFromVFS();
2139
		 }
107 cycrow 2140
private: System::Void multiPackageToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2141
			 this->NewMultiPackage();
2142
		 }
2143
private: System::Void importShipFromVFSToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2144
			 ImportShipFromVFS();
2145
		 }
2146
private: System::Void fromArchiveToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2147
			 OpenArchive();
2148
		 }
1 cycrow 2149
};
2150
}
2151