Subversion Repositories spk

Rev

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