Subversion Repositories spk

Rev

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

Rev 31 Rev 36
Line 11... Line 11...
11
#include "../../ModMerge/src/Forms/Form1.h"
11
#include "../../ModMerge/src/Forms/Form1.h"
12
#include "ModDiff.h"
12
#include "ModDiff.h"
13
#include "Waiting.h"
13
#include "Waiting.h"
14
#include "FileExplorer.h"
14
#include "FileExplorer.h"
15
#include "SelectGame.h"
15
#include "SelectGame.h"
-
 
16
#include "SelectFilesystem.h"
-
 
17
#include <VirtualFileSystem.h>
-
 
18
 
16
 
19
 
17
using namespace System;
20
using namespace System;
18
using namespace System::IO;
21
using namespace System::IO;
19
 
22
 
20
namespace Creator {
23
namespace Creator {
Line 25... Line 28...
25
	using namespace System::ComponentModel;
28
	using namespace System::ComponentModel;
26
	using namespace System::Collections;
29
	using namespace System::Collections;
27
	using namespace System::Windows::Forms;
30
	using namespace System::Windows::Forms;
28
	using namespace System::Data;
31
	using namespace System::Data;
29
	using namespace System::Drawing;
32
	using namespace System::Drawing;
30
 
33
 
31
	/// <summary>
34
	/// <summary>
32
	/// Summary for Form1
35
	/// Summary for Form1
33
	///
36
	///
34
	/// WARNING: If you change the name of this class, you will need to change the
37
	/// WARNING: If you change the name of this class, you will need to change the
35
	///          'Resource File Name' property for the managed resource compiler tool
38
	///          'Resource File Name' property for the managed resource compiler tool
Line 38... Line 41...
38
	///          resources associated with this form.
41
	///          resources associated with this form.
39
	/// </summary>
42
	/// </summary>
40
	public ref class Form1 : public System::Windows::Forms::Form
43
	public ref class Form1 : public System::Windows::Forms::Form
41
	{
44
	{
42
	public:
45
	public:
43
		Form1(array<System::String ^> ^args)
46
		Form1(array<System::String ^> ^args);
44
		{
-
 
45
			InitializeComponent();
-
 
46
 
-
 
47
			m_bAutoClose = false;
-
 
48
			m_pWait = nullptr;
-
 
49
			m_bTextLoaded = false;
-
 
50
			this->shipToolStripMenuItem->Image = this->imageList1->Images[1];
-
 
51
			this->shipToolStripMenuItem1->Image = this->imageList1->Images[1];
-
 
52
			this->multiPackageToolStripMenuItem->Image = this->imageList1->Images[this->imageList1->Images->IndexOfKey("multi")];
-
 
53
			this->Closed += gcnew System::EventHandler(this, &Form1::CloseEvent);
-
 
54
 
-
 
55
			textList = gcnew Hashtable();
-
 
56
 
-
 
57
			this->Text = "Package Creator " + GetVersionString();
-
 
58
			m_pLoadedList = new CyStringList;
-
 
59
			m_pGameDir = new CLinkList<SGameDir>;
-
 
60
 
-
 
61
			// default settings
-
 
62
			m_settings = new SSettings;
-
 
63
			m_settings->bGenerateUpdate = false;
-
 
64
 
-
 
65
			m_pComponents = NULL;
-
 
66
			m_pDummies = NULL;
-
 
67
			m_pBodies = NULL;
-
 
68
			m_pShields = NULL;
-
 
69
			m_pCockpits = new CLinkList<CyStringList>;
-
 
70
			m_pLasers = new CLinkList<CyStringList>;
-
 
71
			m_pMissiles = new CLinkList<CyStringList>;
-
 
72
 
-
 
73
			m_iLocX = m_iLocY = -1;
-
 
74
			this->LoadData();
-
 
75
 
-
 
76
			this->toolTip1->SetToolTip(this->button1, "Closes all open windows, will ask about saving any that have been modified when they close");
-
 
77
 
-
 
78
			m_pPackages = new CPackages;
-
 
79
			m_pPackages->Startup(".", CyStringFromSystemString(IO::Path::GetTempPath()), CyStringFromSystemString(Environment::GetFolderPath(Environment::SpecialFolder::Personal )));
-
 
80
			m_pPackages->SetLanguage(44);
-
 
81
 
-
 
82
			this->UpdateDisplay();
-
 
83
 
-
 
84
			// parse any switches
-
 
85
			int switchType = SWITCH_NONE;
-
 
86
 
-
 
87
			if ( args ) {
-
 
88
				ArrayList ^list = gcnew ArrayList();
-
 
89
				for ( int i = 0; i < args->Length; i++ ) {
-
 
90
					String ^str = args[i];
-
 
91
					if ( switchType != SWITCH_NONE ) {
-
 
92
						switch(switchType) {
-
 
93
							case SWITCH_CREATE:
-
 
94
								this->SavePackagerScript(str);
-
 
95
								m_bAutoClose = true;
-
 
96
								break;
-
 
97
							case SWITCH_EXTRACT:
-
 
98
								this->ExtractPackage(str, false);
-
 
99
								m_bAutoClose = true;
-
 
100
								break;
-
 
101
							case SWITCH_EXTRACTHERE:
-
 
102
								this->ExtractPackage(str, true);
-
 
103
								m_bAutoClose = true;
-
 
104
								break;
-
 
105
							case SWITCH_EXPORT:
-
 
106
								this->ExportPackage(str);
-
 
107
								m_bAutoClose = true;
-
 
108
								break;
-
 
109
						}
-
 
110
						switchType = SWITCH_NONE;
-
 
111
					}
-
 
112
					else if ( !String::Compare(str, "--create", true) ) {
-
 
113
						switchType = SWITCH_CREATE;			
-
 
114
					}
-
 
115
					else if ( !String::Compare(str, "--extract", true) ) {
-
 
116
						switchType = SWITCH_EXTRACT;
-
 
117
					}
-
 
118
					else if ( !String::Compare(str, "--extracthere", true) ) {
-
 
119
						switchType = SWITCH_EXTRACTHERE;
-
 
120
					}
-
 
121
					else if ( !String::Compare(str, "--export", true) ) {
-
 
122
						switchType = SWITCH_EXPORT;
-
 
123
					}
-
 
124
					else {
-
 
125
						list->Add(args[i]);
-
 
126
					}
-
 
127
				}
-
 
128
 
47
 
129
				if ( list->Count ) {
-
 
130
					this->OpenFiles(list, true, true);
48
		void parseCommandArguments(array<System::String ^> ^args);
131
					m_bAutoClose = false;
-
 
132
				}
-
 
133
			}
-
 
134
		}
-
 
135
 
49
 
136
		int GetHighestGame()
50
		int GetHighestGame()
137
		{
51
		{
138
			int highest = 1;
52
			int highest = 1;
139
			for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
53
			for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
Line 141... Line 55...
141
				int checkgame = gd->sGame.GetToken(" ", 1, 1).ToInt();
55
				int checkgame = gd->sGame.GetToken(" ", 1, 1).ToInt();
142
				if ( checkgame > highest )
56
				if ( checkgame > highest )
143
					highest = checkgame;
57
					highest = checkgame;
144
			}
58
			}
145
			return highest;
59
			return highest;
146
		}
60
		}
147
 
61
 
148
		void ModMerge()
62
		void ModMerge()
149
		{
63
		{
150
			ModMerge::Form1 ^merge = gcnew ModMerge::Form1();
64
			ModMerge::Form1 ^merge = gcnew ModMerge::Form1();
151
			merge->StartPosition = Windows::Forms::FormStartPosition::CenterParent;
65
			merge->StartPosition = Windows::Forms::FormStartPosition::CenterParent;
Line 160... Line 74...
160
			ModDiff ^diff = gcnew ModDiff(m_pGameDir, m_pPackages);
74
			ModDiff ^diff = gcnew ModDiff(m_pGameDir, m_pPackages);
161
			diff->ShowDialog(this);
75
			diff->ShowDialog(this);
162
		}
76
		}
163
 
77
 
164
		void OpenArchive()
78
		void OpenArchive()
165
		{
79
		{
166
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
80
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
167
			ofd->Filter = "All Supported Archives|*.zip; *.rar|Zip Archive (*.zip)|*.zip|Rar Archive (*.rar)|*.rar";
81
			ofd->Filter = "All Supported Archives|*.zip; *.rar|Zip Archive (*.zip)|*.zip|Rar Archive (*.rar)|*.rar";
168
			ofd->Title = "Select archive file you wish to import from";
82
			ofd->Title = "Select archive file you wish to import from";
169
			ofd->FilterIndex = 1;
83
			ofd->FilterIndex = 1;
170
			ofd->RestoreDirectory = true;
84
			ofd->RestoreDirectory = true;
Line 181... Line 95...
181
 
95
 
182
		CyStringList *FindLasersList(int game)
96
		CyStringList *FindLasersList(int game)
183
		{
97
		{
184
			// return the list
98
			// return the list
185
			if ( game < m_pLasers->size() )
99
			if ( game < m_pLasers->size() )
186
			{
100
			{
187
				if ( !m_pLasers->Get(game)->Empty() )
101
				if ( !m_pLasers->Get(game)->Empty() )
188
					return m_pLasers->Get(game);
102
					return m_pLasers->Get(game);
189
			}
103
			}
190
 
104
 
191
			// other wise create the list we need
105
			// other wise create the list we need
Line 260... Line 174...
260
 
174
 
261
			// other wise create the list we need
175
			// other wise create the list we need
262
			// first we need to create entries for the ones we are not using
176
			// first we need to create entries for the ones we are not using
263
			while ( m_pMissiles->size() < game )
177
			while ( m_pMissiles->size() < game )
264
				m_pMissiles->push_back(new CyStringList);
178
				m_pMissiles->push_back(new CyStringList);
265
 
179
 
266
			CyStringList *list = new CyStringList;
180
			CyStringList *list = new CyStringList;
267
			m_pMissiles->push_back(list);
181
			m_pMissiles->push_back(list);
268
 
182
 
269
			for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
183
			for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
270
			{
184
			{
271
				int checkgame = gd->sGame.GetToken(" ", 1, 1).ToInt();
185
				int checkgame = gd->sGame.GetToken(" ", 1, 1).ToInt();
Line 284... Line 198...
284
							str->str.RemoveChar('\r');
198
							str->str.RemoveChar('\r');
285
							str->str.RemoveChar(9);
199
							str->str.RemoveChar(9);
286
							str->str.RemoveFirstSpace();
200
							str->str.RemoveFirstSpace();
287
 
201
 
288
							if ( str->str.Empty() )
202
							if ( str->str.Empty() )
289
								continue;
203
								continue;
290
							if ( str->str[0] == '/' )
204
							if ( str->str[0] == '/' )
291
								continue;
205
								continue;
292
 
206
 
293
							if ( itemsRemaining == -1 )
207
							if ( itemsRemaining == -1 )
294
								itemsRemaining = str->str.GetToken(";", 2, 2).ToInt();
208
								itemsRemaining = str->str.GetToken(";", 2, 2).ToInt();
295
							else
209
							else
296
							{
210
							{
297
								list->PushBack(str->str, CyStringFromSystemString(this->FindText(game, TEXTPAGE_OBJECTS, str->str.GetToken(";", 7, 7).ToInt())));
211
								list->PushBack(str->str, CyStringFromSystemString(this->FindText(game, TEXTPAGE_OBJECTS, str->str.GetToken(";", 7, 7).ToInt())));
298
								--itemsRemaining;
212
								--itemsRemaining;
299
							}
213
							}
300
						}
214
						}
301
 
215
 
302
						delete lines;
216
						delete lines;
303
						return list;
217
						return list;
304
					}
218
					}
305
				}
219
				}
306
			}
220
			}
307
 
221
 
308
			return list;
222
			return list;
309
		}
223
		}
310
 
224
 
311
		CyStringList *GetShields()
225
		CyStringList *GetShields()
Line 420... Line 334...
420
					}
334
					}
421
					File.Remove();
335
					File.Remove();
422
				}
336
				}
423
			}
337
			}
424
			return list;
338
			return list;
425
		}
339
		}
426
 
340
 
427
		CyStringList *GetComponentSections()
341
		CyStringList *GetComponentSections()
428
		{
342
		{
429
			// need to load data
343
			// need to load data
430
			if ( !m_pComponents )
344
			if ( !m_pComponents )
Line 459... Line 373...
459
										continue;
373
										continue;
460
 
374
 
461
									if ( itemsRemaining )
375
									if ( itemsRemaining )
462
										--itemsRemaining;
376
										--itemsRemaining;
463
									else if ( !sectionRemaining )
377
									else if ( !sectionRemaining )
464
									{
378
									{
465
										sectionRemaining = str->str.GetToken(";", 2, 2).ToInt();
379
										sectionRemaining = str->str.GetToken(";", 2, 2).ToInt();
466
										CyString sec = str->str.GetToken(";", 1, 1);
380
										CyString sec = str->str.GetToken(";", 1, 1);
467
										if ( !sec.Empty() )
381
										if ( !sec.Empty() )
468
											m_pComponents->PushBack(sec);
382
											m_pComponents->PushBack(sec);
469
									}
383
									}
Line 537... Line 451...
537
										if ( !sec.Empty() )
451
										if ( !sec.Empty() )
538
											m_pDummies->PushBack(sec);
452
											m_pDummies->PushBack(sec);
539
									}
453
									}
540
									else
454
									else
541
										--sectionRemaining;
455
										--sectionRemaining;
542
								}
456
								}
543
 
457
 
544
								delete lines;
458
								delete lines;
545
								found = true;
459
								found = true;
546
								break;
460
								break;
547
							}
461
							}
Line 613... Line 527...
613
 
527
 
614
								delete lines;
528
								delete lines;
615
								found = true;
529
								found = true;
616
								break;
530
								break;
617
							}
531
							}
618
						}
532
						}
619
					}
533
					}
620
 
534
 
621
					if ( found )
535
					if ( found )
622
						break;
536
						break;
623
				}
537
				}
624
				// still empty
538
				// still empty
625
				if ( !m_pBodies )
539
				if ( !m_pBodies )
Line 672... Line 586...
672
						}
586
						}
673
					}
587
					}
674
				}
588
				}
675
			}
589
			}
676
			return t;
590
			return t;
-
 
591
		}
-
 
592
 
-
 
593
		SGameDir *findGameDir(int iGame)
-
 
594
		{
-
 
595
			for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
-
 
596
				int checkgame = gd->sGame.GetToken(" ", 1, 1).ToInt();
-
 
597
				if ( checkgame == iGame ) return gd;
-
 
598
			}
-
 
599
 
-
 
600
			return NULL;
677
		}
601
		}
678
 
602
 
679
		String ^FindText(int game, int page, int id)
603
		String ^FindText(int game, int page, int id)
680
		{
604
		{
681
			this->LoadText(false, false);
605
			this->LoadText(false, false);
-
 
606
 
682
			String ^text;
607
			String ^text;
683
			if ( game == -1 )
608
			if ( game == -1 ) {
684
			{
-
 
685
				for ( int game = (GAME_MAX - 1); game >= 0; game-- )
609
				for ( int game = (GAME_MAX - 1); game >= 0; game-- ) {
686
				{
-
 
687
					String ^key = Convert::ToString(game) + "," + Convert::ToString(page) + "," + Convert::ToString(id);
610
					SGameDir *gd = findGameDir(game - 1);
-
 
611
					if ( !gd ) continue;
688
					if ( this->textList->ContainsKey(key) )
612
					if ( gd->pVfs->textExists(44, page, id) ) {
689
					{
-
 
690
						text = ParseText(game, Convert::ToString(this->textList[key]));
613
						text = ParseText(game, SystemStringFromCyString(gd->pVfs->findText(44, page, id)));
691
						break;
614
						break;
692
					}
615
					}
693
				}
616
				}
694
			}
617
			}
695
			else
618
			else
696
			{
619
			{
697
				String ^key = Convert::ToString(game) + "," + Convert::ToString(page) + "," + Convert::ToString(id);
620
				SGameDir *gd = findGameDir(game);
-
 
621
				if ( gd ) {
698
				if ( this->textList->ContainsKey(key) )
622
					if ( gd->pVfs->textExists(44, page, id) ) {
699
					text = ParseText(game, Convert::ToString(this->textList[key]));
623
						text = ParseText(game, SystemStringFromCyString(gd->pVfs->findText(44, page, id)));
-
 
624
					}
-
 
625
				}
700
			}
626
			}
701
 
627
 
702
			return text;
628
			return text;
703
		}
629
		}
704
 
630
 
705
		void UpdateStatus()
631
		void UpdateStatus()
706
		{
632
		{
707
			bool e = (this->tabControl1->HasChildren) ? true : false;
633
			bool e = (this->tabControl1->HasChildren) ? true : false;
708
 
634
 
709
			BaseForm ^active = this->GetActiveChild();
635
			BaseForm ^active = this->GetActiveChild();
710
			if ( active && active->GetFormType() == FORMTYPE_SINGLE )
636
			if ( active && active->GetFormType() == FORMTYPE_SINGLE )
711
			{
637
			{
712
				CBaseFile *activePackage = ((PackageForm ^)active)->GetPackage();
638
				CBaseFile *activePackage = ((PackageForm ^)active)->GetPackage();
713
				if ( !activePackage )
639
				if ( !activePackage )
714
					e = false;
640
					e = false;
715
				else
641
				else
716
					this->StatusFiles->Text = "Files: " + activePackage->GetFileList()->size() + " (" + SystemStringFromCyString(activePackage->GetFullFileSizeString()) + ")";
642
					this->StatusFiles->Text = "Files: " + activePackage->GetFileList()->size() + " (" + SystemStringFromCyString(activePackage->GetFullFileSizeString()) + ")";
Line 731... Line 657...
731
		}
657
		}
732
 
658
 
733
		void UpdateDisplay()
659
		void UpdateDisplay()
734
		{
660
		{
735
			bool e = (this->tabControl1->HasChildren) ? true : false;
661
			bool e = (this->tabControl1->HasChildren) ? true : false;
736
 
662
 
737
			BaseForm ^active = this->GetActiveChild();
663
			BaseForm ^active = this->GetActiveChild();
738
			if ( !active )
664
			if ( !active )
739
				e = false;
665
				e = false;
740
			else if ( active->GetFormType() != FORMTYPE_SINGLE && active->GetFormType() != FORMTYPE_MULTI)
666
			else if ( active->GetFormType() != FORMTYPE_SINGLE && active->GetFormType() != FORMTYPE_MULTI)
741
				e = false;
667
				e = false;
742
 
668
 
743
			this->saveAsToolStripMenuItem->Enabled = e;
669
			this->saveAsToolStripMenuItem->Enabled = e;
744
			this->saveToolStripMenuItem->Enabled = e;
670
			this->saveToolStripMenuItem->Enabled = e;
745
			this->tabControl1->Visible = e;
671
			this->tabControl1->Visible = e;
746
 
672
 
747
			if ( !this->PanelTab->Visible && e )
673
			if ( !this->PanelTab->Visible && e )
748
			{
674
			{
749
				this->PanelTab->Visible = e;
675
				this->PanelTab->Visible = e;
750
				this->toolStrip1->SendToBack();
676
				this->toolStrip1->SendToBack();
751
				this->menuStrip1->SendToBack();
677
				this->menuStrip1->SendToBack();
Line 824... Line 750...
824
		bool			 m_bTextLoaded;
750
		bool			 m_bTextLoaded;
825
		String			^m_sConvertFile;
751
		String			^m_sConvertFile;
826
		Waiting			^m_pWait;
752
		Waiting			^m_pWait;
827
		CBaseFile		*m_pConverted;
753
		CBaseFile		*m_pConverted;
828
 
754
 
829
		System::Collections::Hashtable ^textList;
755
		//System::Collections::Hashtable ^textList;
830
 
756
 
831
	private: System::Windows::Forms::MenuStrip^  menuStrip1;
757
	private: System::Windows::Forms::MenuStrip^  menuStrip1;
832
	private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem;
758
	private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem;
833
	private: System::Windows::Forms::ToolStripMenuItem^  newToolStripMenuItem;
759
	private: System::Windows::Forms::ToolStripMenuItem^  newToolStripMenuItem;
834
	private: System::Windows::Forms::ToolStripMenuItem^  packageToolStripMenuItem;
760
	private: System::Windows::Forms::ToolStripMenuItem^  packageToolStripMenuItem;
Line 892... Line 818...
892
private: System::Windows::Forms::ToolStripMenuItem^  fromArchiveToolStripMenuItem;
818
private: System::Windows::Forms::ToolStripMenuItem^  fromArchiveToolStripMenuItem;
893
private: System::ComponentModel::BackgroundWorker^  backgroundWorker1;
819
private: System::ComponentModel::BackgroundWorker^  backgroundWorker1;
894
private: System::Windows::Forms::ToolStripMenuItem^  generatePackageUpdatesToolStripMenuItem;
820
private: System::Windows::Forms::ToolStripMenuItem^  generatePackageUpdatesToolStripMenuItem;
895
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator11;
821
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator11;
896
private: System::Windows::Forms::ToolStripMenuItem^  fileExplorerToolStripMenuItem;
822
private: System::Windows::Forms::ToolStripMenuItem^  fileExplorerToolStripMenuItem;
-
 
823
private: System::Windows::Forms::ToolStripMenuItem^  importShipFromVFSToolStripMenuItem;
897
 
824
 
898
	private: System::Windows::Forms::ToolStripMenuItem^  exitToolStripMenuItem;
825
	private: System::Windows::Forms::ToolStripMenuItem^  exitToolStripMenuItem;
899
 
826
 
900
 
827
 
901
	private:
828
	private:
902
		BaseForm ^GetActiveChild()
829
		BaseForm ^GetActiveChild()
903
		{
830
		{
904
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
831
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
905
			 for ( int i = 0; i < children->Length; i++ )
832
			 for ( int i = 0; i < children->Length; i++ )
906
			 {
833
			 {
907
				 BaseForm ^childForm = (BaseForm ^)children[i];
834
				 BaseForm ^childForm = (BaseForm ^)children[i];
908
				 if ( !childForm->TabPage() )
835
				 if ( !childForm->TabPage() )
909
					 continue;
836
					 continue;
910
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
837
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
911
					 return childForm;
838
					 return childForm;
912
			 }
839
			 }
913
 
840
 
914
			 return nullptr;
841
			 return nullptr;
915
		}
842
		}
916
 
-
 
917
 
843
 
918
		void ImportShip()
844
		void ImportShip();
919
		{
-
 
920
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
-
 
921
			ofd->Filter = "X Catalog Files (*.cat)|*.cat";
-
 
922
			ofd->Title = "Select the mod file to import a ship from";
-
 
923
			ofd->FilterIndex = 1;
-
 
924
			ofd->RestoreDirectory = true;
845
		void ImportShipFromVFS();
925
			ofd->Multiselect = false;
-
 
926
 
846
 
927
			if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
-
 
928
			{
-
 
929
				this->UseWaitCursor = true;
-
 
930
				// if its a cat file, lets load the text
-
 
931
				Hashtable ^catText = gcnew Hashtable();
-
 
932
				CyStringList readText;
-
 
933
				if ( m_pPackages->ReadTextPage(CyStringFromSystemString(ofd->FileName), &readText, false, 17) )
-
 
934
				{
-
 
935
					for ( SStringList *str = readText.Head(); str; str = str->next )
-
 
936
					{
-
 
937
						String ^key = SystemStringFromCyString(str->str);
847
		String ^getShipSelection(CVirtualFileSystem *pVfs);
938
						if ( catText->ContainsKey(key) )
-
 
939
							catText[key] = SystemStringFromCyString(str->data);
-
 
940
						else
-
 
941
							catText->Add(key, SystemStringFromCyString(str->data));
-
 
942
					}
-
 
943
				}
-
 
944
 
848
 
945
				CyStringList list;
-
 
946
				if ( m_pPackages->LoadShipData(CyStringFromSystemString(ofd->FileName), &list) )
-
 
947
				{
-
 
948
					LoadShip ^ls = gcnew LoadShip();
-
 
949
					for ( SStringList *str = list.Head(); str; str = str->next )
-
 
950
					{
-
 
951
						int tId = str->data.GetToken(";", 7, 7).ToInt();
-
 
952
						String ^name;
-
 
953
						if ( catText->ContainsKey(Convert::ToString(tId)) )
-
 
954
							name = Convert::ToString(catText[Convert::ToString(tId)]);
-
 
955
						else
-
 
956
							name = this->FindText(-1, 17, tId);
-
 
957
						String ^text = this->FindText(-1, 1266, str->data.GetToken(";", 46, 46).ToInt()) + " " + name;
-
 
958
						int variation = str->data.GetToken(";", 51, 51).ToInt();
-
 
959
						if ( variation )
-
 
960
							text = text + " " + this->FindText(-1, 17, 10000 + variation);
-
 
961
						ls->AddShip(SystemStringFromCyString(str->str), text);
-
 
962
					}
-
 
963
 
-
 
964
					if ( ls->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
-
 
965
					{
-
 
966
						SStringList *str = list.FindString(CyStringFromSystemString(ls->GetData()));
-
 
967
						if ( str )
-
 
968
						{
-
 
969
							Creator::ImportShip ^import = gcnew Creator::ImportShip(m_pPackages, ofd->FileName, ls->GetData(), nullptr);
-
 
970
							import->ShowDialog(this);
-
 
971
							CXspFile *newShip = (import->Error()) ? NULL : import->GetShip();
-
 
972
							if ( !newShip ) {
-
 
973
								if ( MessageBox::Show(this, "There was a problem when trying to import the ship\n" + ofd->FileName + " (" + ls->GetData() + ")\n\nError: " + import->getErrorString() + "\n\nWould you like to read files from another mod as well?", "Error Importing Ship", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes ) {
-
 
974
									// load in another file
-
 
975
									System::String ^sFilename = ofd->FileName;
-
 
976
									if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK ) {
-
 
977
										Creator::ImportShip ^import = gcnew Creator::ImportShip(m_pPackages, sFilename, ls->GetData(), ofd->FileName);
-
 
978
										import->ShowDialog(this);
-
 
979
										newShip = (import->Error()) ? NULL : import->GetShip();
-
 
980
										if ( !newShip ) {
-
 
981
											MessageBox::Show(this, "There was a problem when trying to import the ship\n" + ofd->FileName + " (" + ls->GetData() + ")\n\nError: " + import->getErrorString(), "Error Importing Ship", MessageBoxButtons::OK, MessageBoxIcon::Error);
-
 
982
										}
-
 
983
									}
-
 
984
								}
-
 
985
	
-
 
986
							}
-
 
987
							if ( newShip ) {
-
 
988
								PackageForm ^childForm = this->OpenPackage(true, newShip, "", "Imported Ship");
-
 
989
								childForm->Text = "Imported Ship";
-
 
990
								newShip->SetChanged(true);
-
 
991
								childForm->UpdateChanged();
-
 
992
							}
-
 
993
						}
-
 
994
					}
-
 
995
				}
-
 
996
				else
-
 
997
					MessageBox::Show(this, "Unable to load ship data from mod file\n" + ofd->FileName, "Error Importing", MessageBoxButtons::OK, MessageBoxIcon::Error);
-
 
998
				this->UseWaitCursor = false;
-
 
999
			}
-
 
1000
		}
-
 
1001
 
849
 
1002
		void OpenDirectory(System::String ^dir)
850
		void OpenDirectory(System::String ^dir)
1003
		{
851
		{
1004
			if ( !System::IO::Directory::Exists(dir) )
852
			if ( !System::IO::Directory::Exists(dir) )
1005
			{
853
			{
Line 1289... Line 1137...
1289
			tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
1137
			tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
1290
			if ( tp->ImageIndex == -1 )
1138
			if ( tp->ImageIndex == -1 )
1291
				tp->ImageIndex = 0;
1139
				tp->ImageIndex = 0;
1292
 
1140
 
1293
			ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
1141
			ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
1294
			MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
1142
			MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1295
			
1143
			
1296
			childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
1144
			childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
1297
			this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1145
			this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1298
			childForm->WindowState = FormWindowState::Minimized;
1146
			childForm->WindowState = FormWindowState::Minimized;
1299
 
1147
 
Line 1337... Line 1185...
1337
			tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
1185
			tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
1338
			if ( tp->ImageIndex == -1 )
1186
			if ( tp->ImageIndex == -1 )
1339
				tp->ImageIndex = 0;
1187
				tp->ImageIndex = 0;
1340
 
1188
 
1341
			ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
1189
			ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
1342
			PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
1190
			PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1343
			childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
1191
			childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
1344
			this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1192
			this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1345
			childForm->WindowState = FormWindowState::Minimized;
1193
			childForm->WindowState = FormWindowState::Minimized;
1346
 
1194
 
1347
			this->ProcessOpen(false, tp, childForm);
1195
			this->ProcessOpen(false, tp, childForm);
Line 1599... Line 1447...
1599
				tp->Text = "New Ship";
1447
				tp->Text = "New Ship";
1600
			 else
1448
			 else
1601
				tp->Text = "New Package";
1449
				tp->Text = "New Package";
1602
			 ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
1450
			 ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
1603
 			 this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1451
 			 this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1604
			 PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
1452
			 PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1605
			 childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
1453
			 childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
1606
			 tp->Parent = tabControl1;
1454
			 tp->Parent = tabControl1;
1607
			 tabControl1->SelectedTab = tp;
1455
			 tabControl1->SelectedTab = tp;
1608
 
1456
 
1609
			 if ( ship )
1457
			 if ( ship )
Line 1621... Line 1469...
1621
			 TabPage ^tp = gcnew TabPage();
1469
			 TabPage ^tp = gcnew TabPage();
1622
  			 tp->ImageIndex = 0;
1470
  			 tp->ImageIndex = 0;
1623
			 tp->Text = "New Mutli Package";
1471
			 tp->Text = "New Mutli Package";
1624
			 ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
1472
			 ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
1625
 			 this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1473
 			 this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
1626
			 MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
1474
			 MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
1627
			 childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
1475
			 childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
1628
			 tp->Parent = tabControl1;
1476
			 tp->Parent = tabControl1;
1629
			 tabControl1->SelectedTab = tp;
1477
			 tabControl1->SelectedTab = tp;
1630
 
1478
 
1631
			 childForm->CreatePackage();
1479
			 childForm->CreatePackage();
Line 1784... Line 1632...
1784
					 else if ( childForm->GetFormType() == FORMTYPE_MULTI )
1632
					 else if ( childForm->GetFormType() == FORMTYPE_MULTI )
1785
						((MultiForm ^)childForm)->SaveAs();
1633
						((MultiForm ^)childForm)->SaveAs();
1786
					 else
1634
					 else
1787
						childForm->SaveAs();
1635
						childForm->SaveAs();
1788
					 this->UpdateDropDownOpen();
1636
					 this->UpdateDropDownOpen();
1789
					 break;
1637
					 break;
1790
				 }
1638
				 }
1791
			 }
1639
			 }
1792
		}
1640
		}
1793
 
1641
 
1794
		void PackageCreationWizard()
1642
		void PackageCreationWizard()
1795
		{
1643
		{
1796
			MessageBox::Show(this, "The creation wizard is currently not available", "Feature Missing", MessageBoxButtons::OK, MessageBoxIcon::Error);
1644
			MessageBox::Show(this, "The creation wizard is currently not available", "Feature Missing", MessageBoxButtons::OK, MessageBoxIcon::Error);
1797
			return;
1645
			return;
1798
 
1646
 
1799
			CreationWizard ^wizard = gcnew CreationWizard();
1647
			CreationWizard ^wizard = gcnew CreationWizard();
1800
			if ( wizard->ShowDialog(this) == Windows::Forms::DialogResult::OK )
1648
			if ( wizard->ShowDialog(this) == Windows::Forms::DialogResult::OK )
1801
			{
1649
			{
1802
			}
1650
			}
1803
		}
1651
		}
Line 1862... Line 1710...
1862
						else if ( start.Compare("GameDir") )
1710
						else if ( start.Compare("GameDir") )
1863
						{
1711
						{
1864
							SGameDir *gd = new SGameDir;
1712
							SGameDir *gd = new SGameDir;
1865
							gd->sDir = rest.GetToken(";", 1, 1);
1713
							gd->sDir = rest.GetToken(";", 1, 1);
1866
							gd->sGame = rest.GetToken(";", 2, 2);
1714
							gd->sGame = rest.GetToken(";", 2, 2);
-
 
1715
							gd->iGame = gd->sGame.GetToken(" ", 1, 1).ToInt();
-
 
1716
 
-
 
1717
							SGameExe *exe = m_pPackages->GetGameExe()->GetGame(gd->iGame);
-
 
1718
 
1867
							gd->bLoad = rest.GetToken(";", 3, 3).ToBool();
1719
							gd->bLoad = rest.GetToken(";", 3, 3).ToBool();
-
 
1720
							gd->pVfs = new CVirtualFileSystem();
-
 
1721
							gd->pVfs->setLanguage(44);
-
 
1722
							gd->pVfs->LoadFilesystem(gd->sDir.ToString());
-
 
1723
							if ( exe ) {
-
 
1724
								gd->pVfs->SetAddon(exe->sAddon.ToString());
-
 
1725
							}
1868
							m_pGameDir->push_back(gd);
1726
							m_pGameDir->push_back(gd);
1869
						}
1727
						}
1870
					}
1728
					}
1871
 
1729
 
1872
					delete lines;
1730
					delete lines;
Line 1879... Line 1737...
1879
		{
1737
		{
1880
			if ( m_bTextLoaded && !reload )
1738
			if ( m_bTextLoaded && !reload )
1881
				return;
1739
				return;
1882
			m_bTextLoaded = true;
1740
			m_bTextLoaded = true;
1883
 
1741
 
1884
			textList->Clear();
-
 
1885
			if ( m_pGameDir->empty() )
1742
			if ( m_pGameDir->empty() )
1886
				return;
1743
				return;
1887
 
1744
 
1888
			Creator::LoadText ^load = gcnew Creator::LoadText(m_pGameDir, m_pPackages, textList);
1745
			Creator::LoadText ^load = gcnew Creator::LoadText(m_pGameDir, m_pPackages);
1889
			if ( center )
1746
			if ( center )
1890
				load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
1747
				load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
1891
			
1748
			
1892
			load->ShowDialog(this);
1749
			load->ShowDialog(this);
1893
		}
1750
		}
Line 1972... Line 1829...
1972
			this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
1829
			this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
1973
			this->imageListSmall = (gcnew System::Windows::Forms::ImageList(this->components));
1830
			this->imageListSmall = (gcnew System::Windows::Forms::ImageList(this->components));
1974
			this->imageListLarge = (gcnew System::Windows::Forms::ImageList(this->components));
1831
			this->imageListLarge = (gcnew System::Windows::Forms::ImageList(this->components));
1975
			this->imageListFiles = (gcnew System::Windows::Forms::ImageList(this->components));
1832
			this->imageListFiles = (gcnew System::Windows::Forms::ImageList(this->components));
1976
			this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
1833
			this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
-
 
1834
			this->importShipFromVFSToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
1977
			this->menuStrip1->SuspendLayout();
1835
			this->menuStrip1->SuspendLayout();
1978
			this->PanelTab->SuspendLayout();
1836
			this->PanelTab->SuspendLayout();
1979
			this->toolStrip1->SuspendLayout();
1837
			this->toolStrip1->SuspendLayout();
1980
			this->statusStrip1->SuspendLayout();
1838
			this->statusStrip1->SuspendLayout();
1981
			this->SuspendLayout();
1839
			this->SuspendLayout();
Line 2248... Line 2106...
2248
			this->toolStrip1->TabIndex = 7;
2106
			this->toolStrip1->TabIndex = 7;
2249
			this->toolStrip1->Text = L"toolStrip1";
2107
			this->toolStrip1->Text = L"toolStrip1";
2250
			// 
2108
			// 
2251
			// toolStripButton1
2109
			// toolStripButton1
2252
			// 
2110
			// 
2253
			this->toolStripButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(9) {this->packageToolStripMenuItem1, 
2111
			this->toolStripButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(10) {this->packageToolStripMenuItem1, 
2254
				this->shipToolStripMenuItem1, this->multiPackageToolStripMenuItem, this->toolStripSeparator4, this->fromPackagerScriptToolStripMenuItem, 
2112
				this->shipToolStripMenuItem1, this->multiPackageToolStripMenuItem, this->toolStripSeparator4, this->fromPackagerScriptToolStripMenuItem, 
2255
				this->fromArchiveToolStripMenuItem, this->importShipFromModToolStripMenuItem, this->toolStripSeparator7, this->packageCreationWizardToolStripMenuItem1});
2113
				this->fromArchiveToolStripMenuItem, this->importShipFromModToolStripMenuItem, this->importShipFromVFSToolStripMenuItem, this->toolStripSeparator7, 
-
 
2114
				this->packageCreationWizardToolStripMenuItem1});
2256
			this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripButton1.Image")));
2115
			this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripButton1.Image")));
2257
			this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
2116
			this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
2258
			this->toolStripButton1->Name = L"toolStripButton1";
2117
			this->toolStripButton1->Name = L"toolStripButton1";
2259
			this->toolStripButton1->Size = System::Drawing::Size(76, 36);
2118
			this->toolStripButton1->Size = System::Drawing::Size(76, 36);
2260
			this->toolStripButton1->Text = L"New";
2119
			this->toolStripButton1->Text = L"New";
Line 2508... Line 2367...
2508
			// 
2367
			// 
2509
			this->backgroundWorker1->WorkerReportsProgress = true;
2368
			this->backgroundWorker1->WorkerReportsProgress = true;
2510
			this->backgroundWorker1->WorkerSupportsCancellation = true;
2369
			this->backgroundWorker1->WorkerSupportsCancellation = true;
2511
			this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &Form1::backgroundWorker1_DoWork);
2370
			this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &Form1::backgroundWorker1_DoWork);
2512
			this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &Form1::backgroundWorker1_RunWorkerCompleted);
2371
			this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &Form1::backgroundWorker1_RunWorkerCompleted);
-
 
2372
			// 
-
 
2373
			// importShipFromVFSToolStripMenuItem
-
 
2374
			// 
-
 
2375
			this->importShipFromVFSToolStripMenuItem->Name = L"importShipFromVFSToolStripMenuItem";
-
 
2376
			this->importShipFromVFSToolStripMenuItem->Size = System::Drawing::Size(221, 38);
-
 
2377
			this->importShipFromVFSToolStripMenuItem->Text = L"Import Ship from VFS";
-
 
2378
			this->importShipFromVFSToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::importShipFromVFSToolStripMenuItem_Click);
2513
			// 
2379
			// 
2514
			// Form1
2380
			// Form1
2515
			// 
2381
			// 
2516
			this->AllowDrop = true;
2382
			this->AllowDrop = true;
2517
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
2383
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
Line 2537... Line 2403...
2537
			this->toolStrip1->PerformLayout();
2403
			this->toolStrip1->PerformLayout();
2538
			this->statusStrip1->ResumeLayout(false);
2404
			this->statusStrip1->ResumeLayout(false);
2539
			this->statusStrip1->PerformLayout();
2405
			this->statusStrip1->PerformLayout();
2540
			this->ResumeLayout(false);
2406
			this->ResumeLayout(false);
2541
			this->PerformLayout();
2407
			this->PerformLayout();
2542
 
2408
 
2543
		}
2409
		}
2544
#pragma endregion
2410
#pragma endregion
2545
	private: System::Void cascadeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2411
	private: System::Void cascadeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2546
				 this->LayoutMdi(MdiLayout::Cascade);
2412
				 this->LayoutMdi(MdiLayout::Cascade);
2547
			 }
2413
			 }
2548
private: System::Void horizontalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2414
private: System::Void horizontalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2549
			 this->LayoutMdi(MdiLayout::TileHorizontal);
2415
			 this->LayoutMdi(MdiLayout::TileHorizontal);
2550
		 }
2416
		 }
2551
private: System::Void verticalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2417
private: System::Void verticalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2552
			 this->LayoutMdi(MdiLayout::TileVertical);
2418
			 this->LayoutMdi(MdiLayout::TileVertical);
2553
		 }
2419
		 }
2554
private: System::Void tabControl1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
2420
private: System::Void tabControl1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
2555
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
2421
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
2556
			 for ( int i = 0; i < children->Length; i++ )
2422
			 for ( int i = 0; i < children->Length; i++ )
2557
			 {
2423
			 {
2558
				 BaseForm ^childForm = (BaseForm ^)children[i];
2424
				 BaseForm ^childForm = (BaseForm ^)children[i];
Line 2566... Line 2432...
2566
		 }
2432
		 }
2567
private: System::Void packageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2433
private: System::Void packageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2568
			 this->NewPackage(false);
2434
			 this->NewPackage(false);
2569
		 }
2435
		 }
2570
private: System::Void shipToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2436
private: System::Void shipToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2571
			 this->NewPackage(true);
2437
			 this->NewPackage(true);
2572
		 }
2438
		 }
2573
private: System::Void exitToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2439
private: System::Void exitToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2574
			 this->Close();
2440
			 this->Close();
2575
		 }
2441
		 }
2576
private: System::Void saveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2442
private: System::Void saveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
Line 2653... Line 2519...
2653
private: System::Void fromPackagerScriptToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2519
private: System::Void fromPackagerScriptToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2654
			 this->OpenPackagerScript();
2520
			 this->OpenPackagerScript();
2655
		 }
2521
		 }
2656
private: System::Void Form1_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
2522
private: System::Void Form1_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
2657
			e->Effect = DragDropEffects::None;
2523
			e->Effect = DragDropEffects::None;
2658
 
2524
 
2659
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
2525
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
2660
			{
2526
			{
2661
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
2527
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
2662
				int i;
2528
				int i;
2663
				for(i = 0; i < a->Length; i++)
2529
				for(i = 0; i < a->Length; i++)
Line 2711... Line 2577...
2711
private: System::Void generatePackageWebListToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2577
private: System::Void generatePackageWebListToolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
2712
			 GeneratePackageWebList();
2578
			 GeneratePackageWebList();
2713
		 }
2579
		 }
2714
private: System::Void generatePackageWebListToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2580
private: System::Void generatePackageWebListToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2715
			 GeneratePackageWebList();
2581
			 GeneratePackageWebList();
2716
		 }
2582
		 }
2717
private: System::Void fromArchiveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2583
private: System::Void fromArchiveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2718
			 OpenArchive();
2584
			 OpenArchive();
2719
		 }
2585
		 }
2720
private: System::Void backgroundWorker1_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
2586
private: System::Void backgroundWorker1_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
2721
			 Threading::Thread::Sleep(500);
2587
			 Threading::Thread::Sleep(500);
2722
			 m_pConverted = m_pPackages->CreateFromArchive(CyStringFromSystemString(m_sConvertFile));
2588
			 m_pConverted = m_pPackages->CreateFromArchive(CyStringFromSystemString(m_sConvertFile));
2723
		 }
2589
		 }
2724
private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^  sender, System::ComponentModel::RunWorkerCompletedEventArgs^  e) {
2590
private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^  sender, System::ComponentModel::RunWorkerCompletedEventArgs^  e) {
2725
			 if ( m_pWait ) 
2591
			 if ( m_pWait ) 
2726
			 {
2592
			 {
2727
				 m_pWait->Close();
2593
				 m_pWait->Close();
2728
				 delete m_pWait;
2594
				 delete m_pWait;
Line 2740... Line 2606...
2740
private: System::Void generatePackageUpdatesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2606
private: System::Void generatePackageUpdatesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2741
			 GeneratePackageUpdates();
2607
			 GeneratePackageUpdates();
2742
		 }
2608
		 }
2743
private: System::Void fileExplorerToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2609
private: System::Void fileExplorerToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
2744
			 OpenFileExplorer();
2610
			 OpenFileExplorer();
-
 
2611
		 }
-
 
2612
private: System::Void importShipFromVFSToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
-
 
2613
			 ImportShipFromVFS();
2745
		 }
2614
		 }
2746
};
2615
};
2747
}
2616
}
2748
 
2617