Subversion Repositories spk

Rev

Rev 50 | Rev 88 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
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
			 {
50 cycrow 154
				 scriptVer = _US(pm->version());
155
				 if ( !pm->creationDate().empty() )
156
					scriptVer += " (" + _US(pm->creationDate()) + ")";
1 cycrow 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();
86 cycrow 206
		void AddIconToPackages(String ^icon);
1 cycrow 207
 
208
		// auto update
209
		void AutoUpdate();
210
		System::String ^GetDownloadFile() { return m_sDownload; }
211
 
212
		// Run
213
		System::String ^GetRunFile() { return m_sRun; }
214
		System::String ^GetGameArgs() { return m_sGameArgs; }
215
 
216
		// setup functions
217
		void SetupEventHandlers();
218
		void StartCheckTimer();
219
 
220
		// control functions
221
		bool InstallPackage(System::String ^file, bool straightAway, bool builtin, bool background);
222
		void ChangeDirectory(CyString dir);
223
 
224
		void SetGameArgs(System::String ^args) { m_sGameArgs = args; }
225
		void AddGameArgs(System::String ^args) { m_sGameArgs += " " + args; }
226
 
227
		bool DisplayTip(int tipsection, int tip);
228
		void CheckUnusedShared();
229
 
230
		bool CheckAccessRights(String ^dir);
231
		void ClearSelectedItems();
232
		void CheckFakePatchCompatability();
233
 
234
		void PackageUpdates()
235
		{
236
			CheckUpdate ^update = gcnew CheckUpdate(m_pPackages, this->imageList1);
237
			this->ClearSelectedItems();
238
			if ( update->ShowDialog(this) == Windows::Forms::DialogResult::OK )
239
			{
240
				for ( int i = 0; i < update->GetInstallList()->Count; i++ )
241
					this->InstallPackage(Convert::ToString(update->GetInstallList()[i]), false, false, true);
242
				this->StartInstalling(false, true);
243
			}
244
		}
245
 
246
		// external control events
247
		void InstallEvent(System::Object ^Sender, System::EventArgs ^E);
248
		void VanillaEvent(System::Object ^Sender, System::EventArgs ^E);
249
		void ModifiedEvent(System::Object ^Sender, System::EventArgs ^E);
250
		void AddDirectoryEvent(System::Object ^Sender, System::EventArgs ^E);
251
		void ModSelectorEvent(System::Object ^Sender, System::EventArgs ^E);
252
		void PackageBrowserEvent(System::Object ^Sender, System::EventArgs ^E);
253
 
254
		void FindPackagesOnline();
255
		void ViewFileLog();
256
		void EditGlobalsDialog();
257
		void FakePatchControlDialog();
258
		void RemoveDirectory();
259
		void ExportPackageList();
260
		void VerifyInstalledFiles();
261
		CPackages *GetPackageControl() { return m_pPackages; }
262
 
263
	protected:
264
		/// <summary>
265
		/// Clean up any resources being used.
266
		/// </summary>
267
		~MainGui()
268
		{
269
			if (components)
270
			{
271
				delete components;
272
			}
273
			delete m_pFileErrors;
274
			delete m_pLauncherFlags;
275
		}
276
 
277
	private:
278
		// Events
279
		void ClosedEvent(System::Object ^Sender, System::EventArgs ^E) { this->Close(); }
280
		void PackageListSelected(System::Object ^Sender, System::EventArgs ^E);
281
		void PackageListSort(System::Object ^Sender, ColumnClickEventArgs ^E);
282
		void UninstallEvent(System::Object ^Sender, System::EventArgs ^E);
283
		void DisableEvent(System::Object ^Sender, System::EventArgs ^E);
284
		void ChangeDirectoryEvent(System::Object ^Sender, System::EventArgs ^E);
285
		void Background_DoWork(System::Object ^Sender, DoWorkEventArgs ^E);
286
		void Background_Progress(System::Object ^Sender, ProgressChangedEventArgs ^E);
287
		void Background_Finished(System::Object ^Sender, RunWorkerCompletedEventArgs ^E) { this->Background_Finished(); }
288
		void Background_Finished();
289
		void CloseEvent(System::Object ^Sender, FormClosingEventArgs ^E);
290
		void Updater_Finished(System::Object ^Sender, RunWorkerCompletedEventArgs ^E);
291
		void Updater_DoWork(System::Object ^Sender, DoWorkEventArgs ^E);
292
		void TimerEvent_CheckFile(System::Object ^Sender, System::EventArgs ^E);
293
		void RunItem(System::Object ^sender, System::EventArgs ^e);
294
 
295
		ListViewItem ^FindSelectedItem();
296
		CBaseFile *GetFileFromItem(ListViewItem ^item);
297
 
298
		System::Void OpenContextMenu(System::Object ^Sender, CancelEventArgs ^E);
299
		void _DisplayPackages(CBaseFile *currentParent, ListViewGroup ^addGroup);
300
 
301
		void UpdateRunButton();
302
		bool EnablePackage(CBaseFile *p);
303
		bool StartInstallingArchive(bool builtin, bool background) { return StartInstalling(builtin, background, true); }
304
		bool StartInstalling(bool builtin, bool background) { return StartInstalling(builtin, background, false); }
305
		bool StartInstalling(bool builtin, bool background, bool archive);
306
		void DoInstall(bool builtin, bool frombackground);
307
		void DoUninstall();
308
		void DoDisable();
309
		bool RemoveCurrentDirectory();
310
		CBaseFile *FindPackageFromList(ListViewItem ^item);
311
 
312
		bool StartBackground(int type);
313
		bool StartBackground(int type, System::String ^info);
314
		void LaunchGame();
315
		System::Windows::Forms::DialogResult DisplayMessageBox(bool inthread, System::String ^title, System::String ^text, MessageBoxButtons buttons, MessageBoxIcon icon);
316
 
317
		void DisableList(ArrayList ^List);
318
		void UninstallList(ArrayList ^List);
319
 
320
		void RunFromToolItem(ToolStripMenuItem ^item);
321
 
322
		MenuBar			^m_pMenuBar;
323
		CPackages		*m_pPackages;
324
		CyStringList	*m_pDirList;
325
		CyStringList	*m_pRemovedDirList;
326
		CyStringList	*m_pUpdateList;
327
		CyStringList	*m_pFileErrors;
328
		int				 m_iBackgroundTask;
329
		int				 m_iSortingColumn;
330
		bool			 m_bSortingAsc;
331
 
332
		bool			 m_bSigned;
333
		bool			 m_bShips;
334
		bool			 m_bExperimental;
335
		bool			 m_bCheat;
336
		bool			 m_bDownloadable;
337
		bool			 m_bModSelectorDetails;
338
		bool			 m_bAutoUpdate;
339
		bool			 m_bRunningBackground;
340
		bool			 m_bAdvanced;
341
		bool			 m_bDirLocked;
342
 
343
		System::String	^m_sBackgroundInfo;
344
		System::String	^m_sDownload;
345
		System::String	^m_sRun;
346
		System::String	^m_sGameArgs;
347
 
348
		PackageInstalled ^m_pPi;
349
		bool			m_bDisplayDialog;
350
		bool			m_bDisplayMessage;
351
		System::String ^m_sMessageTitle;
352
		System::String ^m_sMessageText;
353
		MessageBoxIcon  m_messageIcon;
354
		MessageBoxButtons m_messageButtons;
355
 
356
		int			m_iSizeX;
357
		int			m_iSizeY;
358
 
359
		SGameLauncherFlags *m_pLauncherFlags;
360
 
361
		ArrayList ^m_lTips;
362
		ListViewItem						^m_pListItem;
363
 
364
		int			m_iSaveGameManager;
365
		String			^m_sConvertFile;
366
		Creator::Waiting	^m_pWait;
367
		CArchiveFile	*m_pConverted;
368
 
369
	private:
370
	private:
371
	private: System::Windows::Forms::GroupBox^  GroupDir;
372
	private: System::Windows::Forms::ComboBox^  ComboDir;
373
	private: System::Windows::Forms::ListView^  ListPackages;
374
	private: System::Windows::Forms::ColumnHeader^  columnHeader1;
375
	private: System::Windows::Forms::ColumnHeader^  columnHeader2;
376
	private: System::Windows::Forms::ColumnHeader^  columnHeader3;
377
	private: System::Windows::Forms::ColumnHeader^  columnHeader4;
378
	private: System::Windows::Forms::ColumnHeader^  columnHeader5;
379
	private: System::Windows::Forms::Panel^  panel1;
380
	private: System::Windows::Forms::Button^  ButClose;
381
	private: System::Windows::Forms::GroupBox^  GroupPackages;
382
	private: System::Windows::Forms::ProgressBar^  ProgressBar;
383
	private: System::Windows::Forms::Panel^  panel2;
384
	private: System::Windows::Forms::Button^  ButUninstall;
385
	private: System::Windows::Forms::Button^  ButDisable;
386
	private: System::Windows::Forms::Button^  ButInstall;
387
	private: System::ComponentModel::BackgroundWorker^  backgroundWorker1;
388
private: System::Windows::Forms::RichTextBox^  TextDesc;
389
private: System::Windows::Forms::Panel^  PanelDisplay;
390
private: System::Windows::Forms::PictureBox^  PictureDisplay;
391
private: System::ComponentModel::BackgroundWorker^  backgroundUpdater;
392
private: System::Windows::Forms::Button^  ButRun;
393
private: System::Windows::Forms::StatusStrip^  statusStrip1;
394
private: System::Windows::Forms::ToolStripStatusLabel^  LabelStatus;
395
private: System::Windows::Forms::ContextMenuStrip^  contextMenuStrip1;
396
private: System::Windows::Forms::ToolStripMenuItem^  uninstallToolStripMenuItem;
397
private: System::Windows::Forms::ToolStripSeparator^  ContextSeperator;
398
private: System::Windows::Forms::ToolStripMenuItem^  ContextEnable;
399
private: System::Windows::Forms::ToolStripMenuItem^  ContextDisable;
400
private: System::Windows::Forms::ToolStripMenuItem^  ContextName;
401
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;
402
private: System::Windows::Forms::ImageList^  imageList1;
403
private: System::Windows::Forms::ToolStripMenuItem^  UninstallSelectedContext;
404
private: System::Windows::Forms::ColumnHeader^  columnHeader6;
405
private: System::Windows::Forms::ToolStripMenuItem^  viewReadmeToolStripMenuItem;
406
private: System::Windows::Forms::ToolStripMenuItem^  extrasToolStripMenuItem;
407
private: System::Windows::Forms::ImageList^  imageList2;
408
private: System::Windows::Forms::ImageList^  imageList3;
409
private: System::Windows::Forms::ToolStripSeparator^  ContextSeperator2;
410
private: System::Windows::Forms::ToolStripMenuItem^  emailAuthorToolStripMenuItem;
411
private: System::Windows::Forms::ToolStripMenuItem^  visitForumPageToolStripMenuItem;
412
private: System::Windows::Forms::ToolStripMenuItem^  visitWebSiteToolStripMenuItem;
413
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
414
private: System::Windows::Forms::ToolStripMenuItem^  checkForUpdatesToolStripMenuItem;
415
private: System::Windows::Forms::Button^  button1;
416
private: System::ComponentModel::BackgroundWorker^  backgroundWorker2;
417
 
418
private: System::ComponentModel::IContainer^  components;
419
		 /// <summary>
420
		/// Required designer variable.
421
		/// </summary>
422
 
423
 
424
#pragma region Windows Form Designer generated code
425
		/// <summary>
426
		/// Required method for Designer support - do not modify
427
		/// the contents of this method with the code editor.
428
		/// </summary>
429
		void InitializeComponent(void)
430
		{
431
			this->components = (gcnew System::ComponentModel::Container());
432
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(MainGui::typeid));
433
			this->GroupDir = (gcnew System::Windows::Forms::GroupBox());
434
			this->ComboDir = (gcnew System::Windows::Forms::ComboBox());
435
			this->ListPackages = (gcnew System::Windows::Forms::ListView());
436
			this->columnHeader1 = (gcnew System::Windows::Forms::ColumnHeader());
437
			this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
438
			this->columnHeader3 = (gcnew System::Windows::Forms::ColumnHeader());
439
			this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());
440
			this->columnHeader6 = (gcnew System::Windows::Forms::ColumnHeader());
441
			this->columnHeader5 = (gcnew System::Windows::Forms::ColumnHeader());
442
			this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
443
			this->ContextName = (gcnew System::Windows::Forms::ToolStripMenuItem());
444
			this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
445
			this->uninstallToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
446
			this->UninstallSelectedContext = (gcnew System::Windows::Forms::ToolStripMenuItem());
447
			this->ContextEnable = (gcnew System::Windows::Forms::ToolStripMenuItem());
448
			this->ContextDisable = (gcnew System::Windows::Forms::ToolStripMenuItem());
449
			this->ContextSeperator = (gcnew System::Windows::Forms::ToolStripSeparator());
450
			this->viewReadmeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
451
			this->extrasToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
452
			this->ContextSeperator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
453
			this->emailAuthorToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
454
			this->visitForumPageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
455
			this->visitWebSiteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
456
			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
457
			this->checkForUpdatesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
458
			this->panel1 = (gcnew System::Windows::Forms::Panel());
459
			this->ProgressBar = (gcnew System::Windows::Forms::ProgressBar());
460
			this->ButRun = (gcnew System::Windows::Forms::Button());
461
			this->ButClose = (gcnew System::Windows::Forms::Button());
462
			this->GroupPackages = (gcnew System::Windows::Forms::GroupBox());
463
			this->PanelDisplay = (gcnew System::Windows::Forms::Panel());
464
			this->TextDesc = (gcnew System::Windows::Forms::RichTextBox());
465
			this->PictureDisplay = (gcnew System::Windows::Forms::PictureBox());
466
			this->panel2 = (gcnew System::Windows::Forms::Panel());
467
			this->button1 = (gcnew System::Windows::Forms::Button());
468
			this->ButUninstall = (gcnew System::Windows::Forms::Button());
469
			this->ButDisable = (gcnew System::Windows::Forms::Button());
470
			this->ButInstall = (gcnew System::Windows::Forms::Button());
471
			this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
472
			this->backgroundUpdater = (gcnew System::ComponentModel::BackgroundWorker());
473
			this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
474
			this->LabelStatus = (gcnew System::Windows::Forms::ToolStripStatusLabel());
475
			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
476
			this->imageList2 = (gcnew System::Windows::Forms::ImageList(this->components));
477
			this->imageList3 = (gcnew System::Windows::Forms::ImageList(this->components));
478
			this->backgroundWorker2 = (gcnew System::ComponentModel::BackgroundWorker());
479
			this->GroupDir->SuspendLayout();
480
			this->contextMenuStrip1->SuspendLayout();
481
			this->panel1->SuspendLayout();
482
			this->GroupPackages->SuspendLayout();
483
			this->PanelDisplay->SuspendLayout();
484
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->PictureDisplay))->BeginInit();
485
			this->panel2->SuspendLayout();
486
			this->statusStrip1->SuspendLayout();
487
			this->SuspendLayout();
488
			// 
489
			// GroupDir
490
			// 
491
			this->GroupDir->Controls->Add(this->ComboDir);
492
			this->GroupDir->Dock = System::Windows::Forms::DockStyle::Top;
493
			this->GroupDir->Location = System::Drawing::Point(0, 0);
494
			this->GroupDir->Name = L"GroupDir";
495
			this->GroupDir->Padding = System::Windows::Forms::Padding(5);
496
			this->GroupDir->Size = System::Drawing::Size(626, 52);
497
			this->GroupDir->TabIndex = 0;
498
			this->GroupDir->TabStop = false;
499
			this->GroupDir->Text = L"Current Directory";
500
			// 
501
			// ComboDir
502
			// 
503
			this->ComboDir->Dock = System::Windows::Forms::DockStyle::Fill;
504
			this->ComboDir->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
505
			this->ComboDir->FormattingEnabled = true;
506
			this->ComboDir->Location = System::Drawing::Point(5, 18);
507
			this->ComboDir->Margin = System::Windows::Forms::Padding(10);
508
			this->ComboDir->Name = L"ComboDir";
509
			this->ComboDir->Size = System::Drawing::Size(616, 21);
510
			this->ComboDir->TabIndex = 0;
511
			// 
512
			// ListPackages
513
			// 
514
			this->ListPackages->AllowDrop = true;
515
			this->ListPackages->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(6) {this->columnHeader1, 
516
				this->columnHeader2, this->columnHeader3, this->columnHeader4, this->columnHeader6, this->columnHeader5});
517
			this->ListPackages->ContextMenuStrip = this->contextMenuStrip1;
518
			this->ListPackages->Dock = System::Windows::Forms::DockStyle::Fill;
519
			this->ListPackages->FullRowSelect = true;
520
			this->ListPackages->HideSelection = false;
521
			this->ListPackages->Location = System::Drawing::Point(3, 16);
522
			this->ListPackages->Name = L"ListPackages";
523
			this->ListPackages->ShowItemToolTips = true;
524
			this->ListPackages->Size = System::Drawing::Size(620, 386);
525
			this->ListPackages->TabIndex = 0;
526
			this->ListPackages->UseCompatibleStateImageBehavior = false;
527
			this->ListPackages->View = System::Windows::Forms::View::Details;
528
			this->ListPackages->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &MainGui::ListPackages_MouseDoubleClick);
529
			this->ListPackages->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &MainGui::ListPackages_DragDrop);
530
			this->ListPackages->DragOver += gcnew System::Windows::Forms::DragEventHandler(this, &MainGui::ListPackages_DragOver);
86 cycrow 531
			this->ListPackages->DrawSubItem += gcnew System::Windows::Forms::DrawListViewSubItemEventHandler(this, &MainGui::ListPackages_DrawSubItem);
1 cycrow 532
			// 
533
			// columnHeader1
534
			// 
535
			this->columnHeader1->Text = L"Package";
536
			// 
537
			// columnHeader2
538
			// 
539
			this->columnHeader2->Text = L"Author";
540
			// 
541
			// columnHeader3
542
			// 
543
			this->columnHeader3->Text = L"Version";
544
			this->columnHeader3->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
545
			// 
546
			// columnHeader4
547
			// 
548
			this->columnHeader4->Text = L"Updated";
549
			// 
550
			// columnHeader6
551
			// 
552
			this->columnHeader6->DisplayIndex = 5;
553
			this->columnHeader6->Text = L"Type";
554
			// 
555
			// columnHeader5
556
			// 
557
			this->columnHeader5->DisplayIndex = 4;
558
			this->columnHeader5->Text = L"Enabled";
559
			this->columnHeader5->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
560
			// 
561
			// contextMenuStrip1
562
			// 
563
			this->contextMenuStrip1->ImageScalingSize = System::Drawing::Size(24, 24);
564
			this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(15) {this->ContextName, 
565
				this->toolStripSeparator3, this->uninstallToolStripMenuItem, this->UninstallSelectedContext, this->ContextEnable, this->ContextDisable, 
566
				this->ContextSeperator, this->viewReadmeToolStripMenuItem, this->extrasToolStripMenuItem, this->ContextSeperator2, this->emailAuthorToolStripMenuItem, 
567
				this->visitForumPageToolStripMenuItem, this->visitWebSiteToolStripMenuItem, this->toolStripSeparator2, this->checkForUpdatesToolStripMenuItem});
568
			this->contextMenuStrip1->Name = L"contextMenuStrip1";
86 cycrow 569
			this->contextMenuStrip1->Size = System::Drawing::Size(216, 578);
1 cycrow 570
			this->contextMenuStrip1->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &MainGui::contextMenuStrip1_Opening);
571
			// 
572
			// ContextName
573
			// 
574
			this->ContextName->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ContextName.Image")));
575
			this->ContextName->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
576
			this->ContextName->Name = L"ContextName";
577
			this->ContextName->Size = System::Drawing::Size(215, 50);
578
			this->ContextName->Text = L"Name";
579
			this->ContextName->Click += gcnew System::EventHandler(this, &MainGui::ContextName_Click);
580
			// 
581
			// toolStripSeparator3
582
			// 
583
			this->toolStripSeparator3->Name = L"toolStripSeparator3";
584
			this->toolStripSeparator3->Size = System::Drawing::Size(212, 6);
585
			// 
586
			// uninstallToolStripMenuItem
587
			// 
588
			this->uninstallToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"uninstallToolStripMenuItem.Image")));
589
			this->uninstallToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
590
			this->uninstallToolStripMenuItem->Name = L"uninstallToolStripMenuItem";
591
			this->uninstallToolStripMenuItem->Size = System::Drawing::Size(215, 50);
592
			this->uninstallToolStripMenuItem->Text = L"Uninstall";
593
			this->uninstallToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::uninstallToolStripMenuItem_Click);
594
			// 
595
			// UninstallSelectedContext
596
			// 
597
			this->UninstallSelectedContext->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"UninstallSelectedContext.Image")));
598
			this->UninstallSelectedContext->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
599
			this->UninstallSelectedContext->Name = L"UninstallSelectedContext";
600
			this->UninstallSelectedContext->Size = System::Drawing::Size(215, 50);
601
			this->UninstallSelectedContext->Text = L"Uninstall Selected";
602
			this->UninstallSelectedContext->Click += gcnew System::EventHandler(this, &MainGui::UninstallSelectedContext_Click);
603
			// 
604
			// ContextEnable
605
			// 
606
			this->ContextEnable->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ContextEnable.Image")));
607
			this->ContextEnable->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
608
			this->ContextEnable->Name = L"ContextEnable";
609
			this->ContextEnable->Size = System::Drawing::Size(215, 50);
610
			this->ContextEnable->Text = L"Enable";
611
			this->ContextEnable->Click += gcnew System::EventHandler(this, &MainGui::ContextEnable_Click);
612
			// 
613
			// ContextDisable
614
			// 
615
			this->ContextDisable->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ContextDisable.Image")));
616
			this->ContextDisable->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
617
			this->ContextDisable->Name = L"ContextDisable";
618
			this->ContextDisable->Size = System::Drawing::Size(215, 50);
619
			this->ContextDisable->Text = L"Disable";
620
			this->ContextDisable->Click += gcnew System::EventHandler(this, &MainGui::ContextDisable_Click);
621
			// 
622
			// ContextSeperator
623
			// 
624
			this->ContextSeperator->Name = L"ContextSeperator";
625
			this->ContextSeperator->Size = System::Drawing::Size(212, 6);
626
			// 
627
			// viewReadmeToolStripMenuItem
628
			// 
629
			this->viewReadmeToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"viewReadmeToolStripMenuItem.Image")));
630
			this->viewReadmeToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
631
			this->viewReadmeToolStripMenuItem->Name = L"viewReadmeToolStripMenuItem";
632
			this->viewReadmeToolStripMenuItem->Size = System::Drawing::Size(215, 50);
633
			this->viewReadmeToolStripMenuItem->Text = L"View Readme";
634
			// 
635
			// extrasToolStripMenuItem
636
			// 
637
			this->extrasToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"extrasToolStripMenuItem.Image")));
638
			this->extrasToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
639
			this->extrasToolStripMenuItem->Name = L"extrasToolStripMenuItem";
640
			this->extrasToolStripMenuItem->Size = System::Drawing::Size(215, 50);
641
			this->extrasToolStripMenuItem->Text = L"Extras";
642
			// 
643
			// ContextSeperator2
644
			// 
645
			this->ContextSeperator2->Name = L"ContextSeperator2";
646
			this->ContextSeperator2->Size = System::Drawing::Size(212, 6);
647
			// 
648
			// emailAuthorToolStripMenuItem
649
			// 
650
			this->emailAuthorToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"emailAuthorToolStripMenuItem.Image")));
651
			this->emailAuthorToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
652
			this->emailAuthorToolStripMenuItem->Name = L"emailAuthorToolStripMenuItem";
653
			this->emailAuthorToolStripMenuItem->Size = System::Drawing::Size(215, 50);
654
			this->emailAuthorToolStripMenuItem->Text = L"Email Author";
655
			this->emailAuthorToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::emailAuthorToolStripMenuItem_Click);
656
			// 
657
			// visitForumPageToolStripMenuItem
658
			// 
659
			this->visitForumPageToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"visitForumPageToolStripMenuItem.Image")));
660
			this->visitForumPageToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
661
			this->visitForumPageToolStripMenuItem->Name = L"visitForumPageToolStripMenuItem";
662
			this->visitForumPageToolStripMenuItem->Size = System::Drawing::Size(215, 50);
663
			this->visitForumPageToolStripMenuItem->Text = L"Visit Forum Page";
664
			this->visitForumPageToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::visitForumPageToolStripMenuItem_Click);
665
			// 
666
			// visitWebSiteToolStripMenuItem
667
			// 
668
			this->visitWebSiteToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"visitWebSiteToolStripMenuItem.Image")));
669
			this->visitWebSiteToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
670
			this->visitWebSiteToolStripMenuItem->Name = L"visitWebSiteToolStripMenuItem";
671
			this->visitWebSiteToolStripMenuItem->Size = System::Drawing::Size(215, 50);
672
			this->visitWebSiteToolStripMenuItem->Text = L"Visit Web Site";
673
			this->visitWebSiteToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::visitWebSiteToolStripMenuItem_Click);
674
			// 
675
			// toolStripSeparator2
676
			// 
677
			this->toolStripSeparator2->Name = L"toolStripSeparator2";
678
			this->toolStripSeparator2->Size = System::Drawing::Size(212, 6);
679
			// 
680
			// checkForUpdatesToolStripMenuItem
681
			// 
682
			this->checkForUpdatesToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"checkForUpdatesToolStripMenuItem.Image")));
683
			this->checkForUpdatesToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
684
			this->checkForUpdatesToolStripMenuItem->Name = L"checkForUpdatesToolStripMenuItem";
685
			this->checkForUpdatesToolStripMenuItem->Size = System::Drawing::Size(215, 50);
686
			this->checkForUpdatesToolStripMenuItem->Text = L"Check For Updates";
687
			this->checkForUpdatesToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::checkForUpdatesToolStripMenuItem_Click);
688
			// 
689
			// panel1
690
			// 
691
			this->panel1->AllowDrop = true;
692
			this->panel1->Controls->Add(this->ProgressBar);
693
			this->panel1->Controls->Add(this->ButRun);
694
			this->panel1->Controls->Add(this->ButClose);
695
			this->panel1->Dock = System::Windows::Forms::DockStyle::Bottom;
696
			this->panel1->Location = System::Drawing::Point(0, 551);
697
			this->panel1->Margin = System::Windows::Forms::Padding(5, 10, 5, 10);
698
			this->panel1->Name = L"panel1";
699
			this->panel1->Size = System::Drawing::Size(626, 37);
700
			this->panel1->TabIndex = 2;
701
			// 
702
			// ProgressBar
703
			// 
704
			this->ProgressBar->Dock = System::Windows::Forms::DockStyle::Fill;
705
			this->ProgressBar->Location = System::Drawing::Point(0, 0);
706
			this->ProgressBar->Margin = System::Windows::Forms::Padding(10);
707
			this->ProgressBar->MarqueeAnimationSpeed = 5;
708
			this->ProgressBar->Name = L"ProgressBar";
709
			this->ProgressBar->Size = System::Drawing::Size(432, 37);
710
			this->ProgressBar->Style = System::Windows::Forms::ProgressBarStyle::Marquee;
711
			this->ProgressBar->TabIndex = 1;
712
			this->ProgressBar->Visible = false;
713
			// 
714
			// ButRun
715
			// 
716
			this->ButRun->AutoSize = true;
717
			this->ButRun->Dock = System::Windows::Forms::DockStyle::Right;
718
			this->ButRun->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ButRun.Image")));
719
			this->ButRun->Location = System::Drawing::Point(432, 0);
720
			this->ButRun->Name = L"ButRun";
721
			this->ButRun->Size = System::Drawing::Size(119, 37);
722
			this->ButRun->TabIndex = 2;
723
			this->ButRun->Text = L"Run Game";
724
			this->ButRun->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
725
			this->ButRun->UseVisualStyleBackColor = true;
726
			this->ButRun->Click += gcnew System::EventHandler(this, &MainGui::ButRun_Click);
727
			// 
728
			// ButClose
729
			// 
730
			this->ButClose->Dock = System::Windows::Forms::DockStyle::Right;
731
			this->ButClose->Location = System::Drawing::Point(551, 0);
732
			this->ButClose->Name = L"ButClose";
733
			this->ButClose->Size = System::Drawing::Size(75, 37);
734
			this->ButClose->TabIndex = 0;
735
			this->ButClose->Text = L"Close";
736
			this->ButClose->UseVisualStyleBackColor = true;
737
			// 
738
			// GroupPackages
739
			// 
740
			this->GroupPackages->Controls->Add(this->ListPackages);
741
			this->GroupPackages->Controls->Add(this->PanelDisplay);
742
			this->GroupPackages->Controls->Add(this->panel2);
743
			this->GroupPackages->Dock = System::Windows::Forms::DockStyle::Fill;
744
			this->GroupPackages->Location = System::Drawing::Point(0, 52);
745
			this->GroupPackages->Name = L"GroupPackages";
746
			this->GroupPackages->Size = System::Drawing::Size(626, 499);
747
			this->GroupPackages->TabIndex = 3;
748
			this->GroupPackages->TabStop = false;
749
			this->GroupPackages->Text = L"Installed Packages";
750
			// 
751
			// PanelDisplay
752
			// 
753
			this->PanelDisplay->AllowDrop = true;
754
			this->PanelDisplay->Controls->Add(this->TextDesc);
755
			this->PanelDisplay->Controls->Add(this->PictureDisplay);
756
			this->PanelDisplay->Dock = System::Windows::Forms::DockStyle::Bottom;
757
			this->PanelDisplay->Location = System::Drawing::Point(3, 402);
758
			this->PanelDisplay->Name = L"PanelDisplay";
759
			this->PanelDisplay->Size = System::Drawing::Size(620, 68);
760
			this->PanelDisplay->TabIndex = 2;
761
			// 
762
			// TextDesc
763
			// 
764
			this->TextDesc->Dock = System::Windows::Forms::DockStyle::Fill;
765
			this->TextDesc->Location = System::Drawing::Point(72, 0);
766
			this->TextDesc->Name = L"TextDesc";
767
			this->TextDesc->ReadOnly = true;
768
			this->TextDesc->Size = System::Drawing::Size(548, 68);
769
			this->TextDesc->TabIndex = 1;
770
			this->TextDesc->Text = L"";
771
			// 
772
			// PictureDisplay
773
			// 
774
			this->PictureDisplay->Dock = System::Windows::Forms::DockStyle::Left;
775
			this->PictureDisplay->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"PictureDisplay.Image")));
776
			this->PictureDisplay->Location = System::Drawing::Point(0, 0);
777
			this->PictureDisplay->Name = L"PictureDisplay";
778
			this->PictureDisplay->Size = System::Drawing::Size(72, 68);
779
			this->PictureDisplay->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
780
			this->PictureDisplay->TabIndex = 2;
781
			this->PictureDisplay->TabStop = false;
782
			// 
783
			// panel2
784
			// 
785
			this->panel2->AllowDrop = true;
786
			this->panel2->Controls->Add(this->button1);
787
			this->panel2->Controls->Add(this->ButUninstall);
788
			this->panel2->Controls->Add(this->ButDisable);
789
			this->panel2->Controls->Add(this->ButInstall);
790
			this->panel2->Dock = System::Windows::Forms::DockStyle::Bottom;
791
			this->panel2->Location = System::Drawing::Point(3, 470);
792
			this->panel2->Name = L"panel2";
793
			this->panel2->Size = System::Drawing::Size(620, 26);
794
			this->panel2->TabIndex = 0;
795
			// 
796
			// button1
797
			// 
798
			this->button1->Dock = System::Windows::Forms::DockStyle::Left;
799
			this->button1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"button1.Image")));
800
			this->button1->Location = System::Drawing::Point(122, 0);
801
			this->button1->Name = L"button1";
802
			this->button1->Size = System::Drawing::Size(121, 26);
803
			this->button1->TabIndex = 3;
804
			this->button1->Text = L"Install Archive";
805
			this->button1->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
806
			this->button1->UseVisualStyleBackColor = true;
807
			this->button1->Click += gcnew System::EventHandler(this, &MainGui::button1_Click);
808
			// 
809
			// ButUninstall
810
			// 
811
			this->ButUninstall->AutoSize = true;
812
			this->ButUninstall->Dock = System::Windows::Forms::DockStyle::Right;
813
			this->ButUninstall->Location = System::Drawing::Point(357, 0);
814
			this->ButUninstall->Name = L"ButUninstall";
815
			this->ButUninstall->Size = System::Drawing::Size(122, 26);
816
			this->ButUninstall->TabIndex = 2;
817
			this->ButUninstall->Text = L"Uninstall";
818
			this->ButUninstall->UseVisualStyleBackColor = true;
819
			// 
820
			// ButDisable
821
			// 
822
			this->ButDisable->AutoSize = true;
823
			this->ButDisable->Dock = System::Windows::Forms::DockStyle::Right;
824
			this->ButDisable->Location = System::Drawing::Point(479, 0);
825
			this->ButDisable->Name = L"ButDisable";
826
			this->ButDisable->Size = System::Drawing::Size(141, 26);
827
			this->ButDisable->TabIndex = 1;
828
			this->ButDisable->Text = L"Disable";
829
			this->ButDisable->UseVisualStyleBackColor = true;
830
			// 
831
			// ButInstall
832
			// 
833
			this->ButInstall->AutoSize = true;
834
			this->ButInstall->Dock = System::Windows::Forms::DockStyle::Left;
835
			this->ButInstall->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ButInstall.Image")));
836
			this->ButInstall->Location = System::Drawing::Point(0, 0);
837
			this->ButInstall->Name = L"ButInstall";
838
			this->ButInstall->Size = System::Drawing::Size(122, 26);
839
			this->ButInstall->TabIndex = 0;
840
			this->ButInstall->Text = L"Install Package";
841
			this->ButInstall->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
842
			this->ButInstall->UseVisualStyleBackColor = true;
843
			// 
844
			// statusStrip1
845
			// 
846
			this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->LabelStatus});
847
			this->statusStrip1->Location = System::Drawing::Point(0, 588);
848
			this->statusStrip1->Name = L"statusStrip1";
849
			this->statusStrip1->Size = System::Drawing::Size(626, 22);
850
			this->statusStrip1->TabIndex = 5;
851
			this->statusStrip1->Text = L"statusStrip1";
852
			// 
853
			// LabelStatus
854
			// 
855
			this->LabelStatus->Name = L"LabelStatus";
856
			this->LabelStatus->Size = System::Drawing::Size(0, 17);
857
			// 
858
			// imageList1
859
			// 
860
			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
861
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
862
			this->imageList1->Images->SetKeyName(0, L"ship.png");
863
			this->imageList1->Images->SetKeyName(1, L"package.png");
864
			this->imageList1->Images->SetKeyName(2, L"fake.png");
865
			this->imageList1->Images->SetKeyName(3, L"library.png");
866
			this->imageList1->Images->SetKeyName(4, L"archive.png");
86 cycrow 867
			this->imageList1->Images->SetKeyName(5, L"tick.png");
868
			this->imageList1->Images->SetKeyName(6, L"no.png");
1 cycrow 869
			// 
870
			// imageList2
871
			// 
872
			this->imageList2->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList2.ImageStream")));
873
			this->imageList2->TransparentColor = System::Drawing::Color::Transparent;
874
			this->imageList2->Images->SetKeyName(0, L"application");
875
			this->imageList2->Images->SetKeyName(1, L"exe");
876
			this->imageList2->Images->SetKeyName(2, L"doc");
877
			this->imageList2->Images->SetKeyName(3, L"pdf");
878
			this->imageList2->Images->SetKeyName(4, L"xls");
879
			this->imageList2->Images->SetKeyName(5, L"xlsx");
880
			// 
881
			// imageList3
882
			// 
883
			this->imageList3->ColorDepth = System::Windows::Forms::ColorDepth::Depth8Bit;
884
			this->imageList3->ImageSize = System::Drawing::Size(16, 16);
885
			this->imageList3->TransparentColor = System::Drawing::Color::Transparent;
886
			// 
887
			// backgroundWorker2
888
			// 
889
			this->backgroundWorker2->WorkerReportsProgress = true;
890
			this->backgroundWorker2->WorkerSupportsCancellation = true;
891
			this->backgroundWorker2->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &MainGui::backgroundWorker2_DoWork);
892
			this->backgroundWorker2->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &MainGui::backgroundWorker2_RunWorkerCompleted);
893
			// 
894
			// MainGui
895
			// 
896
			this->AllowDrop = true;
897
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
898
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
899
			this->ClientSize = System::Drawing::Size(626, 610);
900
			this->Controls->Add(this->GroupPackages);
901
			this->Controls->Add(this->panel1);
902
			this->Controls->Add(this->GroupDir);
903
			this->Controls->Add(this->statusStrip1);
904
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
905
			this->Name = L"MainGui";
906
			this->StartPosition = System::Windows::Forms::FormStartPosition::Manual;
907
			this->Text = L"X-Universe Plugin Manager Lite";
908
			this->Load += gcnew System::EventHandler(this, &MainGui::MainGui_Load);
909
			this->GroupDir->ResumeLayout(false);
910
			this->contextMenuStrip1->ResumeLayout(false);
911
			this->panel1->ResumeLayout(false);
912
			this->panel1->PerformLayout();
913
			this->GroupPackages->ResumeLayout(false);
914
			this->PanelDisplay->ResumeLayout(false);
915
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->PictureDisplay))->EndInit();
916
			this->panel2->ResumeLayout(false);
917
			this->panel2->PerformLayout();
918
			this->statusStrip1->ResumeLayout(false);
919
			this->statusStrip1->PerformLayout();
920
			this->ResumeLayout(false);
921
			this->PerformLayout();
922
 
923
		}
924
#pragma endregion
925
private: System::Void MainGui_Load(System::Object^  sender, System::EventArgs^  e) {
926
			 if ( m_iSaveGameManager == -1 )
927
			 {
928
				 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 )
929
				 {
930
					 m_iSaveGameManager = 1;
931
					 this->PrepareSaveGameManager();
932
				 }
933
				 else
934
					 m_iSaveGameManager = 0;
935
			 }
936
 
937
			 m_pMenuBar->SetSaveGameManager((m_iSaveGameManager == 1) ? true : false);
938
 
939
 			// auto update
940
			if ( m_iSizeX != -1 && m_iSizeY != -1 )
941
				this->Size = System::Drawing::Size(m_iSizeX, m_iSizeY);
942
 
943
			this->UpdateBuiltInPackages();
944
			this->AutoUpdate();
945
 
946
		 }
947
private: System::Void ButRun_Click(System::Object^  sender, System::EventArgs^  e) {
948
			 this->LaunchGame();
949
		 }
950
private: System::Void uninstallToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
951
			 if ( m_pListItem )
952
			 {
953
				 ArrayList ^List = gcnew ArrayList();
954
				 List->Add(m_pListItem);
955
				 this->UninstallList(List);
956
			 }
957
		 }
958
private: System::Void ContextEnable_Click(System::Object^  sender, System::EventArgs^  e) {
959
			 if ( m_pListItem )
960
			 {
961
				 ArrayList ^List = gcnew ArrayList();
962
				 List->Add(m_pListItem);
963
				 this->DisableList(List);
964
			 }
965
		 }
966
private: System::Void ContextDisable_Click(System::Object^  sender, System::EventArgs^  e) {
967
			 if ( m_pListItem )
968
			 {
969
				 ArrayList ^List = gcnew ArrayList();
970
				 List->Add(m_pListItem);
971
				 this->DisableList(List);
972
			 }
973
		 }
974
private: System::Void ListPackages_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
975
private: System::Void ListPackages_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
976
private: System::Void UninstallSelectedContext_Click(System::Object^  sender, System::EventArgs^  e) {
977
			 UninstallEvent(sender, e);
978
		 }
979
private: System::Void ContextName_Click(System::Object^  sender, System::EventArgs^  e) {
980
 
981
			CBaseFile *p = this->GetFileFromItem(m_pListItem);
982
			if ( p )
983
			{
984
				SpkExplorer::PackageInfo ^info = gcnew SpkExplorer::PackageInfo(p, m_pPackages->GetLanguage());
985
				info->ShowDialog(this);
986
			}
987
		 }
988
private: System::Void contextMenuStrip1_Opening(System::Object^  sender, System::ComponentModel::CancelEventArgs^  e) {
989
			 this->OpenContextMenu(sender, e);
990
		 }
991
private: System::Void ListPackages_MouseDoubleClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
992
			ListViewItem ^item = this->FindSelectedItem();
993
			if ( item )
994
			{
995
				CBaseFile *p = this->GetFileFromItem(item);
996
				if ( p )
997
				{
998
					SpkExplorer::PackageInfo ^info = gcnew SpkExplorer::PackageInfo(p, m_pPackages->GetLanguage());
999
					info->ShowDialog(this);
1000
				}
1001
			}
1002
		 }
1003
private: System::Void emailAuthorToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1004
			 this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
1005
		 }
1006
private: System::Void visitForumPageToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1007
			 this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
1008
		 }
1009
private: System::Void visitWebSiteToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1010
			 this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
1011
		 }
1012
private: System::Void checkForUpdatesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1013
			if ( m_pListItem )
1014
			{
1015
				CBaseFile *p = this->GetFileFromItem(m_pListItem);
1016
				if ( p )
1017
				{
1018
					CheckUpdate ^update = gcnew CheckUpdate(m_pPackages, this->imageList1);
1019
					update->OnePackage(p);
1020
					this->ClearSelectedItems();
1021
					if ( update->ShowDialog(this) == Windows::Forms::DialogResult::OK )
1022
					{
1023
						for ( int i = 0; i < update->GetInstallList()->Count; i++ )
1024
							this->InstallPackage(Convert::ToString(update->GetInstallList()[i]), false, false, true);
1025
						this->StartInstalling(false, true);
1026
					}
1027
				}
1028
			}
1029
		 }
1030
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
1031
			 this->InstallArchive();
1032
		 }
1033
private: System::Void backgroundWorker2_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
1034
			m_pConverted = (CArchiveFile *)m_pPackages->CreateFromArchive(CyStringFromSystemString(m_sConvertFile), true);
1035
		 }
1036
private: System::Void backgroundWorker2_RunWorkerCompleted(System::Object^  sender, System::ComponentModel::RunWorkerCompletedEventArgs^  e) {
1037
				if ( m_pWait ) 
1038
				{
1039
					m_pWait->Close();
1040
					delete m_pWait;
1041
					m_pWait = nullptr;
1042
				}
1043
 
1044
				if ( !m_pConverted )
1045
					this->DisplayMessageBox(false, "Unable to open", "Unable to open archive file, " + m_sConvertFile, MessageBoxButtons::OK, MessageBoxIcon::Error);
1046
				else
1047
				{
1048
					bool errored = false;
1049
					int errorNum = m_pPackages->PrepareInstallPackage(m_pConverted, false, false, IC_ALL);
1050
					if ( errorNum != INSTALLCHECK_OK )
1051
					{
1052
						if ( errorNum == INSTALLCHECK_NOSHIP )
1053
						{
1054
							this->DisplayMessageBox(false, "No Ships", "Ships are not supported for " + SystemStringFromCyString(m_pPackages->GetGameName()), MessageBoxButtons::OK, MessageBoxIcon::Stop);
1055
							errored = true;
1056
						}
1057
						else if ( m_pPackages->PrepareInstallPackage(m_pConverted, false, false, IC_MODIFIED) != INSTALLCHECK_OK )
1058
						{
1059
							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);
1060
							errored = true;
1061
						}
1062
					}
1063
 
1064
					if ( !errored )
1065
						this->StartInstallingArchive(false, true);
1066
				}
1067
		 }
86 cycrow 1068
private: System::Void ListPackages_DrawSubItem(System::Object^  sender, System::Windows::Forms::DrawListViewSubItemEventArgs^  e) {
1069
			 if ( System::String::Compare(e->SubItem->Text, "Yes") == 0 ) {
1070
				e->DrawDefault = false;
1071
				e->DrawBackground();
1072
 
1073
				Image ^img = this->imageList1->Images[this->imageList1->Images->IndexOfKey("tick.png")];
1074
				e->Graphics->DrawImage(img, e->SubItem->Bounds.Location);
1075
				e->Graphics->DrawString(e->SubItem->Text, e->SubItem->Font, gcnew SolidBrush(e->SubItem->ForeColor), (float)(e->SubItem->Bounds.Location.X + img->Width), (float)e->SubItem->Bounds.Location.Y);
1076
			 }
1077
			 else 
1078
				e->DrawDefault = true;
1079
		 }
1 cycrow 1080
};
1081
}