Subversion Repositories spk

Rev

Rev 191 | Rev 197 | Go to most recent revision | 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
			{
96
				pos = t->IndexOf('{', pos);
97
				found = false;
98
				if ( pos > -1 )
99
				{
100
					int page = -1;
101
					int id = -1;
102
 
103
					int commaPos = t->IndexOf(',', pos);
104
					if ( commaPos > -1 )
105
					{
106
						page = Convert::ToInt32(t->Substring(pos + 1, commaPos - (pos + 1)));
107
						int endPos = t->IndexOf('}', commaPos);
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
 
94 cycrow 134
			Utils::String text = _pGameDir->findText(game, 44, page, id);
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;
231
		CyStringList	*m_pLoadedList;
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
 
440
							if ( first.Compare("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
		{
182 cycrow 455
			Utils::String sFile = _S(file);
1 cycrow 456
			int error = 0;
457
 
182 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 ) {
196 cycrow 480
						exportFilename = CFileIO(exportFilename).dir() + L"/" + CFileIO(exportFilename).baseName() + L"_" + CBaseFile::ConvertGameToString(game).toWString() + L".zip";
1 cycrow 481
					}
196 cycrow 482
					if ( p->saveToArchive(exportFilename.toString(), game, m_pPackages->GetGameExe())) {
102 cycrow 483
						String ^message = "Export: " + file + "\nTo: " + _US(CFileIO(exportFilename).filename());
1 cycrow 484
						if ( game ) {
191 cycrow 485
							message += "\nGame: " + _US(m_pPackages->GetGameExe()->GetGame(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
		{
129 cycrow 497
			Utils::String sFile = _S(file);
1 cycrow 498
			int error = 0;
499
 
182 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
					{
533
						if (m_pPackages->extractAll(p, _S(to), game, true)) 
534
						{
1 cycrow 535
							String ^message = "Extracted: " + file + "\nTo: " + to;
129 cycrow 536
							if ( game )
537
								message += "\nGame: " + _US(m_pPackages->GetGameExe()->GetGame(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);
131 cycrow 550
			Utils::CStringList malformed, unknown;
196 cycrow 551
			CBaseFile *package = m_pPackages->LoadPackagerScript(sFile.toString(), -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
196 cycrow 564
				if ( package->writeFile(saveto.toString()) ) {
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();
196 cycrow 573
						if ( package->saveToArchive(exportto.toString(), 0, m_pPackages->GetGameExe())) {
102 cycrow 574
							message += "\nExported to:\n" + _US(exportto) + "\n";
1 cycrow 575
							if ( package->IsAnyGameInPackage() ) {
576
								for ( int i = 0; i < m_pPackages->GetGameExe()->GetNumGames(); i++ ) {
577
									if ( package->IsGameInPackage(i + 1) ) {
196 cycrow 578
										Utils::WString exportFile = CFileIO(saveto).dir() + L"/" + CFileIO(saveto).baseName() + L"_" + CBaseFile::ConvertGameToString(i + 1).toWString() + L"." + CFileIO(exportto).extension();
579
										if ( package->saveToArchive(exportFile.toString(), 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
		{
131 cycrow 596
			Utils::CStringList malformed, unknown;
597
			CBaseFile *package = m_pPackages->LoadPackagerScript(_S(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
		{
620
			CyString sFile = CyStringFromSystemString(file);
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
		{
185 cycrow 643
			Utils::String sFile = _S(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();
196 cycrow 650
					Utils::WString sIconFile = _WS(IO::Path::GetTempPath()) + L"\\" + CFileIO(sFile).baseName() + L"." + package->iconExt().toWString();
651
					if ( package->extractFile(package->icon(), CFileIO(sIconFile).fullFilename().toString(), 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
					{
134 cycrow 721
						Utils::String file = _S(Files[i]);
1 cycrow 722
						int error = 0;
182 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
			{
126 cycrow 747
				Utils::CStringList 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
					{
126 cycrow 760
						Utils::String file = _S(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
				{
126 cycrow 775
					CFileIO File(_S(fbd->SelectedPath) + "/xpackagedata.dat");
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;
175 cycrow 816
			Utils::String sFile = _S(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;
39 cycrow 832
					loaded = shipFile->ConvertOld(_S(file));
1 cycrow 833
					if ( loaded )
834
					{
50 cycrow 835
						shipFile->adjustChanged(true);
836
						shipFile->setFilename(_S(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
				{
844
					CSpkFile *spkFile = CSpkFile::convertFromOld(CyStringFromSystemString(file).ToString());
845
					if ( spkFile ) {
846
						loaded = true;
50 cycrow 847
						spkFile->adjustChanged(true);
848
						spkFile->setFilename(_S(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
			{
182 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
			{
182 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
175 cycrow 893
				sFile = sFile.findReplace("/", "\\").remove(9).remove('\r').remove('\n');
1 cycrow 894
				m_pLoadedList->Remove(sFile, true);
175 cycrow 895
				m_pLoadedList->PushFront(CyString(sFile));
1 cycrow 896
 
897
				while ( m_pLoadedList->Count() > 15 )
898
					m_pLoadedList->PopBack();
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;
1013
			for ( SStringList *str = m_pLoadedList->Head(); str; str = str->next )
1014
			{
1015
				// check if we have it open
191 cycrow 1016
				System::String ^sFile = _US(str->str.findreplace("/", "\\").ToString());
1 cycrow 1017
				if ( this->IsOpen(sFile) )
1018
					continue;
191 cycrow 1019
				if ( this->IsOpen(_US(str->str.findreplace("\\", "/").ToString())) )
1 cycrow 1020
					continue;
1021
 
1022
				if ( !IO::File::Exists(sFile) )
1023
					continue;
1024
 
1025
				if ( !sep )
1026
				{
1027
					sep = true;
1028
					this->toolStripSplitButton1->DropDownItems->Add(gcnew System::Windows::Forms::ToolStripSeparator());
1029
					this->openToolStripMenuItem->DropDownItems->Add(gcnew System::Windows::Forms::ToolStripSeparator());
1030
				}
1031
 
1032
				// work out the type
1033
				float fVersion;
1034
				int iconType = -1;
175 cycrow 1035
				int check = CBaseFile::CheckFile(str->str.ToString(), &fVersion);
1 cycrow 1036
				switch ( check )
1037
				{
1038
					case SPKFILE_BASE:
1039
						iconType = 5;
1040
						break;
1041
					case SPKFILE_SINGLE:
1042
						iconType = 0;
1043
						break;
1044
					case SPKFILE_SINGLESHIP:
1045
						iconType = 1;
1046
						break;
1047
					case SPKFILE_MULTI:
1048
						iconType = 4;
1049
						break;
1050
				}
1051
 
1052
				// otherwise add it to the list
1053
				System::Windows::Forms::ToolStripMenuItem ^newItem = gcnew System::Windows::Forms::ToolStripMenuItem;
1054
				newItem->Text = sFile;
1055
				newItem->Tag = newItem->Text;
1056
				newItem->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1057
				if ( iconType > -1 )
1058
					newItem->Image = this->imageList1->Images[iconType];
1059
				this->toolStripSplitButton1->DropDownItems->Add(newItem);
1060
 
1061
				System::Windows::Forms::ToolStripMenuItem ^newItem2 = gcnew System::Windows::Forms::ToolStripMenuItem;
1062
				newItem2->Text = sFile;
1063
				newItem2->Tag = newItem->Text;
1064
				newItem2->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
1065
				if ( iconType > -1 )
1066
					newItem2->Image = this->imageList1->Images[iconType];
1067
				this->openToolStripMenuItem->DropDownItems->Add(newItem2);
1068
			}
1069
		}
1070
 
1071
		bool IsOpen(System::String ^file)
1072
		{
1073
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1074
			 for ( int i = 0; i < children->Length; i++ )
1075
			 {
1076
				 BaseForm ^childForm = (BaseForm ^)children[i];
1077
				 if ( childForm->IsClosing() )
1078
					 continue;
1079
				 if ( childForm->CheckFilename(file) )
1080
					 return true;
1081
			 }
1082
 
1083
			 return false;
1084
		}
1085
 
1086
		void Save()
1087
		{
1088
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1089
			 for ( int i = 0; i < children->Length; i++ )
1090
			 {
1091
				 BaseForm ^childForm = (BaseForm ^)children[i];
1092
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
1093
				 {
1094
					 if ( childForm->GetFormType() == FORMTYPE_SINGLE )
1095
						((PackageForm ^)childForm)->Save();
1096
					 else if ( childForm->GetFormType() == FORMTYPE_MULTI )
1097
						((MultiForm ^)childForm)->Save();
1098
					 else
1099
						childForm->Save();
1100
					 this->UpdateDropDownOpen();
1101
					 break;
1102
				 }
1103
			 }
1104
		}
1105
 
1106
		void SaveAs()
1107
		{
1108
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1109
			 for ( int i = 0; i < children->Length; i++ )
1110
			 {
1111
				 BaseForm ^childForm = (BaseForm ^)children[i];
1112
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
1113
				 {
1114
					 if ( childForm->GetFormType() == FORMTYPE_SINGLE )
1115
						((PackageForm ^)childForm)->SaveAs();
1116
					 else if ( childForm->GetFormType() == FORMTYPE_MULTI )
1117
						((MultiForm ^)childForm)->SaveAs();
1118
					 else
1119
						childForm->SaveAs();
1120
					 this->UpdateDropDownOpen();
1121
					 break;
1122
				 }
1123
			 }
1124
		}
1125
 
1126
		void PackageCreationWizard()
1127
		{
1128
			MessageBox::Show(this, "The creation wizard is currently not available", "Feature Missing", MessageBoxButtons::OK, MessageBoxIcon::Error);
1129
			return;
1130
 
1131
			CreationWizard ^wizard = gcnew CreationWizard();
1132
			if ( wizard->ShowDialog(this) == Windows::Forms::DialogResult::OK )
1133
			{
1134
			}
1135
		}
1136
 
1137
		void SaveData()
1138
		{
1139
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
123 cycrow 1140
			CFileIO Config(_S(mydoc) + "/Egosoft/creator.dat");
1141
			Utils::CStringList lines;
1 cycrow 1142
 
1143
			if ( this->WindowState == FormWindowState::Normal )
1144
			{
123 cycrow 1145
				lines.pushBack(Utils::String("CreatorSize:") + (long)this->Size.Width + " " + (long)this->Size.Height);
1146
				lines.pushBack(Utils::String("CreatorPos:") + (long)this->Location.X + " " + (long)this->Location.Y);
1 cycrow 1147
			}
1148
			else
1149
			{
123 cycrow 1150
				lines.pushBack(Utils::String("CreatorPos:") + (long)this->RestoreBounds.Location.X + " " + (long)this->RestoreBounds.Location.Y);
1151
				lines.pushBack(Utils::String("CreatorSize:") + (long)this->RestoreBounds.Size.Width + " " + (long)this->RestoreBounds.Size.Height);
1 cycrow 1152
			}
1153
 
1154
			if ( this->WindowState == FormWindowState::Maximized )
123 cycrow 1155
				lines.pushBack("CreatorMax:");
1 cycrow 1156
 
1157
			for ( SStringList *str = m_pLoadedList->Head(); str; str = str->next )
123 cycrow 1158
				lines.pushBack(Utils::String("Loaded:") + str->data.ToString() + " " + str->str.ToString());
94 cycrow 1159
			_pGameDir->writeData(&lines);
1 cycrow 1160
			if ( m_settings->bGenerateUpdate )
123 cycrow 1161
				lines.pushBack("GenerateUpdate:");
1 cycrow 1162
 
123 cycrow 1163
			Config.writeFile(&lines);
1 cycrow 1164
		}
1165
 
1166
		void LoadData()
1167
		{
1168
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
1169
			CFileIO Config;
118 cycrow 1170
			if ( Config.open(_S(mydoc) + "/Egosoft/creator.dat") )
1 cycrow 1171
			{
160 cycrow 1172
				std::vector<Utils::String> *lines = Config.readLines();
1 cycrow 1173
				if ( lines )
1174
				{
1175
					for ( int i = 0; i < (int)lines->size(); i++ )
1176
					{
160 cycrow 1177
						Utils::String line(lines->at(i));
1178
						Utils::String start = line.token(":", 1).toLower();
1179
						Utils::String rest = line.tokens(":", 2).removeFirstSpace();
1 cycrow 1180
						if ( start.Compare("CreatorSize") )
160 cycrow 1181
							this->Size = System::Drawing::Size(rest.token(" ", 1).toInt(), rest.token(" ", 2).toInt());
1 cycrow 1182
						else if ( start.Compare("CreatorPos") )
1183
						{
160 cycrow 1184
							m_iLocX = rest.token(" ", 1).toInt();
1185
							m_iLocY = rest.token(" ", 2).toInt();
1 cycrow 1186
						}
1187
						else if ( start.Compare("Loaded") )
160 cycrow 1188
							m_pLoadedList->PushBack(CyString(rest));
1 cycrow 1189
						else if ( start.Compare("CreatorMax") )
1190
							this->WindowState = FormWindowState::Maximized;
1191
						else if ( start.Compare("GenerateUpdate") )
1192
							m_settings->bGenerateUpdate = true;
1193
						else if ( start.Compare("GameDir") )
160 cycrow 1194
							_pGameDir->parse(rest, m_pPackages);
1 cycrow 1195
					}
1196
 
1197
					delete lines;
1198
				}
1199
			}
1200
		}
101 cycrow 1201
 
1202
		void LoadText(bool center, bool reload, CVirtualFileSystem *vfs)
1 cycrow 1203
		{
101 cycrow 1204
			if ( !reload ) {
1205
				// check if the text has been updated
1206
				if ( vfs && vfs->isTextUpdated() ) return;
1207
 
1208
				// check if all text as been updated
1209
				if ( !vfs && _pGameDir->isAllTextLoaded() ) return;
1210
			}
1 cycrow 1211
 
94 cycrow 1212
			if ( _pGameDir->isEmpty() ) return;
1 cycrow 1213
 
101 cycrow 1214
			Creator::LoadText ^load = nullptr;
1215
			if ( vfs ) 
1216
				load = gcnew Creator::LoadText(vfs);
1217
			else 
1218
				load = gcnew Creator::LoadText(_pGameDir, reload);
1219
 
1 cycrow 1220
			if ( center )
1221
				load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
1222
 
1223
			load->ShowDialog(this);
1224
		}
1225
 
1226
 
1227
private: System::ComponentModel::IContainer^  components;
1228
 
1229
 
1230
		/// <summary>
1231
		/// Required designer variable.
1232
		/// </summary>
1233
 
1234
 
1235
#pragma region Windows Form Designer generated code
1236
		/// <summary>
1237
		/// Required method for Designer support - do not modify
1238
		/// the contents of this method with the code editor.
1239
		/// </summary>
1240
		void InitializeComponent(void)
1241
		{
1242
			this->components = (gcnew System::ComponentModel::Container());
1243
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
1244
			this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
1245
			this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1246
			this->newToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1247
			this->packageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1248
			this->shipToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1249
			this->multiPackageToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1250
			this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());
1251
			this->fromPackagerScriptToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1252
			this->fromArchiveToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1253
			this->importShipFromModToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1254
			this->importShipFromVFSToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1255
			this->toolStripSeparator6 = (gcnew System::Windows::Forms::ToolStripSeparator());
1256
			this->packageCreationWizardToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1257
			this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1258
			this->saveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1259
			this->saveAsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1260
			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
1261
			this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1262
			this->windowsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1263
			this->layoutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1264
			this->cascadeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1265
			this->horizontalToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1266
			this->verticalToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1267
			this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
1268
			this->settingsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1269
			this->configToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1270
			this->toolsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1271
			this->modMergeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1272
			this->modDiffToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1273
			this->toolStripSeparator10 = (gcnew System::Windows::Forms::ToolStripSeparator());
1274
			this->generatePackageWebListToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1275
			this->PanelTab = (gcnew System::Windows::Forms::Panel());
1276
			this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
1277
			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
1278
			this->button1 = (gcnew System::Windows::Forms::Button());
1279
			this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
1280
			this->toolStripButton1 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
1281
			this->packageToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1282
			this->shipToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1283
			this->multiPackageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1284
			this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
1285
			this->fromPackagerScriptToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1286
			this->fromArchiveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1287
			this->importShipFromModToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
107 cycrow 1288
			this->importShipFromVFSToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1 cycrow 1289
			this->toolStripSeparator7 = (gcnew System::Windows::Forms::ToolStripSeparator());
1290
			this->packageCreationWizardToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1291
			this->toolStripSplitButton1 = (gcnew System::Windows::Forms::ToolStripSplitButton());
1292
			this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
1293
			this->toolStripButton2 = (gcnew System::Windows::Forms::ToolStripButton());
1294
			this->toolStripSeparator8 = (gcnew System::Windows::Forms::ToolStripSeparator());
1295
			this->toolStripDropDownButton1 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
1296
			this->modMergeToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
1297
			this->modDiffToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1298
			this->toolStripSeparator9 = (gcnew System::Windows::Forms::ToolStripSeparator());
1299
			this->generatePackageWebListToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1300
			this->generatePackageUpdatesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1301
			this->toolStripSeparator11 = (gcnew System::Windows::Forms::ToolStripSeparator());
1302
			this->fileExplorerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1303
			this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
1304
			this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
1305
			this->StatusFiles = (gcnew System::Windows::Forms::ToolStripStatusLabel());
1306
			this->imageListGames = (gcnew System::Windows::Forms::ImageList(this->components));
1307
			this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
1308
			this->imageListSmall = (gcnew System::Windows::Forms::ImageList(this->components));
1309
			this->imageListLarge = (gcnew System::Windows::Forms::ImageList(this->components));
1310
			this->imageListFiles = (gcnew System::Windows::Forms::ImageList(this->components));
1311
			this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
1312
			this->menuStrip1->SuspendLayout();
1313
			this->PanelTab->SuspendLayout();
1314
			this->toolStrip1->SuspendLayout();
1315
			this->statusStrip1->SuspendLayout();
1316
			this->SuspendLayout();
1317
			// 
1318
			// menuStrip1
1319
			// 
127 cycrow 1320
			this->menuStrip1->ImageScalingSize = System::Drawing::Size(20, 20);
1321
			this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {
1322
				this->fileToolStripMenuItem,
1323
					this->windowsToolStripMenuItem, this->settingsToolStripMenuItem, this->toolsToolStripMenuItem
1324
			});
1 cycrow 1325
			this->menuStrip1->Location = System::Drawing::Point(0, 0);
1326
			this->menuStrip1->Name = L"menuStrip1";
127 cycrow 1327
			this->menuStrip1->Padding = System::Windows::Forms::Padding(8, 2, 0, 2);
1328
			this->menuStrip1->Size = System::Drawing::Size(996, 28);
1 cycrow 1329
			this->menuStrip1->TabIndex = 2;
1330
			this->menuStrip1->Text = L"menuStrip1";
1331
			// 
1332
			// fileToolStripMenuItem
1333
			// 
127 cycrow 1334
			this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(6) {
1335
				this->newToolStripMenuItem,
1336
					this->openToolStripMenuItem, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem, this->toolStripSeparator2, this->exitToolStripMenuItem
1337
			});
1 cycrow 1338
			this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
127 cycrow 1339
			this->fileToolStripMenuItem->Size = System::Drawing::Size(44, 24);
1 cycrow 1340
			this->fileToolStripMenuItem->Text = L"&File";
1341
			// 
1342
			// newToolStripMenuItem
1343
			// 
127 cycrow 1344
			this->newToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(10) {
1345
				this->packageToolStripMenuItem,
1346
					this->shipToolStripMenuItem, this->multiPackageToolStripMenuItem1, this->toolStripSeparator5, this->fromPackagerScriptToolStripMenuItem1,
1347
					this->fromArchiveToolStripMenuItem1, this->importShipFromModToolStripMenuItem1, this->importShipFromVFSToolStripMenuItem1, this->toolStripSeparator6,
1348
					this->packageCreationWizardToolStripMenuItem
1349
			});
1350
			this->newToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"newToolStripMenuItem.Image")));
1 cycrow 1351
			this->newToolStripMenuItem->Name = L"newToolStripMenuItem";
127 cycrow 1352
			this->newToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1353
			this->newToolStripMenuItem->Text = L"&New";
1354
			// 
1355
			// packageToolStripMenuItem
1356
			// 
127 cycrow 1357
			this->packageToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageToolStripMenuItem.Image")));
1 cycrow 1358
			this->packageToolStripMenuItem->Name = L"packageToolStripMenuItem";
127 cycrow 1359
			this->packageToolStripMenuItem->Size = System::Drawing::Size(249, 26);
1 cycrow 1360
			this->packageToolStripMenuItem->Text = L"Package";
1361
			this->packageToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::packageToolStripMenuItem_Click);
1362
			// 
1363
			// shipToolStripMenuItem
1364
			// 
1365
			this->shipToolStripMenuItem->Name = L"shipToolStripMenuItem";
127 cycrow 1366
			this->shipToolStripMenuItem->Size = System::Drawing::Size(249, 26);
1 cycrow 1367
			this->shipToolStripMenuItem->Text = L"Ship";
1368
			this->shipToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::shipToolStripMenuItem_Click);
1369
			// 
107 cycrow 1370
			// multiPackageToolStripMenuItem1
1371
			// 
1372
			this->multiPackageToolStripMenuItem1->Name = L"multiPackageToolStripMenuItem1";
127 cycrow 1373
			this->multiPackageToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
107 cycrow 1374
			this->multiPackageToolStripMenuItem1->Text = L"Multi Package";
1375
			this->multiPackageToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::multiPackageToolStripMenuItem1_Click);
1376
			// 
1 cycrow 1377
			// toolStripSeparator5
1378
			// 
1379
			this->toolStripSeparator5->Name = L"toolStripSeparator5";
127 cycrow 1380
			this->toolStripSeparator5->Size = System::Drawing::Size(246, 6);
1 cycrow 1381
			// 
1382
			// fromPackagerScriptToolStripMenuItem1
1383
			// 
127 cycrow 1384
			this->fromPackagerScriptToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fromPackagerScriptToolStripMenuItem1.Image")));
1 cycrow 1385
			this->fromPackagerScriptToolStripMenuItem1->Name = L"fromPackagerScriptToolStripMenuItem1";
127 cycrow 1386
			this->fromPackagerScriptToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
1 cycrow 1387
			this->fromPackagerScriptToolStripMenuItem1->Text = L"From Packager Script";
1388
			this->fromPackagerScriptToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::fromPackagerScriptToolStripMenuItem1_Click);
1389
			// 
107 cycrow 1390
			// fromArchiveToolStripMenuItem1
1391
			// 
1392
			this->fromArchiveToolStripMenuItem1->Name = L"fromArchiveToolStripMenuItem1";
127 cycrow 1393
			this->fromArchiveToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
107 cycrow 1394
			this->fromArchiveToolStripMenuItem1->Text = L"From Archive";
1395
			this->fromArchiveToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::fromArchiveToolStripMenuItem1_Click);
1396
			// 
1 cycrow 1397
			// importShipFromModToolStripMenuItem1
1398
			// 
127 cycrow 1399
			this->importShipFromModToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"importShipFromModToolStripMenuItem1.Image")));
1 cycrow 1400
			this->importShipFromModToolStripMenuItem1->Name = L"importShipFromModToolStripMenuItem1";
127 cycrow 1401
			this->importShipFromModToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
1 cycrow 1402
			this->importShipFromModToolStripMenuItem1->Text = L"Import Ship From Mod";
1403
			this->importShipFromModToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::importShipFromModToolStripMenuItem1_Click);
1404
			// 
107 cycrow 1405
			// importShipFromVFSToolStripMenuItem1
1406
			// 
1407
			this->importShipFromVFSToolStripMenuItem1->Name = L"importShipFromVFSToolStripMenuItem1";
127 cycrow 1408
			this->importShipFromVFSToolStripMenuItem1->Size = System::Drawing::Size(249, 26);
107 cycrow 1409
			this->importShipFromVFSToolStripMenuItem1->Text = L"Import Ship from VFS";
1410
			this->importShipFromVFSToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::importShipFromVFSToolStripMenuItem1_Click);
1411
			// 
1 cycrow 1412
			// toolStripSeparator6
1413
			// 
1414
			this->toolStripSeparator6->Name = L"toolStripSeparator6";
127 cycrow 1415
			this->toolStripSeparator6->Size = System::Drawing::Size(246, 6);
1 cycrow 1416
			// 
1417
			// packageCreationWizardToolStripMenuItem
1418
			// 
127 cycrow 1419
			this->packageCreationWizardToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageCreationWizardToolStripMenuItem.Image")));
1 cycrow 1420
			this->packageCreationWizardToolStripMenuItem->Name = L"packageCreationWizardToolStripMenuItem";
127 cycrow 1421
			this->packageCreationWizardToolStripMenuItem->Size = System::Drawing::Size(249, 26);
1 cycrow 1422
			this->packageCreationWizardToolStripMenuItem->Text = L"Package Creation Wizard";
1423
			this->packageCreationWizardToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::packageCreationWizardToolStripMenuItem_Click);
1424
			// 
1425
			// openToolStripMenuItem
1426
			// 
1427
			this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
127 cycrow 1428
			this->openToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1429
			this->openToolStripMenuItem->Text = L"&Open Package";
1430
			// 
1431
			// saveToolStripMenuItem
1432
			// 
127 cycrow 1433
			this->saveToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"saveToolStripMenuItem.Image")));
1 cycrow 1434
			this->saveToolStripMenuItem->Name = L"saveToolStripMenuItem";
127 cycrow 1435
			this->saveToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1436
			this->saveToolStripMenuItem->Text = L"&Save";
1437
			this->saveToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveToolStripMenuItem_Click);
1438
			// 
1439
			// saveAsToolStripMenuItem
1440
			// 
127 cycrow 1441
			this->saveAsToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"saveAsToolStripMenuItem.Image")));
1 cycrow 1442
			this->saveAsToolStripMenuItem->Name = L"saveAsToolStripMenuItem";
127 cycrow 1443
			this->saveAsToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1444
			this->saveAsToolStripMenuItem->Text = L"Save &As";
1445
			this->saveAsToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveAsToolStripMenuItem_Click);
1446
			// 
1447
			// toolStripSeparator2
1448
			// 
1449
			this->toolStripSeparator2->Name = L"toolStripSeparator2";
127 cycrow 1450
			this->toolStripSeparator2->Size = System::Drawing::Size(175, 6);
1 cycrow 1451
			// 
1452
			// exitToolStripMenuItem
1453
			// 
127 cycrow 1454
			this->exitToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"exitToolStripMenuItem.Image")));
1 cycrow 1455
			this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
127 cycrow 1456
			this->exitToolStripMenuItem->Size = System::Drawing::Size(178, 26);
1 cycrow 1457
			this->exitToolStripMenuItem->Text = L"E&xit";
1458
			this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
1459
			// 
1460
			// windowsToolStripMenuItem
1461
			// 
127 cycrow 1462
			this->windowsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {
1463
				this->layoutToolStripMenuItem,
1464
					this->toolStripSeparator1
1465
			});
1 cycrow 1466
			this->windowsToolStripMenuItem->Name = L"windowsToolStripMenuItem";
127 cycrow 1467
			this->windowsToolStripMenuItem->Size = System::Drawing::Size(82, 24);
1 cycrow 1468
			this->windowsToolStripMenuItem->Text = L"&Windows";
1469
			// 
1470
			// layoutToolStripMenuItem
1471
			// 
127 cycrow 1472
			this->layoutToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {
1473
				this->cascadeToolStripMenuItem,
1474
					this->horizontalToolStripMenuItem, this->verticalToolStripMenuItem
1475
			});
1 cycrow 1476
			this->layoutToolStripMenuItem->Name = L"layoutToolStripMenuItem";
127 cycrow 1477
			this->layoutToolStripMenuItem->Size = System::Drawing::Size(128, 26);
1 cycrow 1478
			this->layoutToolStripMenuItem->Text = L"Layout";
1479
			// 
1480
			// cascadeToolStripMenuItem
1481
			// 
1482
			this->cascadeToolStripMenuItem->Name = L"cascadeToolStripMenuItem";
127 cycrow 1483
			this->cascadeToolStripMenuItem->Size = System::Drawing::Size(182, 26);
1 cycrow 1484
			this->cascadeToolStripMenuItem->Text = L"Cascade";
1485
			this->cascadeToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::cascadeToolStripMenuItem_Click);
1486
			// 
1487
			// horizontalToolStripMenuItem
1488
			// 
1489
			this->horizontalToolStripMenuItem->Name = L"horizontalToolStripMenuItem";
127 cycrow 1490
			this->horizontalToolStripMenuItem->Size = System::Drawing::Size(182, 26);
1 cycrow 1491
			this->horizontalToolStripMenuItem->Text = L"Tile Horizontal";
1492
			this->horizontalToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::horizontalToolStripMenuItem_Click);
1493
			// 
1494
			// verticalToolStripMenuItem
1495
			// 
1496
			this->verticalToolStripMenuItem->Name = L"verticalToolStripMenuItem";
127 cycrow 1497
			this->verticalToolStripMenuItem->Size = System::Drawing::Size(182, 26);
1 cycrow 1498
			this->verticalToolStripMenuItem->Text = L"Tile Vertical";
1499
			this->verticalToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::verticalToolStripMenuItem_Click);
1500
			// 
1501
			// toolStripSeparator1
1502
			// 
1503
			this->toolStripSeparator1->Name = L"toolStripSeparator1";
127 cycrow 1504
			this->toolStripSeparator1->Size = System::Drawing::Size(125, 6);
1 cycrow 1505
			// 
1506
			// settingsToolStripMenuItem
1507
			// 
127 cycrow 1508
			this->settingsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) { this->configToolStripMenuItem });
1 cycrow 1509
			this->settingsToolStripMenuItem->Name = L"settingsToolStripMenuItem";
127 cycrow 1510
			this->settingsToolStripMenuItem->Size = System::Drawing::Size(74, 24);
1 cycrow 1511
			this->settingsToolStripMenuItem->Text = L"Settings";
1512
			// 
1513
			// configToolStripMenuItem
1514
			// 
127 cycrow 1515
			this->configToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"configToolStripMenuItem.Image")));
1 cycrow 1516
			this->configToolStripMenuItem->Name = L"configToolStripMenuItem";
127 cycrow 1517
			this->configToolStripMenuItem->Size = System::Drawing::Size(128, 26);
1 cycrow 1518
			this->configToolStripMenuItem->Text = L"Config";
1519
			this->configToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::configToolStripMenuItem_Click);
1520
			// 
1521
			// toolsToolStripMenuItem
1522
			// 
127 cycrow 1523
			this->toolsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {
1524
				this->modMergeToolStripMenuItem,
1525
					this->modDiffToolStripMenuItem1, this->toolStripSeparator10, this->generatePackageWebListToolStripMenuItem1
1526
			});
1 cycrow 1527
			this->toolsToolStripMenuItem->Name = L"toolsToolStripMenuItem";
127 cycrow 1528
			this->toolsToolStripMenuItem->Size = System::Drawing::Size(56, 24);
1 cycrow 1529
			this->toolsToolStripMenuItem->Text = L"Tools";
1530
			// 
1531
			// modMergeToolStripMenuItem
1532
			// 
127 cycrow 1533
			this->modMergeToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modMergeToolStripMenuItem.Image")));
1 cycrow 1534
			this->modMergeToolStripMenuItem->Name = L"modMergeToolStripMenuItem";
127 cycrow 1535
			this->modMergeToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1536
			this->modMergeToolStripMenuItem->Text = L"Mod Merge";
1537
			this->modMergeToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::modMergeToolStripMenuItem_Click);
1538
			// 
1539
			// modDiffToolStripMenuItem1
1540
			// 
127 cycrow 1541
			this->modDiffToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modDiffToolStripMenuItem1.Image")));
1 cycrow 1542
			this->modDiffToolStripMenuItem1->Name = L"modDiffToolStripMenuItem1";
127 cycrow 1543
			this->modDiffToolStripMenuItem1->Size = System::Drawing::Size(262, 26);
1 cycrow 1544
			this->modDiffToolStripMenuItem1->Text = L"Mod Diff";
1545
			this->modDiffToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::modDiffToolStripMenuItem1_Click);
1546
			// 
1547
			// toolStripSeparator10
1548
			// 
1549
			this->toolStripSeparator10->Name = L"toolStripSeparator10";
127 cycrow 1550
			this->toolStripSeparator10->Size = System::Drawing::Size(259, 6);
1 cycrow 1551
			// 
1552
			// generatePackageWebListToolStripMenuItem1
1553
			// 
127 cycrow 1554
			this->generatePackageWebListToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"generatePackageWebListToolStripMenuItem1.Image")));
1 cycrow 1555
			this->generatePackageWebListToolStripMenuItem1->Name = L"generatePackageWebListToolStripMenuItem1";
127 cycrow 1556
			this->generatePackageWebListToolStripMenuItem1->Size = System::Drawing::Size(262, 26);
1 cycrow 1557
			this->generatePackageWebListToolStripMenuItem1->Text = L"Generate Package Web List";
1558
			this->generatePackageWebListToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::generatePackageWebListToolStripMenuItem1_Click);
1559
			// 
1560
			// PanelTab
1561
			// 
1562
			this->PanelTab->Controls->Add(this->tabControl1);
1563
			this->PanelTab->Controls->Add(this->button1);
1564
			this->PanelTab->Dock = System::Windows::Forms::DockStyle::Top;
127 cycrow 1565
			this->PanelTab->Location = System::Drawing::Point(0, 67);
1566
			this->PanelTab->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1567
			this->PanelTab->Name = L"PanelTab";
127 cycrow 1568
			this->PanelTab->Size = System::Drawing::Size(996, 33);
1 cycrow 1569
			this->PanelTab->TabIndex = 6;
1570
			// 
1571
			// tabControl1
1572
			// 
1573
			this->tabControl1->Dock = System::Windows::Forms::DockStyle::Fill;
1574
			this->tabControl1->ImageList = this->imageList1;
1575
			this->tabControl1->Location = System::Drawing::Point(0, 0);
127 cycrow 1576
			this->tabControl1->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1577
			this->tabControl1->Name = L"tabControl1";
1578
			this->tabControl1->SelectedIndex = 0;
127 cycrow 1579
			this->tabControl1->Size = System::Drawing::Size(968, 33);
1 cycrow 1580
			this->tabControl1->TabIndex = 3;
1581
			this->tabControl1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::tabControl1_SelectedIndexChanged_1);
1582
			// 
1583
			// imageList1
1584
			// 
127 cycrow 1585
			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageList1.ImageStream")));
1 cycrow 1586
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
1587
			this->imageList1->Images->SetKeyName(0, L"standard");
1588
			this->imageList1->Images->SetKeyName(1, L"ship");
1589
			this->imageList1->Images->SetKeyName(2, L"fake");
1590
			this->imageList1->Images->SetKeyName(3, L"library");
1591
			this->imageList1->Images->SetKeyName(4, L"multi");
1592
			this->imageList1->Images->SetKeyName(5, L"normal");
1593
			this->imageList1->Images->SetKeyName(6, L"update");
1594
			this->imageList1->Images->SetKeyName(7, L"patch");
1595
			this->imageList1->Images->SetKeyName(8, L"start");
1596
			// 
1597
			// button1
1598
			// 
1599
			this->button1->Dock = System::Windows::Forms::DockStyle::Right;
127 cycrow 1600
			this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
1 cycrow 1601
				static_cast<System::Byte>(0)));
1602
			this->button1->ForeColor = System::Drawing::Color::Red;
127 cycrow 1603
			this->button1->Location = System::Drawing::Point(968, 0);
1604
			this->button1->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1605
			this->button1->Name = L"button1";
127 cycrow 1606
			this->button1->Size = System::Drawing::Size(28, 33);
1 cycrow 1607
			this->button1->TabIndex = 4;
1608
			this->button1->Text = L"X";
1609
			this->button1->UseVisualStyleBackColor = true;
1610
			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
1611
			// 
1612
			// toolStrip1
1613
			// 
1614
			this->toolStrip1->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
1615
			this->toolStrip1->ImageScalingSize = System::Drawing::Size(32, 32);
127 cycrow 1616
			this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(6) {
1617
				this->toolStripButton1,
1618
					this->toolStripSplitButton1, this->toolStripSeparator3, this->toolStripButton2, this->toolStripSeparator8, this->toolStripDropDownButton1
1619
			});
1 cycrow 1620
			this->toolStrip1->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::HorizontalStackWithOverflow;
127 cycrow 1621
			this->toolStrip1->Location = System::Drawing::Point(0, 28);
1 cycrow 1622
			this->toolStrip1->Name = L"toolStrip1";
127 cycrow 1623
			this->toolStrip1->Size = System::Drawing::Size(996, 39);
1 cycrow 1624
			this->toolStrip1->TabIndex = 7;
1625
			this->toolStrip1->Text = L"toolStrip1";
1626
			// 
1627
			// toolStripButton1
1628
			// 
127 cycrow 1629
			this->toolStripButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(10) {
1630
				this->packageToolStripMenuItem1,
1631
					this->shipToolStripMenuItem1, this->multiPackageToolStripMenuItem, this->toolStripSeparator4, this->fromPackagerScriptToolStripMenuItem,
1632
					this->fromArchiveToolStripMenuItem, this->importShipFromModToolStripMenuItem, this->importShipFromVFSToolStripMenuItem, this->toolStripSeparator7,
1633
					this->packageCreationWizardToolStripMenuItem1
1634
			});
1635
			this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton1.Image")));
1 cycrow 1636
			this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1637
			this->toolStripButton1->Name = L"toolStripButton1";
127 cycrow 1638
			this->toolStripButton1->Size = System::Drawing::Size(85, 36);
1 cycrow 1639
			this->toolStripButton1->Text = L"New";
1640
			// 
1641
			// packageToolStripMenuItem1
1642
			// 
127 cycrow 1643
			this->packageToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageToolStripMenuItem1.Image")));
1 cycrow 1644
			this->packageToolStripMenuItem1->Name = L"packageToolStripMenuItem1";
127 cycrow 1645
			this->packageToolStripMenuItem1->Size = System::Drawing::Size(261, 38);
1 cycrow 1646
			this->packageToolStripMenuItem1->Text = L"Package";
1647
			this->packageToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::packageToolStripMenuItem1_Click);
1648
			// 
1649
			// shipToolStripMenuItem1
1650
			// 
1651
			this->shipToolStripMenuItem1->Name = L"shipToolStripMenuItem1";
127 cycrow 1652
			this->shipToolStripMenuItem1->Size = System::Drawing::Size(261, 38);
1 cycrow 1653
			this->shipToolStripMenuItem1->Text = L"Ship";
1654
			this->shipToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::shipToolStripMenuItem1_Click);
1655
			// 
1656
			// multiPackageToolStripMenuItem
1657
			// 
1658
			this->multiPackageToolStripMenuItem->Name = L"multiPackageToolStripMenuItem";
127 cycrow 1659
			this->multiPackageToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1660
			this->multiPackageToolStripMenuItem->Text = L"Multi Package";
1661
			this->multiPackageToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::multiPackageToolStripMenuItem_Click);
1662
			// 
1663
			// toolStripSeparator4
1664
			// 
1665
			this->toolStripSeparator4->Name = L"toolStripSeparator4";
127 cycrow 1666
			this->toolStripSeparator4->Size = System::Drawing::Size(258, 6);
1 cycrow 1667
			// 
1668
			// fromPackagerScriptToolStripMenuItem
1669
			// 
127 cycrow 1670
			this->fromPackagerScriptToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fromPackagerScriptToolStripMenuItem.Image")));
1 cycrow 1671
			this->fromPackagerScriptToolStripMenuItem->Name = L"fromPackagerScriptToolStripMenuItem";
127 cycrow 1672
			this->fromPackagerScriptToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1673
			this->fromPackagerScriptToolStripMenuItem->Text = L"From Packager Script";
1674
			this->fromPackagerScriptToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::fromPackagerScriptToolStripMenuItem_Click);
1675
			// 
1676
			// fromArchiveToolStripMenuItem
1677
			// 
127 cycrow 1678
			this->fromArchiveToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fromArchiveToolStripMenuItem.Image")));
1 cycrow 1679
			this->fromArchiveToolStripMenuItem->Name = L"fromArchiveToolStripMenuItem";
127 cycrow 1680
			this->fromArchiveToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1681
			this->fromArchiveToolStripMenuItem->Text = L"From Archive";
1682
			this->fromArchiveToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::fromArchiveToolStripMenuItem_Click);
1683
			// 
1684
			// importShipFromModToolStripMenuItem
1685
			// 
127 cycrow 1686
			this->importShipFromModToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"importShipFromModToolStripMenuItem.Image")));
1 cycrow 1687
			this->importShipFromModToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
1688
			this->importShipFromModToolStripMenuItem->Name = L"importShipFromModToolStripMenuItem";
127 cycrow 1689
			this->importShipFromModToolStripMenuItem->Size = System::Drawing::Size(261, 38);
1 cycrow 1690
			this->importShipFromModToolStripMenuItem->Text = L"Import Ship From Mod";
1691
			this->importShipFromModToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::importShipFromModToolStripMenuItem_Click);
1692
			// 
107 cycrow 1693
			// importShipFromVFSToolStripMenuItem
1694
			// 
1695
			this->importShipFromVFSToolStripMenuItem->Name = L"importShipFromVFSToolStripMenuItem";
127 cycrow 1696
			this->importShipFromVFSToolStripMenuItem->Size = System::Drawing::Size(261, 38);
107 cycrow 1697
			this->importShipFromVFSToolStripMenuItem->Text = L"Import Ship from VFS";
1698
			this->importShipFromVFSToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::importShipFromVFSToolStripMenuItem_Click);
1699
			// 
1 cycrow 1700
			// toolStripSeparator7
1701
			// 
1702
			this->toolStripSeparator7->Name = L"toolStripSeparator7";
127 cycrow 1703
			this->toolStripSeparator7->Size = System::Drawing::Size(258, 6);
1 cycrow 1704
			// 
1705
			// packageCreationWizardToolStripMenuItem1
1706
			// 
127 cycrow 1707
			this->packageCreationWizardToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"packageCreationWizardToolStripMenuItem1.Image")));
1 cycrow 1708
			this->packageCreationWizardToolStripMenuItem1->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
1709
			this->packageCreationWizardToolStripMenuItem1->Name = L"packageCreationWizardToolStripMenuItem1";
127 cycrow 1710
			this->packageCreationWizardToolStripMenuItem1->Size = System::Drawing::Size(261, 38);
1 cycrow 1711
			this->packageCreationWizardToolStripMenuItem1->Text = L"Package Creation Wizard";
1712
			this->packageCreationWizardToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::packageCreationWizardToolStripMenuItem1_Click);
1713
			// 
1714
			// toolStripSplitButton1
1715
			// 
127 cycrow 1716
			this->toolStripSplitButton1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripSplitButton1.Image")));
1 cycrow 1717
			this->toolStripSplitButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1718
			this->toolStripSplitButton1->Name = L"toolStripSplitButton1";
1719
			this->toolStripSplitButton1->RightToLeft = System::Windows::Forms::RightToLeft::No;
127 cycrow 1720
			this->toolStripSplitButton1->Size = System::Drawing::Size(96, 36);
1 cycrow 1721
			this->toolStripSplitButton1->Text = L"Open";
1722
			this->toolStripSplitButton1->ToolTipText = L"Open an existing package/ship";
1723
			this->toolStripSplitButton1->ButtonClick += gcnew System::EventHandler(this, &Form1::toolStripSplitButton1_ButtonClick);
1724
			// 
1725
			// toolStripSeparator3
1726
			// 
1727
			this->toolStripSeparator3->Name = L"toolStripSeparator3";
1728
			this->toolStripSeparator3->Size = System::Drawing::Size(6, 39);
1729
			// 
1730
			// toolStripButton2
1731
			// 
1732
			this->toolStripButton2->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
127 cycrow 1733
			this->toolStripButton2->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton2.Image")));
1 cycrow 1734
			this->toolStripButton2->ImageTransparentColor = System::Drawing::Color::Magenta;
1735
			this->toolStripButton2->Name = L"toolStripButton2";
1736
			this->toolStripButton2->Size = System::Drawing::Size(36, 36);
1737
			this->toolStripButton2->Text = L"toolStripButton2";
1738
			this->toolStripButton2->ToolTipText = L"Open the options menu";
1739
			this->toolStripButton2->Click += gcnew System::EventHandler(this, &Form1::toolStripButton2_Click);
1740
			// 
1741
			// toolStripSeparator8
1742
			// 
1743
			this->toolStripSeparator8->Name = L"toolStripSeparator8";
1744
			this->toolStripSeparator8->Size = System::Drawing::Size(6, 39);
1745
			// 
1746
			// toolStripDropDownButton1
1747
			// 
127 cycrow 1748
			this->toolStripDropDownButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(7) {
1749
				this->modMergeToolStripMenuItem1,
1750
					this->modDiffToolStripMenuItem, this->toolStripSeparator9, this->generatePackageWebListToolStripMenuItem, this->generatePackageUpdatesToolStripMenuItem,
1751
					this->toolStripSeparator11, this->fileExplorerToolStripMenuItem
1752
			});
1753
			this->toolStripDropDownButton1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripDropDownButton1.Image")));
1 cycrow 1754
			this->toolStripDropDownButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1755
			this->toolStripDropDownButton1->Name = L"toolStripDropDownButton1";
127 cycrow 1756
			this->toolStripDropDownButton1->Size = System::Drawing::Size(90, 36);
1 cycrow 1757
			this->toolStripDropDownButton1->Text = L"Tools";
1758
			// 
1759
			// modMergeToolStripMenuItem1
1760
			// 
127 cycrow 1761
			this->modMergeToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modMergeToolStripMenuItem1.Image")));
1 cycrow 1762
			this->modMergeToolStripMenuItem1->Name = L"modMergeToolStripMenuItem1";
127 cycrow 1763
			this->modMergeToolStripMenuItem1->Size = System::Drawing::Size(262, 26);
1 cycrow 1764
			this->modMergeToolStripMenuItem1->Text = L"Mod Merge";
1765
			this->modMergeToolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::modMergeToolStripMenuItem1_Click);
1766
			// 
1767
			// modDiffToolStripMenuItem
1768
			// 
127 cycrow 1769
			this->modDiffToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"modDiffToolStripMenuItem.Image")));
1 cycrow 1770
			this->modDiffToolStripMenuItem->Name = L"modDiffToolStripMenuItem";
127 cycrow 1771
			this->modDiffToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1772
			this->modDiffToolStripMenuItem->Text = L"Mod Diff";
1773
			this->modDiffToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::modDiffToolStripMenuItem_Click);
1774
			// 
1775
			// toolStripSeparator9
1776
			// 
1777
			this->toolStripSeparator9->Name = L"toolStripSeparator9";
127 cycrow 1778
			this->toolStripSeparator9->Size = System::Drawing::Size(259, 6);
1 cycrow 1779
			// 
1780
			// generatePackageWebListToolStripMenuItem
1781
			// 
127 cycrow 1782
			this->generatePackageWebListToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"generatePackageWebListToolStripMenuItem.Image")));
1 cycrow 1783
			this->generatePackageWebListToolStripMenuItem->Name = L"generatePackageWebListToolStripMenuItem";
127 cycrow 1784
			this->generatePackageWebListToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1785
			this->generatePackageWebListToolStripMenuItem->Text = L"Generate Package Web List";
1786
			this->generatePackageWebListToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::generatePackageWebListToolStripMenuItem_Click);
1787
			// 
1788
			// generatePackageUpdatesToolStripMenuItem
1789
			// 
127 cycrow 1790
			this->generatePackageUpdatesToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"generatePackageUpdatesToolStripMenuItem.Image")));
1 cycrow 1791
			this->generatePackageUpdatesToolStripMenuItem->Name = L"generatePackageUpdatesToolStripMenuItem";
127 cycrow 1792
			this->generatePackageUpdatesToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1793
			this->generatePackageUpdatesToolStripMenuItem->Text = L"Generate Package Updates";
1794
			this->generatePackageUpdatesToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::generatePackageUpdatesToolStripMenuItem_Click);
1795
			// 
1796
			// toolStripSeparator11
1797
			// 
1798
			this->toolStripSeparator11->Name = L"toolStripSeparator11";
127 cycrow 1799
			this->toolStripSeparator11->Size = System::Drawing::Size(259, 6);
1 cycrow 1800
			// 
1801
			// fileExplorerToolStripMenuItem
1802
			// 
127 cycrow 1803
			this->fileExplorerToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"fileExplorerToolStripMenuItem.Image")));
1 cycrow 1804
			this->fileExplorerToolStripMenuItem->Name = L"fileExplorerToolStripMenuItem";
127 cycrow 1805
			this->fileExplorerToolStripMenuItem->Size = System::Drawing::Size(262, 26);
1 cycrow 1806
			this->fileExplorerToolStripMenuItem->Text = L"File Explorer";
1807
			this->fileExplorerToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::fileExplorerToolStripMenuItem_Click);
1808
			// 
1809
			// timer1
1810
			// 
1811
			this->timer1->Enabled = true;
1812
			this->timer1->Interval = 500;
1813
			this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
1814
			// 
1815
			// statusStrip1
1816
			// 
127 cycrow 1817
			this->statusStrip1->ImageScalingSize = System::Drawing::Size(20, 20);
1818
			this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) { this->StatusFiles });
1819
			this->statusStrip1->Location = System::Drawing::Point(0, 832);
1 cycrow 1820
			this->statusStrip1->Name = L"statusStrip1";
127 cycrow 1821
			this->statusStrip1->Padding = System::Windows::Forms::Padding(1, 0, 19, 0);
1822
			this->statusStrip1->Size = System::Drawing::Size(996, 25);
1 cycrow 1823
			this->statusStrip1->TabIndex = 9;
1824
			this->statusStrip1->Text = L"statusStrip1";
1825
			// 
1826
			// StatusFiles
1827
			// 
1828
			this->StatusFiles->Name = L"StatusFiles";
127 cycrow 1829
			this->StatusFiles->Size = System::Drawing::Size(101, 20);
1 cycrow 1830
			this->StatusFiles->Text = L"Files: 1 (10KB)";
1831
			// 
1832
			// imageListGames
1833
			// 
127 cycrow 1834
			this->imageListGames->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListGames.ImageStream")));
1 cycrow 1835
			this->imageListGames->TransparentColor = System::Drawing::Color::Transparent;
1836
			this->imageListGames->Images->SetKeyName(0, L"X2");
1837
			this->imageListGames->Images->SetKeyName(1, L"X3");
1838
			this->imageListGames->Images->SetKeyName(2, L"X3TC");
1839
			this->imageListGames->Images->SetKeyName(3, L"X3AP");
127 cycrow 1840
			this->imageListGames->Images->SetKeyName(4, L"X3FL");
1 cycrow 1841
			// 
1842
			// toolTip1
1843
			// 
1844
			this->toolTip1->AutomaticDelay = 1000;
1845
			this->toolTip1->IsBalloon = true;
1846
			this->toolTip1->ToolTipIcon = System::Windows::Forms::ToolTipIcon::Info;
1847
			this->toolTip1->ToolTipTitle = L"Close All Windows";
1848
			// 
1849
			// imageListSmall
1850
			// 
127 cycrow 1851
			this->imageListSmall->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListSmall.ImageStream")));
1 cycrow 1852
			this->imageListSmall->TransparentColor = System::Drawing::Color::Transparent;
1853
			this->imageListSmall->Images->SetKeyName(0, L"language");
1854
			this->imageListSmall->Images->SetKeyName(1, L"web");
1855
			this->imageListSmall->Images->SetKeyName(2, L"ware");
1856
			this->imageListSmall->Images->SetKeyName(3, L"components");
1857
			this->imageListSmall->Images->SetKeyName(4, L"dummies");
1858
			this->imageListSmall->Images->SetKeyName(5, L"cockpit");
1859
			this->imageListSmall->Images->SetKeyName(6, L"cutdata");
1860
			this->imageListSmall->Images->SetKeyName(7, L"bodies");
1861
			this->imageListSmall->Images->SetKeyName(8, L"animations");
1862
			this->imageListSmall->Images->SetKeyName(9, L"turret");
1863
			this->imageListSmall->Images->SetKeyName(10, L"gun");
1864
			// 
1865
			// imageListLarge
1866
			// 
127 cycrow 1867
			this->imageListLarge->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListLarge.ImageStream")));
1 cycrow 1868
			this->imageListLarge->TransparentColor = System::Drawing::Color::Transparent;
1869
			this->imageListLarge->Images->SetKeyName(0, L"language");
1870
			this->imageListLarge->Images->SetKeyName(1, L"web");
1871
			this->imageListLarge->Images->SetKeyName(2, L"ware");
1872
			this->imageListLarge->Images->SetKeyName(3, L"turret");
1873
			this->imageListLarge->Images->SetKeyName(4, L"gun");
1874
			// 
1875
			// imageListFiles
1876
			// 
127 cycrow 1877
			this->imageListFiles->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListFiles.ImageStream")));
1 cycrow 1878
			this->imageListFiles->TransparentColor = System::Drawing::Color::Transparent;
1879
			this->imageListFiles->Images->SetKeyName(0, L"script.png");
1880
			this->imageListFiles->Images->SetKeyName(1, L"textfile.png");
1881
			this->imageListFiles->Images->SetKeyName(2, L"readme.png");
1882
			this->imageListFiles->Images->SetKeyName(3, L"map.png");
1883
			this->imageListFiles->Images->SetKeyName(4, L"mods.png");
1884
			this->imageListFiles->Images->SetKeyName(5, L"uninstall.png");
1885
			this->imageListFiles->Images->SetKeyName(6, L"sound.png");
1886
			this->imageListFiles->Images->SetKeyName(7, L"extras.png");
1887
			this->imageListFiles->Images->SetKeyName(8, L"screenshot.png");
1888
			this->imageListFiles->Images->SetKeyName(9, L"mission.png");
1889
			this->imageListFiles->Images->SetKeyName(10, L"advert.png");
1890
			this->imageListFiles->Images->SetKeyName(11, L"shipother.png");
1891
			this->imageListFiles->Images->SetKeyName(12, L"shipmodel.png");
1892
			this->imageListFiles->Images->SetKeyName(13, L"shipscene.png");
1893
			this->imageListFiles->Images->SetKeyName(14, L"cockpitscene.png");
1894
			this->imageListFiles->Images->SetKeyName(15, L"package");
1895
			this->imageListFiles->Images->SetKeyName(16, L"backup.png");
1896
			this->imageListFiles->Images->SetKeyName(17, L"fakepatch");
1897
			// 
1898
			// backgroundWorker1
1899
			// 
1900
			this->backgroundWorker1->WorkerReportsProgress = true;
1901
			this->backgroundWorker1->WorkerSupportsCancellation = true;
1902
			this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &Form1::backgroundWorker1_DoWork);
1903
			this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &Form1::backgroundWorker1_RunWorkerCompleted);
1904
			// 
1905
			// Form1
1906
			// 
1907
			this->AllowDrop = true;
127 cycrow 1908
			this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
1 cycrow 1909
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
127 cycrow 1910
			this->ClientSize = System::Drawing::Size(996, 857);
1 cycrow 1911
			this->Controls->Add(this->statusStrip1);
1912
			this->Controls->Add(this->PanelTab);
1913
			this->Controls->Add(this->toolStrip1);
1914
			this->Controls->Add(this->menuStrip1);
127 cycrow 1915
			this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
1 cycrow 1916
			this->IsMdiContainer = true;
1917
			this->MainMenuStrip = this->menuStrip1;
127 cycrow 1918
			this->Margin = System::Windows::Forms::Padding(4);
1 cycrow 1919
			this->Name = L"Form1";
1920
			this->Text = L"Package Creator";
127 cycrow 1921
			this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
1 cycrow 1922
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
1923
			this->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragDrop);
1924
			this->DragOver += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragOver);
1925
			this->menuStrip1->ResumeLayout(false);
1926
			this->menuStrip1->PerformLayout();
1927
			this->PanelTab->ResumeLayout(false);
1928
			this->toolStrip1->ResumeLayout(false);
1929
			this->toolStrip1->PerformLayout();
1930
			this->statusStrip1->ResumeLayout(false);
1931
			this->statusStrip1->PerformLayout();
1932
			this->ResumeLayout(false);
1933
			this->PerformLayout();
1934
 
1935
		}
1936
#pragma endregion
1937
	private: System::Void cascadeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1938
				 this->LayoutMdi(MdiLayout::Cascade);
1939
			 }
1940
private: System::Void horizontalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1941
			 this->LayoutMdi(MdiLayout::TileHorizontal);
1942
		 }
1943
private: System::Void verticalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1944
			 this->LayoutMdi(MdiLayout::TileVertical);
1945
		 }
1946
private: System::Void tabControl1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
1947
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1948
			 for ( int i = 0; i < children->Length; i++ )
1949
			 {
1950
				 BaseForm ^childForm = (BaseForm ^)children[i];
1951
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
1952
				 {
1953
					 childForm->Select();
1954
					 break;
1955
				 }
1956
			 }
1957
 
1958
		 }
1959
private: System::Void packageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1960
			 this->NewPackage(false);
1961
		 }
1962
private: System::Void shipToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1963
			 this->NewPackage(true);
1964
		 }
1965
private: System::Void exitToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1966
			 this->Close();
1967
		 }
1968
private: System::Void saveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1969
			 this->Save();
1970
		 }
1971
private: System::Void saveAsToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1972
			 this->SaveAs();
1973
		 }
1974
private: System::Void Event_Open(System::Object^  sender, System::EventArgs^  e) {
1975
			System::Windows::Forms::ToolStripMenuItem ^item = cli::safe_cast<System::Windows::Forms::ToolStripMenuItem ^>(sender);
1976
			if ( item->Tag == "$PACKAGE" )
1977
				this->Open();
1978
			else if ( item->Tag == "$DIR" )
1979
			{
1980
				FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
1981
				fbd->Description = "Select the path to load all valid files from";
1982
				if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
1983
					this->OpenDirectory(fbd->SelectedPath);
1984
			}
1985
			else
1986
			{
1987
				this->Open(cli::safe_cast<System::String ^>(item->Tag), true, false);
1988
			}
1989
		}
1990
 
1991
private: System::Void openPackageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1992
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
1993
			ofd->Filter = "All (*.spk *.xsp)|*.spk;*.xsp|Package Files (*.spk)|*.spk|Ship Files (*.xsp)|*.xsp";
1994
			ofd->FilterIndex = 1;
1995
			ofd->RestoreDirectory = true;
1996
			ofd->Multiselect = true;
1997
 
1998
			if ( ofd->ShowDialog() == System::Windows::Forms::DialogResult::OK )
1999
				this->OpenFiles(ofd->FileNames, false, true);
2000
		 }
2001
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
2002
				 this->CloseAll();
2003
			 }
2004
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
2005
			 if ( m_bAutoClose )
2006
				 this->Close();
2007
			 if ( m_iLocX != -1 && m_iLocY != -1 )
2008
				this->Location = System::Drawing::Point(m_iLocX, m_iLocY);
2009
			this->UpdateDropDownOpen();
2010
		 }
2011
private: System::Void toolStripSplitButton1_ButtonClick(System::Object^  sender, System::EventArgs^  e) {
2012
			 this->Open();
2013
		 }
2014
private: System::Void packageToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2015
			 this->NewPackage(false);
2016
		 }
2017
private: System::Void shipToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2018
			 this->NewPackage(true);
2019
		 }
2020
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
2021
			 if ( IO::File::Exists(IO::Path::GetTempPath() + "\\creator_load.dat") )
2022
				 this->LoadFiles(IO::Path::GetTempPath() + "\\creator_load.dat");
2023
		 }
2024
private: System::Void tabControl1_SelectedIndexChanged_1(System::Object^  sender, System::EventArgs^  e) {
2025
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
2026
			 for ( int i = 0; i < children->Length; i++ )
2027
			 {
2028
				 BaseForm ^childForm = (BaseForm ^)children[i];
2029
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
2030
				 {
2031
					 childForm->Select();
2032
					 break;
2033
				 }
2034
			 }
2035
		 }
2036
private: System::Void configToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2037
			 this->OpenOptionsMenu();
2038
		 }
2039
private: System::Void toolStripButton2_Click(System::Object^  sender, System::EventArgs^  e) {
2040
			 this->OpenOptionsMenu();
2041
		 }
2042
private: System::Void fromPackagerScriptToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2043
			 this->OpenPackagerScript();
2044
		 }
2045
private: System::Void fromPackagerScriptToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2046
			 this->OpenPackagerScript();
2047
		 }
2048
private: System::Void Form1_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
2049
			e->Effect = DragDropEffects::None;
2050
 
2051
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
2052
			{
2053
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
2054
				int i;
2055
				for(i = 0; i < a->Length; i++)
2056
				{
2057
					if ( String::Compare(IO::FileInfo(a[i]).Extension, ".xsp", true) == 0 || String::Compare(IO::FileInfo(a[i]).Extension, ".spk", true) == 0 )
2058
					{
2059
						e->Effect = DragDropEffects::Copy;
2060
						break;
2061
					}
2062
				}
2063
			}
2064
		 }
2065
private: System::Void Form1_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
2066
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
2067
			{
2068
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
2069
				this->OpenFiles(a, true, true);
2070
			}
2071
		 }
2072
private: System::Void importShipFromModToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2073
			 this->ImportShip();
2074
		 }
2075
private: System::Void importShipFromModToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2076
			 this->ImportShip();
2077
		 }
2078
private: System::Void Form1_FormClosing(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e) {
2079
			 this->CloseAll();
2080
			 e->Cancel = false;
2081
		 }
2082
private: System::Void packageCreationWizardToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2083
			 this->PackageCreationWizard();
2084
		 }
2085
private: System::Void packageCreationWizardToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2086
			 this->PackageCreationWizard();
2087
		 }
2088
private: System::Void multiPackageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2089
			 this->NewMultiPackage();
2090
		 }
2091
private: System::Void modMergeToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2092
			 ModMerge();
2093
		 }
2094
private: System::Void modMergeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2095
			 ModMerge();
2096
		 }
2097
private: System::Void modDiffToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2098
			 ModDiffDialog();
2099
		 }
2100
private: System::Void modDiffToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2101
			 ModDiffDialog();
2102
		 }
2103
private: System::Void generatePackageWebListToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2104
			 GeneratePackageWebList();
2105
		 }
2106
private: System::Void generatePackageWebListToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2107
			 GeneratePackageWebList();
2108
		 }
2109
private: System::Void fromArchiveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2110
			 OpenArchive();
2111
		 }
2112
private: System::Void backgroundWorker1_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
2113
			 Threading::Thread::Sleep(500);
182 cycrow 2114
			 m_pConverted = m_pPackages->createFromArchive(_S(m_sConvertFile));
1 cycrow 2115
		 }
2116
private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^  sender, System::ComponentModel::RunWorkerCompletedEventArgs^  e) {
2117
			 if ( m_pWait ) 
2118
			 {
2119
				 m_pWait->Close();
2120
				 delete m_pWait;
2121
				 m_pWait = nullptr;
2122
			}
2123
 
2124
			 if ( !m_pConverted )
2125
				MessageBox::Show(this, "Unable to open archive file, " + m_sConvertFile, "Unable to open", MessageBoxButtons::OK, MessageBoxIcon::Error);
2126
			 else
2127
			 {
2128
				PackageForm ^childForm = this->OpenPackage(true, m_pConverted, m_sConvertFile, "");
50 cycrow 2129
				childForm->Text = _US(m_pConverted->filename());
1 cycrow 2130
			 }
2131
		 }
2132
private: System::Void generatePackageUpdatesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2133
			 GeneratePackageUpdates();
2134
		 }
2135
private: System::Void fileExplorerToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2136
			 OpenFileExplorer();
2137
		 }
36 cycrow 2138
private: System::Void importShipFromVFSToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2139
			 ImportShipFromVFS();
2140
		 }
107 cycrow 2141
private: System::Void multiPackageToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2142
			 this->NewMultiPackage();
2143
		 }
2144
private: System::Void importShipFromVFSToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2145
			 ImportShipFromVFS();
2146
		 }
2147
private: System::Void fromArchiveToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2148
			 OpenArchive();
2149
		 }
1 cycrow 2150
};
2151
}
2152