Subversion Repositories spk

Rev

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

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
using namespace System;
4
using namespace System::ComponentModel;
5
using namespace System::Collections;
6
using namespace System::Windows::Forms;
7
using namespace System::Data;
8
using namespace System::Drawing;
9
 
10
#include <spk.h>
11
 
12
using namespace System;
13
using namespace System::ComponentModel;
14
using namespace System::Collections;
15
using namespace System::Windows::Forms;
16
using namespace System::Data;
17
using namespace System::Drawing;
18
using namespace System::Threading;
19
 
20
#include "About.h"
21
#include "PackageInstalled.h"
22
#include "GameLauncherFlags.h"
23
#include "FakePatchControl.h"
2 cycrow 24
//TODO: remove this, move to a generic shared space
25
#include "..\..\SpkExplorer\src\Forms\PackageInfo.h"
1 cycrow 26
#include "CheckUpdate.h"
27
#include "MenuBar.h"
2 cycrow 28
//TODO: remove this, move to a generic shared space
29
#include "..\..\Creator\src\Forms\Waiting.h"
1 cycrow 30
 
31
enum {MGUI_BACKGROUND_NONE, MGUI_BACKGROUND_INSTALL, MGUI_BACKGROUND_UNINSTALL, MGUI_BACKGROUND_DISABLE, MGUI_BACKGROUND_CHANGEDIR, MGUI_BACKGROUND_ADDDIR, MGUI_BACKGROUND_INSTALLBUILTIN, MGUI_BACKGROUND_REMOVEDIR};
32
enum {SORT_NAME, SORT_AUTHOR, SORT_VERSION, SORT_CREATED, SORT_TYPE, SORT_ENABLE, SORT_SIGNED};
33
 
34
#define MAXTIPS 1
35
 
36
#define TIPSECTION_YESNO		0
37
 
38
#define TIP_NONE				0
39
#define TIP_SHIPUNINSTALL		1
40
#define TIP_SHIPDISABLE			2
41
 
42
namespace PluginManager {
43
 
44
	/// <summary>
45
	/// Summary for MainGui
46
	///
47
	/// WARNING: If you change the name of this class, you will need to change the
48
	///          'Resource File Name' property for the managed resource compiler tool
49
	///          associated with all .resx files this class depends on.  Otherwise,
50
	///          the designers will not be able to interact properly with localized
51
	///          resources associated with this form.
52
	/// </summary>
53
	public ref class MainGui : public System::Windows::Forms::Form
54
	{
55
	public:
56
		MainGui(CPackages *p, CyStringList *list, CyStringList *removed, bool advanced)
57
		{
58
			InitializeComponent();
59
 
60
			// additional controls
61
			m_pMenuBar = gcnew MenuBar(this, advanced);
62
			m_pWait = nullptr;
63
 
64
			m_bAdvanced = advanced;
65
			m_iSaveGameManager = -1;
66
 
67
			m_lTips = gcnew ArrayList();
68
			for ( int i = 0; i < MAXTIPS; i++ )
69
			{
70
				STips ^t = gcnew STips;
71
				t->iTips = 0;
72
				m_lTips->Add(t);
73
				this->SetTipStrings(i);
74
			}
75
 
76
			// set  pointers
77
			m_pPackages = p;
78
			m_pDirList = list;
79
			m_pRemovedDirList = removed;
80
			m_pUpdateList = NULL;
81
			m_pListItem = nullptr;
82
			m_pFileErrors = new CyStringList;
83
			m_bDirLocked = false;
84
 
85
			// default values
86
			m_iBackgroundTask = MGUI_BACKGROUND_NONE;
87
			m_bSortingAsc = true;
88
			m_iSortingColumn = SORT_NAME;
89
			m_bExperimental = m_bCheat = m_bModSelectorDetails = m_bShips = m_bDownloadable = m_bSigned = false;
90
			m_bAutoUpdate = true;
91
			m_bRunningBackground = false;
92
			m_bDisplayDialog = false;
93
			m_bDisplayMessage = false;
94
 
95
			m_sGameArgs = "-noabout";
96
			m_pLauncherFlags = new SGameLauncherFlags;
97
			m_pLauncherFlags->iIgnoreJoy = 0;
98
			m_pLauncherFlags->bNoAbout = true;
99
 
100
			m_iSizeX = -1;
101
			m_iSizeY = -1;
102
 
103
			this->Text = GetProgramName(m_bAdvanced) + " " + GetVersionString();
104
 
105
			// update the gui
106
			this->UpdateControls();
107
 
108
			// update the display
109
			this->UpdateDirList();
110
			this->UpdatePackages();
111
 
112
			// setup the events
113
			this->SetupEventHandlers();
114
 
115
			//this->ButRun->Hide();
116
		}
117
 
118
		void DisplayLocked(bool inthread);
119
		void GetGameDirs(CyString &dir, bool askDir, bool askDirAddon);
120
		void CheckProtectedDir();
121
		void PrepareSaveGameManager()
122
		{
123
			// copy save games to each game dir
124
		}
125
 
126
		void InstallArchive()
127
		{
128
			if ( m_bDirLocked ) {
129
				this->DisplayLocked(false);
130
				return;
131
			}
132
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
133
			ofd->Filter = "All Supported Archives|*.zip; *.rar|Zip Archive (*.zip)|*.zip|Rar Archive (*.rar)|*.rar";
134
			ofd->Title = "Select archive file you wish to install";
135
			ofd->FilterIndex = 1;
136
			ofd->RestoreDirectory = true;
137
			ofd->Multiselect = false;
138
 
139
			if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
140
			{
141
				m_sConvertFile = ofd->FileName;
142
				m_pWait = gcnew Creator::Waiting("Converting: " + IO::FileInfo(m_sConvertFile).Name);
143
				this->backgroundWorker2->RunWorkerAsync();
144
				m_pWait->ShowDialog(this);
145
			}
146
		}
147
 
148
		void AboutDialog()
149
		{
150
			 CBaseFile *pm = m_pPackages->FindScriptByAuthor("PluginManager");
151
			 System::String ^scriptVer = "None";
152
			 if ( pm )
153
			 {
154
				 scriptVer = SystemStringFromCyString(pm->GetVersion());
155
				 if ( !pm->GetCreationDate().Empty() )
156
					scriptVer += " (" + SystemStringFromCyString(pm->GetCreationDate()) + ")";
157
			 }
158
			About ^about = gcnew About(GetVersionString(), PMLDATE, scriptVer, m_bAdvanced);
159
			about->ShowDialog(this);
160
		}
161
 
162
		// config
163
		void SetSize(int x, int y) { m_iSizeX = x; m_iSizeY = y; }
164
		void SetTipStrings(int section);
165
		void SetTips(int tip, int done)
166
		{
167
			if ( tip < 0 )
168
				return;
169
			if ( tip > (int)MAXTIPS )
170
				return;
171
			((STips ^)m_lTips[tip])->iTips = done;
172
		}
173
		void SetSaveGameManager(int i) { m_iSaveGameManager = i; }
174
		void SetExperimental(bool b) { m_bExperimental = b; }
175
		void SetShips(bool b) { m_bShips = b; }
176
		void SetOnlySigned(bool b) { m_bSigned = b; }
177
		void SetCheat(bool b) { m_bCheat = b; }
178
		void SetDownloadable(bool b) { m_bDownloadable = b; }
179
		void SetModSelectorDetails(bool b) { m_bModSelectorDetails = b; }
180
		void SetAutoUpdate(bool b) { m_bAutoUpdate = b; }
181
		void SetIgnoreJoy(long j) { m_pLauncherFlags->iIgnoreJoy = j; }
182
		void ForceEMP(bool b) { m_pPackages->SetForceEMP(b); }
183
 
184
		int GetSaveGameManager() { return m_iSaveGameManager; }
185
		bool IsModSelectorDetailsShowing() { return m_bModSelectorDetails; }
186
		bool IsShips() { return m_bShips; }
187
		bool IsOnlySigned() { return m_bSigned; }
188
		bool IsExperimental() { return m_bExperimental; }
189
		bool IsCheat() { return m_bCheat; }
190
		bool IsDownloadable() { return m_bDownloadable; }
191
		bool IsAutoUpdate() { return m_bAutoUpdate; }
192
		int GetTips(int tip)
193
		{
194
			if ( tip < 0 || tip >= MAXTIPS )
195
				return -1;
196
			return ((STips ^)m_lTips[tip])->iTips;
197
		}
198
		int GetMaxTips() { return (int)MAXTIPS; }
199
		long GetIgnoreJoy() { return m_pLauncherFlags->iIgnoreJoy; }
200
 
201
		// gui updates
202
		void UpdateDirList();
203
		void UpdatePackages();
204
		void UpdateControls();
205
		bool UpdateBuiltInPackages();
206
 
207
		// auto update
208
		void AutoUpdate();
209
		System::String ^GetDownloadFile() { return m_sDownload; }
210
 
211
		// Run
212
		System::String ^GetRunFile() { return m_sRun; }
213
		System::String ^GetGameArgs() { return m_sGameArgs; }
214
 
215
		// setup functions
216
		void SetupEventHandlers();
217
		void StartCheckTimer();
218
 
219
		// control functions
220
		bool InstallPackage(System::String ^file, bool straightAway, bool builtin, bool background);
221
		void ChangeDirectory(CyString dir);
222
 
223
		void SetGameArgs(System::String ^args) { m_sGameArgs = args; }
224
		void AddGameArgs(System::String ^args) { m_sGameArgs += " " + args; }
225
 
226
		bool DisplayTip(int tipsection, int tip);
227
		void CheckUnusedShared();
228
 
229
		bool CheckAccessRights(String ^dir);
230
		void ClearSelectedItems();
231
		void CheckFakePatchCompatability();
232
 
233
		void PackageUpdates()
234
		{
235
			CheckUpdate ^update = gcnew CheckUpdate(m_pPackages, this->imageList1);
236
			this->ClearSelectedItems();
237
			if ( update->ShowDialog(this) == Windows::Forms::DialogResult::OK )
238
			{
239
				for ( int i = 0; i < update->GetInstallList()->Count; i++ )
240
					this->InstallPackage(Convert::ToString(update->GetInstallList()[i]), false, false, true);
241
				this->StartInstalling(false, true);
242
			}
243
		}
244
 
245
		// external control events
246
		void InstallEvent(System::Object ^Sender, System::EventArgs ^E);
247
		void VanillaEvent(System::Object ^Sender, System::EventArgs ^E);
248
		void ModifiedEvent(System::Object ^Sender, System::EventArgs ^E);
249
		void AddDirectoryEvent(System::Object ^Sender, System::EventArgs ^E);
250
		void ModSelectorEvent(System::Object ^Sender, System::EventArgs ^E);
251
		void PackageBrowserEvent(System::Object ^Sender, System::EventArgs ^E);
252
 
253
		void FindPackagesOnline();
254
		void ViewFileLog();
255
		void EditGlobalsDialog();
256
		void FakePatchControlDialog();
257
		void RemoveDirectory();
258
		void ExportPackageList();
259
		void VerifyInstalledFiles();
260
		CPackages *GetPackageControl() { return m_pPackages; }
261
 
262
	protected:
263
		/// <summary>
264
		/// Clean up any resources being used.
265
		/// </summary>
266
		~MainGui()
267
		{
268
			if (components)
269
			{
270
				delete components;
271
			}
272
			delete m_pFileErrors;
273
			delete m_pLauncherFlags;
274
		}
275
 
276
	private:
277
		// Events
278
		void ClosedEvent(System::Object ^Sender, System::EventArgs ^E) { this->Close(); }
279
		void PackageListSelected(System::Object ^Sender, System::EventArgs ^E);
280
		void PackageListSort(System::Object ^Sender, ColumnClickEventArgs ^E);
281
		void UninstallEvent(System::Object ^Sender, System::EventArgs ^E);
282
		void DisableEvent(System::Object ^Sender, System::EventArgs ^E);
283
		void ChangeDirectoryEvent(System::Object ^Sender, System::EventArgs ^E);
284
		void Background_DoWork(System::Object ^Sender, DoWorkEventArgs ^E);
285
		void Background_Progress(System::Object ^Sender, ProgressChangedEventArgs ^E);
286
		void Background_Finished(System::Object ^Sender, RunWorkerCompletedEventArgs ^E) { this->Background_Finished(); }
287
		void Background_Finished();
288
		void CloseEvent(System::Object ^Sender, FormClosingEventArgs ^E);
289
		void Updater_Finished(System::Object ^Sender, RunWorkerCompletedEventArgs ^E);
290
		void Updater_DoWork(System::Object ^Sender, DoWorkEventArgs ^E);
291
		void TimerEvent_CheckFile(System::Object ^Sender, System::EventArgs ^E);
292
		void RunItem(System::Object ^sender, System::EventArgs ^e);
293
 
294
		ListViewItem ^FindSelectedItem();
295
		CBaseFile *GetFileFromItem(ListViewItem ^item);
296
 
297
		System::Void OpenContextMenu(System::Object ^Sender, CancelEventArgs ^E);
298
		void _DisplayPackages(CBaseFile *currentParent, ListViewGroup ^addGroup);
299
 
300
		void UpdateRunButton();
301
		bool EnablePackage(CBaseFile *p);
302
		bool StartInstallingArchive(bool builtin, bool background) { return StartInstalling(builtin, background, true); }
303
		bool StartInstalling(bool builtin, bool background) { return StartInstalling(builtin, background, false); }
304
		bool StartInstalling(bool builtin, bool background, bool archive);
305
		void DoInstall(bool builtin, bool frombackground);
306
		void DoUninstall();
307
		void DoDisable();
308
		bool RemoveCurrentDirectory();
309
		CBaseFile *FindPackageFromList(ListViewItem ^item);
310
 
311
		bool StartBackground(int type);
312
		bool StartBackground(int type, System::String ^info);
313
		void LaunchGame();
314
		System::Windows::Forms::DialogResult DisplayMessageBox(bool inthread, System::String ^title, System::String ^text, MessageBoxButtons buttons, MessageBoxIcon icon);
315
 
316
		void DisableList(ArrayList ^List);
317
		void UninstallList(ArrayList ^List);
318
 
319
		void RunFromToolItem(ToolStripMenuItem ^item);
320
 
321
		MenuBar			^m_pMenuBar;
322
		CPackages		*m_pPackages;
323
		CyStringList	*m_pDirList;
324
		CyStringList	*m_pRemovedDirList;
325
		CyStringList	*m_pUpdateList;
326
		CyStringList	*m_pFileErrors;
327
		int				 m_iBackgroundTask;
328
		int				 m_iSortingColumn;
329
		bool			 m_bSortingAsc;
330
 
331
		bool			 m_bSigned;
332
		bool			 m_bShips;
333
		bool			 m_bExperimental;
334
		bool			 m_bCheat;
335
		bool			 m_bDownloadable;
336
		bool			 m_bModSelectorDetails;
337
		bool			 m_bAutoUpdate;
338
		bool			 m_bRunningBackground;
339
		bool			 m_bAdvanced;
340
		bool			 m_bDirLocked;
341
 
342
		System::String	^m_sBackgroundInfo;
343
		System::String	^m_sDownload;
344
		System::String	^m_sRun;
345
		System::String	^m_sGameArgs;
346
 
347
		PackageInstalled ^m_pPi;
348
		bool			m_bDisplayDialog;
349
		bool			m_bDisplayMessage;
350
		System::String ^m_sMessageTitle;
351
		System::String ^m_sMessageText;
352
		MessageBoxIcon  m_messageIcon;
353
		MessageBoxButtons m_messageButtons;
354
 
355
		int			m_iSizeX;
356
		int			m_iSizeY;
357
 
358
		SGameLauncherFlags *m_pLauncherFlags;
359
 
360
		ArrayList ^m_lTips;
361
		ListViewItem						^m_pListItem;
362
 
363
		int			m_iSaveGameManager;
364
		String			^m_sConvertFile;
365
		Creator::Waiting	^m_pWait;
366
		CArchiveFile	*m_pConverted;
367
 
368
	private:
369
	private:
370
	private: System::Windows::Forms::GroupBox^  GroupDir;
371
	private: System::Windows::Forms::ComboBox^  ComboDir;
372
	private: System::Windows::Forms::ListView^  ListPackages;
373
	private: System::Windows::Forms::ColumnHeader^  columnHeader1;
374
	private: System::Windows::Forms::ColumnHeader^  columnHeader2;
375
	private: System::Windows::Forms::ColumnHeader^  columnHeader3;
376
	private: System::Windows::Forms::ColumnHeader^  columnHeader4;
377
	private: System::Windows::Forms::ColumnHeader^  columnHeader5;
378
	private: System::Windows::Forms::Panel^  panel1;
379
	private: System::Windows::Forms::Button^  ButClose;
380
	private: System::Windows::Forms::GroupBox^  GroupPackages;
381
	private: System::Windows::Forms::ProgressBar^  ProgressBar;
382
	private: System::Windows::Forms::Panel^  panel2;
383
	private: System::Windows::Forms::Button^  ButUninstall;
384
	private: System::Windows::Forms::Button^  ButDisable;
385
	private: System::Windows::Forms::Button^  ButInstall;
386
	private: System::ComponentModel::BackgroundWorker^  backgroundWorker1;
387
private: System::Windows::Forms::RichTextBox^  TextDesc;
388
private: System::Windows::Forms::Panel^  PanelDisplay;
389
private: System::Windows::Forms::PictureBox^  PictureDisplay;
390
private: System::ComponentModel::BackgroundWorker^  backgroundUpdater;
391
private: System::Windows::Forms::Button^  ButRun;
392
private: System::Windows::Forms::StatusStrip^  statusStrip1;
393
private: System::Windows::Forms::ToolStripStatusLabel^  LabelStatus;
394
private: System::Windows::Forms::ContextMenuStrip^  contextMenuStrip1;
395
private: System::Windows::Forms::ToolStripMenuItem^  uninstallToolStripMenuItem;
396
private: System::Windows::Forms::ToolStripSeparator^  ContextSeperator;
397
private: System::Windows::Forms::ToolStripMenuItem^  ContextEnable;
398
private: System::Windows::Forms::ToolStripMenuItem^  ContextDisable;
399
private: System::Windows::Forms::ToolStripMenuItem^  ContextName;
400
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;
401
private: System::Windows::Forms::ImageList^  imageList1;
402
private: System::Windows::Forms::ToolStripMenuItem^  UninstallSelectedContext;
403
private: System::Windows::Forms::ColumnHeader^  columnHeader6;
404
private: System::Windows::Forms::ToolStripMenuItem^  viewReadmeToolStripMenuItem;
405
private: System::Windows::Forms::ToolStripMenuItem^  extrasToolStripMenuItem;
406
private: System::Windows::Forms::ImageList^  imageList2;
407
private: System::Windows::Forms::ImageList^  imageList3;
408
private: System::Windows::Forms::ToolStripSeparator^  ContextSeperator2;
409
private: System::Windows::Forms::ToolStripMenuItem^  emailAuthorToolStripMenuItem;
410
private: System::Windows::Forms::ToolStripMenuItem^  visitForumPageToolStripMenuItem;
411
private: System::Windows::Forms::ToolStripMenuItem^  visitWebSiteToolStripMenuItem;
412
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
413
private: System::Windows::Forms::ToolStripMenuItem^  checkForUpdatesToolStripMenuItem;
414
private: System::Windows::Forms::Button^  button1;
415
private: System::ComponentModel::BackgroundWorker^  backgroundWorker2;
416
 
417
private: System::ComponentModel::IContainer^  components;
418
		 /// <summary>
419
		/// Required designer variable.
420
		/// </summary>
421
 
422
 
423
#pragma region Windows Form Designer generated code
424
		/// <summary>
425
		/// Required method for Designer support - do not modify
426
		/// the contents of this method with the code editor.
427
		/// </summary>
428
		void InitializeComponent(void)
429
		{
430
			this->components = (gcnew System::ComponentModel::Container());
431
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(MainGui::typeid));
432
			this->GroupDir = (gcnew System::Windows::Forms::GroupBox());
433
			this->ComboDir = (gcnew System::Windows::Forms::ComboBox());
434
			this->ListPackages = (gcnew System::Windows::Forms::ListView());
435
			this->columnHeader1 = (gcnew System::Windows::Forms::ColumnHeader());
436
			this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
437
			this->columnHeader3 = (gcnew System::Windows::Forms::ColumnHeader());
438
			this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());
439
			this->columnHeader6 = (gcnew System::Windows::Forms::ColumnHeader());
440
			this->columnHeader5 = (gcnew System::Windows::Forms::ColumnHeader());
441
			this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
442
			this->ContextName = (gcnew System::Windows::Forms::ToolStripMenuItem());
443
			this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
444
			this->uninstallToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
445
			this->UninstallSelectedContext = (gcnew System::Windows::Forms::ToolStripMenuItem());
446
			this->ContextEnable = (gcnew System::Windows::Forms::ToolStripMenuItem());
447
			this->ContextDisable = (gcnew System::Windows::Forms::ToolStripMenuItem());
448
			this->ContextSeperator = (gcnew System::Windows::Forms::ToolStripSeparator());
449
			this->viewReadmeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
450
			this->extrasToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
451
			this->ContextSeperator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
452
			this->emailAuthorToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
453
			this->visitForumPageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
454
			this->visitWebSiteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
455
			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
456
			this->checkForUpdatesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
457
			this->panel1 = (gcnew System::Windows::Forms::Panel());
458
			this->ProgressBar = (gcnew System::Windows::Forms::ProgressBar());
459
			this->ButRun = (gcnew System::Windows::Forms::Button());
460
			this->ButClose = (gcnew System::Windows::Forms::Button());
461
			this->GroupPackages = (gcnew System::Windows::Forms::GroupBox());
462
			this->PanelDisplay = (gcnew System::Windows::Forms::Panel());
463
			this->TextDesc = (gcnew System::Windows::Forms::RichTextBox());
464
			this->PictureDisplay = (gcnew System::Windows::Forms::PictureBox());
465
			this->panel2 = (gcnew System::Windows::Forms::Panel());
466
			this->button1 = (gcnew System::Windows::Forms::Button());
467
			this->ButUninstall = (gcnew System::Windows::Forms::Button());
468
			this->ButDisable = (gcnew System::Windows::Forms::Button());
469
			this->ButInstall = (gcnew System::Windows::Forms::Button());
470
			this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
471
			this->backgroundUpdater = (gcnew System::ComponentModel::BackgroundWorker());
472
			this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
473
			this->LabelStatus = (gcnew System::Windows::Forms::ToolStripStatusLabel());
474
			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
475
			this->imageList2 = (gcnew System::Windows::Forms::ImageList(this->components));
476
			this->imageList3 = (gcnew System::Windows::Forms::ImageList(this->components));
477
			this->backgroundWorker2 = (gcnew System::ComponentModel::BackgroundWorker());
478
			this->GroupDir->SuspendLayout();
479
			this->contextMenuStrip1->SuspendLayout();
480
			this->panel1->SuspendLayout();
481
			this->GroupPackages->SuspendLayout();
482
			this->PanelDisplay->SuspendLayout();
483
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->PictureDisplay))->BeginInit();
484
			this->panel2->SuspendLayout();
485
			this->statusStrip1->SuspendLayout();
486
			this->SuspendLayout();
487
			// 
488
			// GroupDir
489
			// 
490
			this->GroupDir->Controls->Add(this->ComboDir);
491
			this->GroupDir->Dock = System::Windows::Forms::DockStyle::Top;
492
			this->GroupDir->Location = System::Drawing::Point(0, 0);
493
			this->GroupDir->Name = L"GroupDir";
494
			this->GroupDir->Padding = System::Windows::Forms::Padding(5);
495
			this->GroupDir->Size = System::Drawing::Size(626, 52);
496
			this->GroupDir->TabIndex = 0;
497
			this->GroupDir->TabStop = false;
498
			this->GroupDir->Text = L"Current Directory";
499
			// 
500
			// ComboDir
501
			// 
502
			this->ComboDir->Dock = System::Windows::Forms::DockStyle::Fill;
503
			this->ComboDir->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
504
			this->ComboDir->FormattingEnabled = true;
505
			this->ComboDir->Location = System::Drawing::Point(5, 18);
506
			this->ComboDir->Margin = System::Windows::Forms::Padding(10);
507
			this->ComboDir->Name = L"ComboDir";
508
			this->ComboDir->Size = System::Drawing::Size(616, 21);
509
			this->ComboDir->TabIndex = 0;
510
			// 
511
			// ListPackages
512
			// 
513
			this->ListPackages->AllowDrop = true;
514
			this->ListPackages->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(6) {this->columnHeader1, 
515
				this->columnHeader2, this->columnHeader3, this->columnHeader4, this->columnHeader6, this->columnHeader5});
516
			this->ListPackages->ContextMenuStrip = this->contextMenuStrip1;
517
			this->ListPackages->Dock = System::Windows::Forms::DockStyle::Fill;
518
			this->ListPackages->FullRowSelect = true;
519
			this->ListPackages->HideSelection = false;
520
			this->ListPackages->Location = System::Drawing::Point(3, 16);
521
			this->ListPackages->Name = L"ListPackages";
522
			this->ListPackages->ShowItemToolTips = true;
523
			this->ListPackages->Size = System::Drawing::Size(620, 386);
524
			this->ListPackages->TabIndex = 0;
525
			this->ListPackages->UseCompatibleStateImageBehavior = false;
526
			this->ListPackages->View = System::Windows::Forms::View::Details;
527
			this->ListPackages->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &MainGui::ListPackages_MouseDoubleClick);
528
			this->ListPackages->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &MainGui::ListPackages_DragDrop);
529
			this->ListPackages->DragOver += gcnew System::Windows::Forms::DragEventHandler(this, &MainGui::ListPackages_DragOver);
530
			// 
531
			// columnHeader1
532
			// 
533
			this->columnHeader1->Text = L"Package";
534
			// 
535
			// columnHeader2
536
			// 
537
			this->columnHeader2->Text = L"Author";
538
			// 
539
			// columnHeader3
540
			// 
541
			this->columnHeader3->Text = L"Version";
542
			this->columnHeader3->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
543
			// 
544
			// columnHeader4
545
			// 
546
			this->columnHeader4->Text = L"Updated";
547
			// 
548
			// columnHeader6
549
			// 
550
			this->columnHeader6->DisplayIndex = 5;
551
			this->columnHeader6->Text = L"Type";
552
			// 
553
			// columnHeader5
554
			// 
555
			this->columnHeader5->DisplayIndex = 4;
556
			this->columnHeader5->Text = L"Enabled";
557
			this->columnHeader5->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
558
			// 
559
			// contextMenuStrip1
560
			// 
561
			this->contextMenuStrip1->ImageScalingSize = System::Drawing::Size(24, 24);
562
			this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(15) {this->ContextName, 
563
				this->toolStripSeparator3, this->uninstallToolStripMenuItem, this->UninstallSelectedContext, this->ContextEnable, this->ContextDisable, 
564
				this->ContextSeperator, this->viewReadmeToolStripMenuItem, this->extrasToolStripMenuItem, this->ContextSeperator2, this->emailAuthorToolStripMenuItem, 
565
				this->visitForumPageToolStripMenuItem, this->visitWebSiteToolStripMenuItem, this->toolStripSeparator2, this->checkForUpdatesToolStripMenuItem});
566
			this->contextMenuStrip1->Name = L"contextMenuStrip1";
567
			this->contextMenuStrip1->Size = System::Drawing::Size(216, 600);
568
			this->contextMenuStrip1->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &MainGui::contextMenuStrip1_Opening);
569
			// 
570
			// ContextName
571
			// 
572
			this->ContextName->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ContextName.Image")));
573
			this->ContextName->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
574
			this->ContextName->Name = L"ContextName";
575
			this->ContextName->Size = System::Drawing::Size(215, 50);
576
			this->ContextName->Text = L"Name";
577
			this->ContextName->Click += gcnew System::EventHandler(this, &MainGui::ContextName_Click);
578
			// 
579
			// toolStripSeparator3
580
			// 
581
			this->toolStripSeparator3->Name = L"toolStripSeparator3";
582
			this->toolStripSeparator3->Size = System::Drawing::Size(212, 6);
583
			// 
584
			// uninstallToolStripMenuItem
585
			// 
586
			this->uninstallToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"uninstallToolStripMenuItem.Image")));
587
			this->uninstallToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
588
			this->uninstallToolStripMenuItem->Name = L"uninstallToolStripMenuItem";
589
			this->uninstallToolStripMenuItem->Size = System::Drawing::Size(215, 50);
590
			this->uninstallToolStripMenuItem->Text = L"Uninstall";
591
			this->uninstallToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::uninstallToolStripMenuItem_Click);
592
			// 
593
			// UninstallSelectedContext
594
			// 
595
			this->UninstallSelectedContext->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"UninstallSelectedContext.Image")));
596
			this->UninstallSelectedContext->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
597
			this->UninstallSelectedContext->Name = L"UninstallSelectedContext";
598
			this->UninstallSelectedContext->Size = System::Drawing::Size(215, 50);
599
			this->UninstallSelectedContext->Text = L"Uninstall Selected";
600
			this->UninstallSelectedContext->Click += gcnew System::EventHandler(this, &MainGui::UninstallSelectedContext_Click);
601
			// 
602
			// ContextEnable
603
			// 
604
			this->ContextEnable->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ContextEnable.Image")));
605
			this->ContextEnable->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
606
			this->ContextEnable->Name = L"ContextEnable";
607
			this->ContextEnable->Size = System::Drawing::Size(215, 50);
608
			this->ContextEnable->Text = L"Enable";
609
			this->ContextEnable->Click += gcnew System::EventHandler(this, &MainGui::ContextEnable_Click);
610
			// 
611
			// ContextDisable
612
			// 
613
			this->ContextDisable->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ContextDisable.Image")));
614
			this->ContextDisable->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
615
			this->ContextDisable->Name = L"ContextDisable";
616
			this->ContextDisable->Size = System::Drawing::Size(215, 50);
617
			this->ContextDisable->Text = L"Disable";
618
			this->ContextDisable->Click += gcnew System::EventHandler(this, &MainGui::ContextDisable_Click);
619
			// 
620
			// ContextSeperator
621
			// 
622
			this->ContextSeperator->Name = L"ContextSeperator";
623
			this->ContextSeperator->Size = System::Drawing::Size(212, 6);
624
			// 
625
			// viewReadmeToolStripMenuItem
626
			// 
627
			this->viewReadmeToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"viewReadmeToolStripMenuItem.Image")));
628
			this->viewReadmeToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
629
			this->viewReadmeToolStripMenuItem->Name = L"viewReadmeToolStripMenuItem";
630
			this->viewReadmeToolStripMenuItem->Size = System::Drawing::Size(215, 50);
631
			this->viewReadmeToolStripMenuItem->Text = L"View Readme";
632
			// 
633
			// extrasToolStripMenuItem
634
			// 
635
			this->extrasToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"extrasToolStripMenuItem.Image")));
636
			this->extrasToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
637
			this->extrasToolStripMenuItem->Name = L"extrasToolStripMenuItem";
638
			this->extrasToolStripMenuItem->Size = System::Drawing::Size(215, 50);
639
			this->extrasToolStripMenuItem->Text = L"Extras";
640
			// 
641
			// ContextSeperator2
642
			// 
643
			this->ContextSeperator2->Name = L"ContextSeperator2";
644
			this->ContextSeperator2->Size = System::Drawing::Size(212, 6);
645
			// 
646
			// emailAuthorToolStripMenuItem
647
			// 
648
			this->emailAuthorToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"emailAuthorToolStripMenuItem.Image")));
649
			this->emailAuthorToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
650
			this->emailAuthorToolStripMenuItem->Name = L"emailAuthorToolStripMenuItem";
651
			this->emailAuthorToolStripMenuItem->Size = System::Drawing::Size(215, 50);
652
			this->emailAuthorToolStripMenuItem->Text = L"Email Author";
653
			this->emailAuthorToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::emailAuthorToolStripMenuItem_Click);
654
			// 
655
			// visitForumPageToolStripMenuItem
656
			// 
657
			this->visitForumPageToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"visitForumPageToolStripMenuItem.Image")));
658
			this->visitForumPageToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
659
			this->visitForumPageToolStripMenuItem->Name = L"visitForumPageToolStripMenuItem";
660
			this->visitForumPageToolStripMenuItem->Size = System::Drawing::Size(215, 50);
661
			this->visitForumPageToolStripMenuItem->Text = L"Visit Forum Page";
662
			this->visitForumPageToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::visitForumPageToolStripMenuItem_Click);
663
			// 
664
			// visitWebSiteToolStripMenuItem
665
			// 
666
			this->visitWebSiteToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"visitWebSiteToolStripMenuItem.Image")));
667
			this->visitWebSiteToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
668
			this->visitWebSiteToolStripMenuItem->Name = L"visitWebSiteToolStripMenuItem";
669
			this->visitWebSiteToolStripMenuItem->Size = System::Drawing::Size(215, 50);
670
			this->visitWebSiteToolStripMenuItem->Text = L"Visit Web Site";
671
			this->visitWebSiteToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::visitWebSiteToolStripMenuItem_Click);
672
			// 
673
			// toolStripSeparator2
674
			// 
675
			this->toolStripSeparator2->Name = L"toolStripSeparator2";
676
			this->toolStripSeparator2->Size = System::Drawing::Size(212, 6);
677
			// 
678
			// checkForUpdatesToolStripMenuItem
679
			// 
680
			this->checkForUpdatesToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"checkForUpdatesToolStripMenuItem.Image")));
681
			this->checkForUpdatesToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
682
			this->checkForUpdatesToolStripMenuItem->Name = L"checkForUpdatesToolStripMenuItem";
683
			this->checkForUpdatesToolStripMenuItem->Size = System::Drawing::Size(215, 50);
684
			this->checkForUpdatesToolStripMenuItem->Text = L"Check For Updates";
685
			this->checkForUpdatesToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::checkForUpdatesToolStripMenuItem_Click);
686
			// 
687
			// panel1
688
			// 
689
			this->panel1->AllowDrop = true;
690
			this->panel1->Controls->Add(this->ProgressBar);
691
			this->panel1->Controls->Add(this->ButRun);
692
			this->panel1->Controls->Add(this->ButClose);
693
			this->panel1->Dock = System::Windows::Forms::DockStyle::Bottom;
694
			this->panel1->Location = System::Drawing::Point(0, 551);
695
			this->panel1->Margin = System::Windows::Forms::Padding(5, 10, 5, 10);
696
			this->panel1->Name = L"panel1";
697
			this->panel1->Size = System::Drawing::Size(626, 37);
698
			this->panel1->TabIndex = 2;
699
			// 
700
			// ProgressBar
701
			// 
702
			this->ProgressBar->Dock = System::Windows::Forms::DockStyle::Fill;
703
			this->ProgressBar->Location = System::Drawing::Point(0, 0);
704
			this->ProgressBar->Margin = System::Windows::Forms::Padding(10);
705
			this->ProgressBar->MarqueeAnimationSpeed = 5;
706
			this->ProgressBar->Name = L"ProgressBar";
707
			this->ProgressBar->Size = System::Drawing::Size(432, 37);
708
			this->ProgressBar->Style = System::Windows::Forms::ProgressBarStyle::Marquee;
709
			this->ProgressBar->TabIndex = 1;
710
			this->ProgressBar->Visible = false;
711
			// 
712
			// ButRun
713
			// 
714
			this->ButRun->AutoSize = true;
715
			this->ButRun->Dock = System::Windows::Forms::DockStyle::Right;
716
			this->ButRun->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ButRun.Image")));
717
			this->ButRun->Location = System::Drawing::Point(432, 0);
718
			this->ButRun->Name = L"ButRun";
719
			this->ButRun->Size = System::Drawing::Size(119, 37);
720
			this->ButRun->TabIndex = 2;
721
			this->ButRun->Text = L"Run Game";
722
			this->ButRun->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
723
			this->ButRun->UseVisualStyleBackColor = true;
724
			this->ButRun->Click += gcnew System::EventHandler(this, &MainGui::ButRun_Click);
725
			// 
726
			// ButClose
727
			// 
728
			this->ButClose->Dock = System::Windows::Forms::DockStyle::Right;
729
			this->ButClose->Location = System::Drawing::Point(551, 0);
730
			this->ButClose->Name = L"ButClose";
731
			this->ButClose->Size = System::Drawing::Size(75, 37);
732
			this->ButClose->TabIndex = 0;
733
			this->ButClose->Text = L"Close";
734
			this->ButClose->UseVisualStyleBackColor = true;
735
			// 
736
			// GroupPackages
737
			// 
738
			this->GroupPackages->Controls->Add(this->ListPackages);
739
			this->GroupPackages->Controls->Add(this->PanelDisplay);
740
			this->GroupPackages->Controls->Add(this->panel2);
741
			this->GroupPackages->Dock = System::Windows::Forms::DockStyle::Fill;
742
			this->GroupPackages->Location = System::Drawing::Point(0, 52);
743
			this->GroupPackages->Name = L"GroupPackages";
744
			this->GroupPackages->Size = System::Drawing::Size(626, 499);
745
			this->GroupPackages->TabIndex = 3;
746
			this->GroupPackages->TabStop = false;
747
			this->GroupPackages->Text = L"Installed Packages";
748
			// 
749
			// PanelDisplay
750
			// 
751
			this->PanelDisplay->AllowDrop = true;
752
			this->PanelDisplay->Controls->Add(this->TextDesc);
753
			this->PanelDisplay->Controls->Add(this->PictureDisplay);
754
			this->PanelDisplay->Dock = System::Windows::Forms::DockStyle::Bottom;
755
			this->PanelDisplay->Location = System::Drawing::Point(3, 402);
756
			this->PanelDisplay->Name = L"PanelDisplay";
757
			this->PanelDisplay->Size = System::Drawing::Size(620, 68);
758
			this->PanelDisplay->TabIndex = 2;
759
			// 
760
			// TextDesc
761
			// 
762
			this->TextDesc->Dock = System::Windows::Forms::DockStyle::Fill;
763
			this->TextDesc->Location = System::Drawing::Point(72, 0);
764
			this->TextDesc->Name = L"TextDesc";
765
			this->TextDesc->ReadOnly = true;
766
			this->TextDesc->Size = System::Drawing::Size(548, 68);
767
			this->TextDesc->TabIndex = 1;
768
			this->TextDesc->Text = L"";
769
			// 
770
			// PictureDisplay
771
			// 
772
			this->PictureDisplay->Dock = System::Windows::Forms::DockStyle::Left;
773
			this->PictureDisplay->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"PictureDisplay.Image")));
774
			this->PictureDisplay->Location = System::Drawing::Point(0, 0);
775
			this->PictureDisplay->Name = L"PictureDisplay";
776
			this->PictureDisplay->Size = System::Drawing::Size(72, 68);
777
			this->PictureDisplay->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
778
			this->PictureDisplay->TabIndex = 2;
779
			this->PictureDisplay->TabStop = false;
780
			// 
781
			// panel2
782
			// 
783
			this->panel2->AllowDrop = true;
784
			this->panel2->Controls->Add(this->button1);
785
			this->panel2->Controls->Add(this->ButUninstall);
786
			this->panel2->Controls->Add(this->ButDisable);
787
			this->panel2->Controls->Add(this->ButInstall);
788
			this->panel2->Dock = System::Windows::Forms::DockStyle::Bottom;
789
			this->panel2->Location = System::Drawing::Point(3, 470);
790
			this->panel2->Name = L"panel2";
791
			this->panel2->Size = System::Drawing::Size(620, 26);
792
			this->panel2->TabIndex = 0;
793
			// 
794
			// button1
795
			// 
796
			this->button1->Dock = System::Windows::Forms::DockStyle::Left;
797
			this->button1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"button1.Image")));
798
			this->button1->Location = System::Drawing::Point(122, 0);
799
			this->button1->Name = L"button1";
800
			this->button1->Size = System::Drawing::Size(121, 26);
801
			this->button1->TabIndex = 3;
802
			this->button1->Text = L"Install Archive";
803
			this->button1->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
804
			this->button1->UseVisualStyleBackColor = true;
805
			this->button1->Click += gcnew System::EventHandler(this, &MainGui::button1_Click);
806
			// 
807
			// ButUninstall
808
			// 
809
			this->ButUninstall->AutoSize = true;
810
			this->ButUninstall->Dock = System::Windows::Forms::DockStyle::Right;
811
			this->ButUninstall->Location = System::Drawing::Point(357, 0);
812
			this->ButUninstall->Name = L"ButUninstall";
813
			this->ButUninstall->Size = System::Drawing::Size(122, 26);
814
			this->ButUninstall->TabIndex = 2;
815
			this->ButUninstall->Text = L"Uninstall";
816
			this->ButUninstall->UseVisualStyleBackColor = true;
817
			// 
818
			// ButDisable
819
			// 
820
			this->ButDisable->AutoSize = true;
821
			this->ButDisable->Dock = System::Windows::Forms::DockStyle::Right;
822
			this->ButDisable->Location = System::Drawing::Point(479, 0);
823
			this->ButDisable->Name = L"ButDisable";
824
			this->ButDisable->Size = System::Drawing::Size(141, 26);
825
			this->ButDisable->TabIndex = 1;
826
			this->ButDisable->Text = L"Disable";
827
			this->ButDisable->UseVisualStyleBackColor = true;
828
			// 
829
			// ButInstall
830
			// 
831
			this->ButInstall->AutoSize = true;
832
			this->ButInstall->Dock = System::Windows::Forms::DockStyle::Left;
833
			this->ButInstall->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ButInstall.Image")));
834
			this->ButInstall->Location = System::Drawing::Point(0, 0);
835
			this->ButInstall->Name = L"ButInstall";
836
			this->ButInstall->Size = System::Drawing::Size(122, 26);
837
			this->ButInstall->TabIndex = 0;
838
			this->ButInstall->Text = L"Install Package";
839
			this->ButInstall->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
840
			this->ButInstall->UseVisualStyleBackColor = true;
841
			// 
842
			// statusStrip1
843
			// 
844
			this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->LabelStatus});
845
			this->statusStrip1->Location = System::Drawing::Point(0, 588);
846
			this->statusStrip1->Name = L"statusStrip1";
847
			this->statusStrip1->Size = System::Drawing::Size(626, 22);
848
			this->statusStrip1->TabIndex = 5;
849
			this->statusStrip1->Text = L"statusStrip1";
850
			// 
851
			// LabelStatus
852
			// 
853
			this->LabelStatus->Name = L"LabelStatus";
854
			this->LabelStatus->Size = System::Drawing::Size(0, 17);
855
			// 
856
			// imageList1
857
			// 
858
			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
859
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
860
			this->imageList1->Images->SetKeyName(0, L"ship.png");
861
			this->imageList1->Images->SetKeyName(1, L"package.png");
862
			this->imageList1->Images->SetKeyName(2, L"fake.png");
863
			this->imageList1->Images->SetKeyName(3, L"library.png");
864
			this->imageList1->Images->SetKeyName(4, L"archive.png");
865
			// 
866
			// imageList2
867
			// 
868
			this->imageList2->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList2.ImageStream")));
869
			this->imageList2->TransparentColor = System::Drawing::Color::Transparent;
870
			this->imageList2->Images->SetKeyName(0, L"application");
871
			this->imageList2->Images->SetKeyName(1, L"exe");
872
			this->imageList2->Images->SetKeyName(2, L"doc");
873
			this->imageList2->Images->SetKeyName(3, L"pdf");
874
			this->imageList2->Images->SetKeyName(4, L"xls");
875
			this->imageList2->Images->SetKeyName(5, L"xlsx");
876
			// 
877
			// imageList3
878
			// 
879
			this->imageList3->ColorDepth = System::Windows::Forms::ColorDepth::Depth8Bit;
880
			this->imageList3->ImageSize = System::Drawing::Size(16, 16);
881
			this->imageList3->TransparentColor = System::Drawing::Color::Transparent;
882
			// 
883
			// backgroundWorker2
884
			// 
885
			this->backgroundWorker2->WorkerReportsProgress = true;
886
			this->backgroundWorker2->WorkerSupportsCancellation = true;
887
			this->backgroundWorker2->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &MainGui::backgroundWorker2_DoWork);
888
			this->backgroundWorker2->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &MainGui::backgroundWorker2_RunWorkerCompleted);
889
			// 
890
			// MainGui
891
			// 
892
			this->AllowDrop = true;
893
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
894
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
895
			this->ClientSize = System::Drawing::Size(626, 610);
896
			this->Controls->Add(this->GroupPackages);
897
			this->Controls->Add(this->panel1);
898
			this->Controls->Add(this->GroupDir);
899
			this->Controls->Add(this->statusStrip1);
900
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
901
			this->Name = L"MainGui";
902
			this->StartPosition = System::Windows::Forms::FormStartPosition::Manual;
903
			this->Text = L"X-Universe Plugin Manager Lite";
904
			this->Load += gcnew System::EventHandler(this, &MainGui::MainGui_Load);
905
			this->GroupDir->ResumeLayout(false);
906
			this->contextMenuStrip1->ResumeLayout(false);
907
			this->panel1->ResumeLayout(false);
908
			this->panel1->PerformLayout();
909
			this->GroupPackages->ResumeLayout(false);
910
			this->PanelDisplay->ResumeLayout(false);
911
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->PictureDisplay))->EndInit();
912
			this->panel2->ResumeLayout(false);
913
			this->panel2->PerformLayout();
914
			this->statusStrip1->ResumeLayout(false);
915
			this->statusStrip1->PerformLayout();
916
			this->ResumeLayout(false);
917
			this->PerformLayout();
918
 
919
		}
920
#pragma endregion
921
private: System::Void MainGui_Load(System::Object^  sender, System::EventArgs^  e) {
922
			 if ( m_iSaveGameManager == -1 )
923
			 {
924
				 if ( MessageBox::Show(this, "The save game manager will keep seperate save games for each directory and keeps vanilla and modified save games seperate\n\nDo you want to enable the save game manager?", "Save Game Manager", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == Windows::Forms::DialogResult::Yes )
925
				 {
926
					 m_iSaveGameManager = 1;
927
					 this->PrepareSaveGameManager();
928
				 }
929
				 else
930
					 m_iSaveGameManager = 0;
931
			 }
932
 
933
			 m_pMenuBar->SetSaveGameManager((m_iSaveGameManager == 1) ? true : false);
934
 
935
 			// auto update
936
			if ( m_iSizeX != -1 && m_iSizeY != -1 )
937
				this->Size = System::Drawing::Size(m_iSizeX, m_iSizeY);
938
 
939
			this->UpdateBuiltInPackages();
940
			this->AutoUpdate();
941
 
942
		 }
943
private: System::Void ButRun_Click(System::Object^  sender, System::EventArgs^  e) {
944
			 this->LaunchGame();
945
		 }
946
private: System::Void uninstallToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
947
			 if ( m_pListItem )
948
			 {
949
				 ArrayList ^List = gcnew ArrayList();
950
				 List->Add(m_pListItem);
951
				 this->UninstallList(List);
952
			 }
953
		 }
954
private: System::Void ContextEnable_Click(System::Object^  sender, System::EventArgs^  e) {
955
			 if ( m_pListItem )
956
			 {
957
				 ArrayList ^List = gcnew ArrayList();
958
				 List->Add(m_pListItem);
959
				 this->DisableList(List);
960
			 }
961
		 }
962
private: System::Void ContextDisable_Click(System::Object^  sender, System::EventArgs^  e) {
963
			 if ( m_pListItem )
964
			 {
965
				 ArrayList ^List = gcnew ArrayList();
966
				 List->Add(m_pListItem);
967
				 this->DisableList(List);
968
			 }
969
		 }
970
private: System::Void ListPackages_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
971
private: System::Void ListPackages_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
972
private: System::Void UninstallSelectedContext_Click(System::Object^  sender, System::EventArgs^  e) {
973
			 UninstallEvent(sender, e);
974
		 }
975
private: System::Void ContextName_Click(System::Object^  sender, System::EventArgs^  e) {
976
 
977
			CBaseFile *p = this->GetFileFromItem(m_pListItem);
978
			if ( p )
979
			{
980
				SpkExplorer::PackageInfo ^info = gcnew SpkExplorer::PackageInfo(p, m_pPackages->GetLanguage());
981
				info->ShowDialog(this);
982
			}
983
		 }
984
private: System::Void contextMenuStrip1_Opening(System::Object^  sender, System::ComponentModel::CancelEventArgs^  e) {
985
			 this->OpenContextMenu(sender, e);
986
		 }
987
private: System::Void ListPackages_MouseDoubleClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
988
			ListViewItem ^item = this->FindSelectedItem();
989
			if ( item )
990
			{
991
				CBaseFile *p = this->GetFileFromItem(item);
992
				if ( p )
993
				{
994
					SpkExplorer::PackageInfo ^info = gcnew SpkExplorer::PackageInfo(p, m_pPackages->GetLanguage());
995
					info->ShowDialog(this);
996
				}
997
			}
998
		 }
999
private: System::Void emailAuthorToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1000
			 this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
1001
		 }
1002
private: System::Void visitForumPageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1003
			 this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
1004
		 }
1005
private: System::Void visitWebSiteToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1006
			 this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
1007
		 }
1008
private: System::Void checkForUpdatesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1009
			if ( m_pListItem )
1010
			{
1011
				CBaseFile *p = this->GetFileFromItem(m_pListItem);
1012
				if ( p )
1013
				{
1014
					CheckUpdate ^update = gcnew CheckUpdate(m_pPackages, this->imageList1);
1015
					update->OnePackage(p);
1016
					this->ClearSelectedItems();
1017
					if ( update->ShowDialog(this) == Windows::Forms::DialogResult::OK )
1018
					{
1019
						for ( int i = 0; i < update->GetInstallList()->Count; i++ )
1020
							this->InstallPackage(Convert::ToString(update->GetInstallList()[i]), false, false, true);
1021
						this->StartInstalling(false, true);
1022
					}
1023
				}
1024
			}
1025
		 }
1026
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
1027
			 this->InstallArchive();
1028
		 }
1029
private: System::Void backgroundWorker2_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
1030
			m_pConverted = (CArchiveFile *)m_pPackages->CreateFromArchive(CyStringFromSystemString(m_sConvertFile), true);
1031
		 }
1032
private: System::Void backgroundWorker2_RunWorkerCompleted(System::Object^  sender, System::ComponentModel::RunWorkerCompletedEventArgs^  e) {
1033
				if ( m_pWait ) 
1034
				{
1035
					m_pWait->Close();
1036
					delete m_pWait;
1037
					m_pWait = nullptr;
1038
				}
1039
 
1040
				if ( !m_pConverted )
1041
					this->DisplayMessageBox(false, "Unable to open", "Unable to open archive file, " + m_sConvertFile, MessageBoxButtons::OK, MessageBoxIcon::Error);
1042
				else
1043
				{
1044
					bool errored = false;
1045
					int errorNum = m_pPackages->PrepareInstallPackage(m_pConverted, false, false, IC_ALL);
1046
					if ( errorNum != INSTALLCHECK_OK )
1047
					{
1048
						if ( errorNum == INSTALLCHECK_NOSHIP )
1049
						{
1050
							this->DisplayMessageBox(false, "No Ships", "Ships are not supported for " + SystemStringFromCyString(m_pPackages->GetGameName()), MessageBoxButtons::OK, MessageBoxIcon::Stop);
1051
							errored = true;
1052
						}
1053
						else if ( m_pPackages->PrepareInstallPackage(m_pConverted, false, false, IC_MODIFIED) != INSTALLCHECK_OK )
1054
						{
1055
							this->DisplayMessageBox(false, "Installing", "Currently in Vanilla Mode, Package is not an Vanilla Package\n" + SystemStringFromCyString(m_pConverted->GetLanguageName(m_pPackages->GetLanguage())) + "\n\nSwitch to modified mode if you wish to install this package", MessageBoxButtons::OK, MessageBoxIcon::Question);
1056
							errored = true;
1057
						}
1058
					}
1059
 
1060
					if ( !errored )
1061
						this->StartInstallingArchive(false, true);
1062
				}
1063
		 }
1064
};
1065
}