Subversion Repositories spk

Rev

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

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