Subversion Repositories spk

Rev

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