Subversion Repositories spk

Rev

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