Subversion Repositories spk

Rev

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