Rev 2 | Rev 88 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
#include <spk.h>
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Threading;
#include "About.h"
#include "PackageInstalled.h"
#include "GameLauncherFlags.h"
#include "FakePatchControl.h"
//TODO: remove this, move to a generic shared space
#include "..\..\SpkExplorer\src\Forms\PackageInfo.h"
#include "CheckUpdate.h"
#include "MenuBar.h"
//TODO: remove this, move to a generic shared space
#include "..\..\Creator\src\Forms\Waiting.h"
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};
enum {SORT_NAME, SORT_AUTHOR, SORT_VERSION, SORT_CREATED, SORT_TYPE, SORT_ENABLE, SORT_SIGNED};
#define MAXTIPS 1
#define TIPSECTION_YESNO 0
#define TIP_NONE 0
#define TIP_SHIPUNINSTALL 1
#define TIP_SHIPDISABLE 2
namespace PluginManager {
/// <summary>
/// Summary for MainGui
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class MainGui : public System::Windows::Forms::Form
{
public:
MainGui(CPackages *p, CyStringList *list, CyStringList *removed, bool advanced)
{
InitializeComponent();
// additional controls
m_pMenuBar = gcnew MenuBar(this, advanced);
m_pWait = nullptr;
m_bAdvanced = advanced;
m_iSaveGameManager = -1;
m_lTips = gcnew ArrayList();
for ( int i = 0; i < MAXTIPS; i++ )
{
STips ^t = gcnew STips;
t->iTips = 0;
m_lTips->Add(t);
this->SetTipStrings(i);
}
// set pointers
m_pPackages = p;
m_pDirList = list;
m_pRemovedDirList = removed;
m_pUpdateList = NULL;
m_pListItem = nullptr;
m_pFileErrors = new CyStringList;
m_bDirLocked = false;
// default values
m_iBackgroundTask = MGUI_BACKGROUND_NONE;
m_bSortingAsc = true;
m_iSortingColumn = SORT_NAME;
m_bExperimental = m_bCheat = m_bModSelectorDetails = m_bShips = m_bDownloadable = m_bSigned = false;
m_bAutoUpdate = true;
m_bRunningBackground = false;
m_bDisplayDialog = false;
m_bDisplayMessage = false;
m_sGameArgs = "-noabout";
m_pLauncherFlags = new SGameLauncherFlags;
m_pLauncherFlags->iIgnoreJoy = 0;
m_pLauncherFlags->bNoAbout = true;
m_iSizeX = -1;
m_iSizeY = -1;
this->Text = GetProgramName(m_bAdvanced) + " " + GetVersionString();
// update the gui
this->UpdateControls();
// update the display
this->UpdateDirList();
this->UpdatePackages();
// setup the events
this->SetupEventHandlers();
//this->ButRun->Hide();
}
void DisplayLocked(bool inthread);
void GetGameDirs(CyString &dir, bool askDir, bool askDirAddon);
void CheckProtectedDir();
void PrepareSaveGameManager()
{
// copy save games to each game dir
}
void InstallArchive()
{
if ( m_bDirLocked ) {
this->DisplayLocked(false);
return;
}
OpenFileDialog ^ofd = gcnew OpenFileDialog();
ofd->Filter = "All Supported Archives|*.zip; *.rar|Zip Archive (*.zip)|*.zip|Rar Archive (*.rar)|*.rar";
ofd->Title = "Select archive file you wish to install";
ofd->FilterIndex = 1;
ofd->RestoreDirectory = true;
ofd->Multiselect = false;
if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
{
m_sConvertFile = ofd->FileName;
m_pWait = gcnew Creator::Waiting("Converting: " + IO::FileInfo(m_sConvertFile).Name);
this->backgroundWorker2->RunWorkerAsync();
m_pWait->ShowDialog(this);
}
}
void AboutDialog()
{
CBaseFile *pm = m_pPackages->FindScriptByAuthor("PluginManager");
System::String ^scriptVer = "None";
if ( pm )
{
scriptVer = _US(pm->version());
if ( !pm->creationDate().empty() )
scriptVer += " (" + _US(pm->creationDate()) + ")";
}
About ^about = gcnew About(GetVersionString(), PMLDATE, scriptVer, m_bAdvanced);
about->ShowDialog(this);
}
// config
void SetSize(int x, int y) { m_iSizeX = x; m_iSizeY = y; }
void SetTipStrings(int section);
void SetTips(int tip, int done)
{
if ( tip < 0 )
return;
if ( tip > (int)MAXTIPS )
return;
((STips ^)m_lTips[tip])->iTips = done;
}
void SetSaveGameManager(int i) { m_iSaveGameManager = i; }
void SetExperimental(bool b) { m_bExperimental = b; }
void SetShips(bool b) { m_bShips = b; }
void SetOnlySigned(bool b) { m_bSigned = b; }
void SetCheat(bool b) { m_bCheat = b; }
void SetDownloadable(bool b) { m_bDownloadable = b; }
void SetModSelectorDetails(bool b) { m_bModSelectorDetails = b; }
void SetAutoUpdate(bool b) { m_bAutoUpdate = b; }
void SetIgnoreJoy(long j) { m_pLauncherFlags->iIgnoreJoy = j; }
void ForceEMP(bool b) { m_pPackages->SetForceEMP(b); }
int GetSaveGameManager() { return m_iSaveGameManager; }
bool IsModSelectorDetailsShowing() { return m_bModSelectorDetails; }
bool IsShips() { return m_bShips; }
bool IsOnlySigned() { return m_bSigned; }
bool IsExperimental() { return m_bExperimental; }
bool IsCheat() { return m_bCheat; }
bool IsDownloadable() { return m_bDownloadable; }
bool IsAutoUpdate() { return m_bAutoUpdate; }
int GetTips(int tip)
{
if ( tip < 0 || tip >= MAXTIPS )
return -1;
return ((STips ^)m_lTips[tip])->iTips;
}
int GetMaxTips() { return (int)MAXTIPS; }
long GetIgnoreJoy() { return m_pLauncherFlags->iIgnoreJoy; }
// gui updates
void UpdateDirList();
void UpdatePackages();
void UpdateControls();
bool UpdateBuiltInPackages();
// auto update
void AutoUpdate();
System::String ^GetDownloadFile() { return m_sDownload; }
// Run
System::String ^GetRunFile() { return m_sRun; }
System::String ^GetGameArgs() { return m_sGameArgs; }
// setup functions
void SetupEventHandlers();
void StartCheckTimer();
// control functions
bool InstallPackage(System::String ^file, bool straightAway, bool builtin, bool background);
void ChangeDirectory(CyString dir);
void SetGameArgs(System::String ^args) { m_sGameArgs = args; }
void AddGameArgs(System::String ^args) { m_sGameArgs += " " + args; }
bool DisplayTip(int tipsection, int tip);
void CheckUnusedShared();
bool CheckAccessRights(String ^dir);
void ClearSelectedItems();
void CheckFakePatchCompatability();
void PackageUpdates()
{
CheckUpdate ^update = gcnew CheckUpdate(m_pPackages, this->imageList1);
this->ClearSelectedItems();
if ( update->ShowDialog(this) == Windows::Forms::DialogResult::OK )
{
for ( int i = 0; i < update->GetInstallList()->Count; i++ )
this->InstallPackage(Convert::ToString(update->GetInstallList()[i]), false, false, true);
this->StartInstalling(false, true);
}
}
// external control events
void InstallEvent(System::Object ^Sender, System::EventArgs ^E);
void VanillaEvent(System::Object ^Sender, System::EventArgs ^E);
void ModifiedEvent(System::Object ^Sender, System::EventArgs ^E);
void AddDirectoryEvent(System::Object ^Sender, System::EventArgs ^E);
void ModSelectorEvent(System::Object ^Sender, System::EventArgs ^E);
void PackageBrowserEvent(System::Object ^Sender, System::EventArgs ^E);
void FindPackagesOnline();
void ViewFileLog();
void EditGlobalsDialog();
void FakePatchControlDialog();
void RemoveDirectory();
void ExportPackageList();
void VerifyInstalledFiles();
CPackages *GetPackageControl() { return m_pPackages; }
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~MainGui()
{
if (components)
{
delete components;
}
delete m_pFileErrors;
delete m_pLauncherFlags;
}
private:
// Events
void ClosedEvent(System::Object ^Sender, System::EventArgs ^E) { this->Close(); }
void PackageListSelected(System::Object ^Sender, System::EventArgs ^E);
void PackageListSort(System::Object ^Sender, ColumnClickEventArgs ^E);
void UninstallEvent(System::Object ^Sender, System::EventArgs ^E);
void DisableEvent(System::Object ^Sender, System::EventArgs ^E);
void ChangeDirectoryEvent(System::Object ^Sender, System::EventArgs ^E);
void Background_DoWork(System::Object ^Sender, DoWorkEventArgs ^E);
void Background_Progress(System::Object ^Sender, ProgressChangedEventArgs ^E);
void Background_Finished(System::Object ^Sender, RunWorkerCompletedEventArgs ^E) { this->Background_Finished(); }
void Background_Finished();
void CloseEvent(System::Object ^Sender, FormClosingEventArgs ^E);
void Updater_Finished(System::Object ^Sender, RunWorkerCompletedEventArgs ^E);
void Updater_DoWork(System::Object ^Sender, DoWorkEventArgs ^E);
void TimerEvent_CheckFile(System::Object ^Sender, System::EventArgs ^E);
void RunItem(System::Object ^sender, System::EventArgs ^e);
ListViewItem ^FindSelectedItem();
CBaseFile *GetFileFromItem(ListViewItem ^item);
System::Void OpenContextMenu(System::Object ^Sender, CancelEventArgs ^E);
void _DisplayPackages(CBaseFile *currentParent, ListViewGroup ^addGroup);
void UpdateRunButton();
bool EnablePackage(CBaseFile *p);
bool StartInstallingArchive(bool builtin, bool background) { return StartInstalling(builtin, background, true); }
bool StartInstalling(bool builtin, bool background) { return StartInstalling(builtin, background, false); }
bool StartInstalling(bool builtin, bool background, bool archive);
void DoInstall(bool builtin, bool frombackground);
void DoUninstall();
void DoDisable();
bool RemoveCurrentDirectory();
CBaseFile *FindPackageFromList(ListViewItem ^item);
bool StartBackground(int type);
bool StartBackground(int type, System::String ^info);
void LaunchGame();
System::Windows::Forms::DialogResult DisplayMessageBox(bool inthread, System::String ^title, System::String ^text, MessageBoxButtons buttons, MessageBoxIcon icon);
void DisableList(ArrayList ^List);
void UninstallList(ArrayList ^List);
void RunFromToolItem(ToolStripMenuItem ^item);
MenuBar ^m_pMenuBar;
CPackages *m_pPackages;
CyStringList *m_pDirList;
CyStringList *m_pRemovedDirList;
CyStringList *m_pUpdateList;
CyStringList *m_pFileErrors;
int m_iBackgroundTask;
int m_iSortingColumn;
bool m_bSortingAsc;
bool m_bSigned;
bool m_bShips;
bool m_bExperimental;
bool m_bCheat;
bool m_bDownloadable;
bool m_bModSelectorDetails;
bool m_bAutoUpdate;
bool m_bRunningBackground;
bool m_bAdvanced;
bool m_bDirLocked;
System::String ^m_sBackgroundInfo;
System::String ^m_sDownload;
System::String ^m_sRun;
System::String ^m_sGameArgs;
PackageInstalled ^m_pPi;
bool m_bDisplayDialog;
bool m_bDisplayMessage;
System::String ^m_sMessageTitle;
System::String ^m_sMessageText;
MessageBoxIcon m_messageIcon;
MessageBoxButtons m_messageButtons;
int m_iSizeX;
int m_iSizeY;
SGameLauncherFlags *m_pLauncherFlags;
ArrayList ^m_lTips;
ListViewItem ^m_pListItem;
int m_iSaveGameManager;
String ^m_sConvertFile;
Creator::Waiting ^m_pWait;
CArchiveFile *m_pConverted;
private:
private:
private: System::Windows::Forms::GroupBox^ GroupDir;
private: System::Windows::Forms::ComboBox^ ComboDir;
private: System::Windows::Forms::ListView^ ListPackages;
private: System::Windows::Forms::ColumnHeader^ columnHeader1;
private: System::Windows::Forms::ColumnHeader^ columnHeader2;
private: System::Windows::Forms::ColumnHeader^ columnHeader3;
private: System::Windows::Forms::ColumnHeader^ columnHeader4;
private: System::Windows::Forms::ColumnHeader^ columnHeader5;
private: System::Windows::Forms::Panel^ panel1;
private: System::Windows::Forms::Button^ ButClose;
private: System::Windows::Forms::GroupBox^ GroupPackages;
private: System::Windows::Forms::ProgressBar^ ProgressBar;
private: System::Windows::Forms::Panel^ panel2;
private: System::Windows::Forms::Button^ ButUninstall;
private: System::Windows::Forms::Button^ ButDisable;
private: System::Windows::Forms::Button^ ButInstall;
private: System::ComponentModel::BackgroundWorker^ backgroundWorker1;
private: System::Windows::Forms::RichTextBox^ TextDesc;
private: System::Windows::Forms::Panel^ PanelDisplay;
private: System::Windows::Forms::PictureBox^ PictureDisplay;
private: System::ComponentModel::BackgroundWorker^ backgroundUpdater;
private: System::Windows::Forms::Button^ ButRun;
private: System::Windows::Forms::StatusStrip^ statusStrip1;
private: System::Windows::Forms::ToolStripStatusLabel^ LabelStatus;
private: System::Windows::Forms::ContextMenuStrip^ contextMenuStrip1;
private: System::Windows::Forms::ToolStripMenuItem^ uninstallToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ ContextSeperator;
private: System::Windows::Forms::ToolStripMenuItem^ ContextEnable;
private: System::Windows::Forms::ToolStripMenuItem^ ContextDisable;
private: System::Windows::Forms::ToolStripMenuItem^ ContextName;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator3;
private: System::Windows::Forms::ImageList^ imageList1;
private: System::Windows::Forms::ToolStripMenuItem^ UninstallSelectedContext;
private: System::Windows::Forms::ColumnHeader^ columnHeader6;
private: System::Windows::Forms::ToolStripMenuItem^ viewReadmeToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ extrasToolStripMenuItem;
private: System::Windows::Forms::ImageList^ imageList2;
private: System::Windows::Forms::ImageList^ imageList3;
private: System::Windows::Forms::ToolStripSeparator^ ContextSeperator2;
private: System::Windows::Forms::ToolStripMenuItem^ emailAuthorToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ visitForumPageToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ visitWebSiteToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator2;
private: System::Windows::Forms::ToolStripMenuItem^ checkForUpdatesToolStripMenuItem;
private: System::Windows::Forms::Button^ button1;
private: System::ComponentModel::BackgroundWorker^ backgroundWorker2;
private: System::ComponentModel::IContainer^ components;
/// <summary>
/// Required designer variable.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MainGui::typeid));
this->GroupDir = (gcnew System::Windows::Forms::GroupBox());
this->ComboDir = (gcnew System::Windows::Forms::ComboBox());
this->ListPackages = (gcnew System::Windows::Forms::ListView());
this->columnHeader1 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader3 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader6 = (gcnew System::Windows::Forms::ColumnHeader());
this->columnHeader5 = (gcnew System::Windows::Forms::ColumnHeader());
this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
this->ContextName = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->uninstallToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->UninstallSelectedContext = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->ContextEnable = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->ContextDisable = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->ContextSeperator = (gcnew System::Windows::Forms::ToolStripSeparator());
this->viewReadmeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->extrasToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->ContextSeperator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->emailAuthorToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->visitForumPageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->visitWebSiteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->checkForUpdatesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->panel1 = (gcnew System::Windows::Forms::Panel());
this->ProgressBar = (gcnew System::Windows::Forms::ProgressBar());
this->ButRun = (gcnew System::Windows::Forms::Button());
this->ButClose = (gcnew System::Windows::Forms::Button());
this->GroupPackages = (gcnew System::Windows::Forms::GroupBox());
this->PanelDisplay = (gcnew System::Windows::Forms::Panel());
this->TextDesc = (gcnew System::Windows::Forms::RichTextBox());
this->PictureDisplay = (gcnew System::Windows::Forms::PictureBox());
this->panel2 = (gcnew System::Windows::Forms::Panel());
this->button1 = (gcnew System::Windows::Forms::Button());
this->ButUninstall = (gcnew System::Windows::Forms::Button());
this->ButDisable = (gcnew System::Windows::Forms::Button());
this->ButInstall = (gcnew System::Windows::Forms::Button());
this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
this->backgroundUpdater = (gcnew System::ComponentModel::BackgroundWorker());
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
this->LabelStatus = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
this->imageList2 = (gcnew System::Windows::Forms::ImageList(this->components));
this->imageList3 = (gcnew System::Windows::Forms::ImageList(this->components));
this->backgroundWorker2 = (gcnew System::ComponentModel::BackgroundWorker());
this->GroupDir->SuspendLayout();
this->contextMenuStrip1->SuspendLayout();
this->panel1->SuspendLayout();
this->GroupPackages->SuspendLayout();
this->PanelDisplay->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->PictureDisplay))->BeginInit();
this->panel2->SuspendLayout();
this->statusStrip1->SuspendLayout();
this->SuspendLayout();
//
// GroupDir
//
this->GroupDir->Controls->Add(this->ComboDir);
this->GroupDir->Dock = System::Windows::Forms::DockStyle::Top;
this->GroupDir->Location = System::Drawing::Point(0, 0);
this->GroupDir->Name = L"GroupDir";
this->GroupDir->Padding = System::Windows::Forms::Padding(5);
this->GroupDir->Size = System::Drawing::Size(626, 52);
this->GroupDir->TabIndex = 0;
this->GroupDir->TabStop = false;
this->GroupDir->Text = L"Current Directory";
//
// ComboDir
//
this->ComboDir->Dock = System::Windows::Forms::DockStyle::Fill;
this->ComboDir->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
this->ComboDir->FormattingEnabled = true;
this->ComboDir->Location = System::Drawing::Point(5, 18);
this->ComboDir->Margin = System::Windows::Forms::Padding(10);
this->ComboDir->Name = L"ComboDir";
this->ComboDir->Size = System::Drawing::Size(616, 21);
this->ComboDir->TabIndex = 0;
//
// ListPackages
//
this->ListPackages->AllowDrop = true;
this->ListPackages->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(6) {this->columnHeader1,
this->columnHeader2, this->columnHeader3, this->columnHeader4, this->columnHeader6, this->columnHeader5});
this->ListPackages->ContextMenuStrip = this->contextMenuStrip1;
this->ListPackages->Dock = System::Windows::Forms::DockStyle::Fill;
this->ListPackages->FullRowSelect = true;
this->ListPackages->HideSelection = false;
this->ListPackages->Location = System::Drawing::Point(3, 16);
this->ListPackages->Name = L"ListPackages";
this->ListPackages->ShowItemToolTips = true;
this->ListPackages->Size = System::Drawing::Size(620, 386);
this->ListPackages->TabIndex = 0;
this->ListPackages->UseCompatibleStateImageBehavior = false;
this->ListPackages->View = System::Windows::Forms::View::Details;
this->ListPackages->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &MainGui::ListPackages_MouseDoubleClick);
this->ListPackages->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &MainGui::ListPackages_DragDrop);
this->ListPackages->DragOver += gcnew System::Windows::Forms::DragEventHandler(this, &MainGui::ListPackages_DragOver);
//
// columnHeader1
//
this->columnHeader1->Text = L"Package";
//
// columnHeader2
//
this->columnHeader2->Text = L"Author";
//
// columnHeader3
//
this->columnHeader3->Text = L"Version";
this->columnHeader3->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
//
// columnHeader4
//
this->columnHeader4->Text = L"Updated";
//
// columnHeader6
//
this->columnHeader6->DisplayIndex = 5;
this->columnHeader6->Text = L"Type";
//
// columnHeader5
//
this->columnHeader5->DisplayIndex = 4;
this->columnHeader5->Text = L"Enabled";
this->columnHeader5->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
//
// contextMenuStrip1
//
this->contextMenuStrip1->ImageScalingSize = System::Drawing::Size(24, 24);
this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(15) {this->ContextName,
this->toolStripSeparator3, this->uninstallToolStripMenuItem, this->UninstallSelectedContext, this->ContextEnable, this->ContextDisable,
this->ContextSeperator, this->viewReadmeToolStripMenuItem, this->extrasToolStripMenuItem, this->ContextSeperator2, this->emailAuthorToolStripMenuItem,
this->visitForumPageToolStripMenuItem, this->visitWebSiteToolStripMenuItem, this->toolStripSeparator2, this->checkForUpdatesToolStripMenuItem});
this->contextMenuStrip1->Name = L"contextMenuStrip1";
this->contextMenuStrip1->Size = System::Drawing::Size(216, 600);
this->contextMenuStrip1->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &MainGui::contextMenuStrip1_Opening);
//
// ContextName
//
this->ContextName->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"ContextName.Image")));
this->ContextName->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->ContextName->Name = L"ContextName";
this->ContextName->Size = System::Drawing::Size(215, 50);
this->ContextName->Text = L"Name";
this->ContextName->Click += gcnew System::EventHandler(this, &MainGui::ContextName_Click);
//
// toolStripSeparator3
//
this->toolStripSeparator3->Name = L"toolStripSeparator3";
this->toolStripSeparator3->Size = System::Drawing::Size(212, 6);
//
// uninstallToolStripMenuItem
//
this->uninstallToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"uninstallToolStripMenuItem.Image")));
this->uninstallToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->uninstallToolStripMenuItem->Name = L"uninstallToolStripMenuItem";
this->uninstallToolStripMenuItem->Size = System::Drawing::Size(215, 50);
this->uninstallToolStripMenuItem->Text = L"Uninstall";
this->uninstallToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::uninstallToolStripMenuItem_Click);
//
// UninstallSelectedContext
//
this->UninstallSelectedContext->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"UninstallSelectedContext.Image")));
this->UninstallSelectedContext->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->UninstallSelectedContext->Name = L"UninstallSelectedContext";
this->UninstallSelectedContext->Size = System::Drawing::Size(215, 50);
this->UninstallSelectedContext->Text = L"Uninstall Selected";
this->UninstallSelectedContext->Click += gcnew System::EventHandler(this, &MainGui::UninstallSelectedContext_Click);
//
// ContextEnable
//
this->ContextEnable->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"ContextEnable.Image")));
this->ContextEnable->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->ContextEnable->Name = L"ContextEnable";
this->ContextEnable->Size = System::Drawing::Size(215, 50);
this->ContextEnable->Text = L"Enable";
this->ContextEnable->Click += gcnew System::EventHandler(this, &MainGui::ContextEnable_Click);
//
// ContextDisable
//
this->ContextDisable->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"ContextDisable.Image")));
this->ContextDisable->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->ContextDisable->Name = L"ContextDisable";
this->ContextDisable->Size = System::Drawing::Size(215, 50);
this->ContextDisable->Text = L"Disable";
this->ContextDisable->Click += gcnew System::EventHandler(this, &MainGui::ContextDisable_Click);
//
// ContextSeperator
//
this->ContextSeperator->Name = L"ContextSeperator";
this->ContextSeperator->Size = System::Drawing::Size(212, 6);
//
// viewReadmeToolStripMenuItem
//
this->viewReadmeToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"viewReadmeToolStripMenuItem.Image")));
this->viewReadmeToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->viewReadmeToolStripMenuItem->Name = L"viewReadmeToolStripMenuItem";
this->viewReadmeToolStripMenuItem->Size = System::Drawing::Size(215, 50);
this->viewReadmeToolStripMenuItem->Text = L"View Readme";
//
// extrasToolStripMenuItem
//
this->extrasToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"extrasToolStripMenuItem.Image")));
this->extrasToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->extrasToolStripMenuItem->Name = L"extrasToolStripMenuItem";
this->extrasToolStripMenuItem->Size = System::Drawing::Size(215, 50);
this->extrasToolStripMenuItem->Text = L"Extras";
//
// ContextSeperator2
//
this->ContextSeperator2->Name = L"ContextSeperator2";
this->ContextSeperator2->Size = System::Drawing::Size(212, 6);
//
// emailAuthorToolStripMenuItem
//
this->emailAuthorToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"emailAuthorToolStripMenuItem.Image")));
this->emailAuthorToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->emailAuthorToolStripMenuItem->Name = L"emailAuthorToolStripMenuItem";
this->emailAuthorToolStripMenuItem->Size = System::Drawing::Size(215, 50);
this->emailAuthorToolStripMenuItem->Text = L"Email Author";
this->emailAuthorToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::emailAuthorToolStripMenuItem_Click);
//
// visitForumPageToolStripMenuItem
//
this->visitForumPageToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"visitForumPageToolStripMenuItem.Image")));
this->visitForumPageToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->visitForumPageToolStripMenuItem->Name = L"visitForumPageToolStripMenuItem";
this->visitForumPageToolStripMenuItem->Size = System::Drawing::Size(215, 50);
this->visitForumPageToolStripMenuItem->Text = L"Visit Forum Page";
this->visitForumPageToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::visitForumPageToolStripMenuItem_Click);
//
// visitWebSiteToolStripMenuItem
//
this->visitWebSiteToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"visitWebSiteToolStripMenuItem.Image")));
this->visitWebSiteToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->visitWebSiteToolStripMenuItem->Name = L"visitWebSiteToolStripMenuItem";
this->visitWebSiteToolStripMenuItem->Size = System::Drawing::Size(215, 50);
this->visitWebSiteToolStripMenuItem->Text = L"Visit Web Site";
this->visitWebSiteToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::visitWebSiteToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this->toolStripSeparator2->Name = L"toolStripSeparator2";
this->toolStripSeparator2->Size = System::Drawing::Size(212, 6);
//
// checkForUpdatesToolStripMenuItem
//
this->checkForUpdatesToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"checkForUpdatesToolStripMenuItem.Image")));
this->checkForUpdatesToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
this->checkForUpdatesToolStripMenuItem->Name = L"checkForUpdatesToolStripMenuItem";
this->checkForUpdatesToolStripMenuItem->Size = System::Drawing::Size(215, 50);
this->checkForUpdatesToolStripMenuItem->Text = L"Check For Updates";
this->checkForUpdatesToolStripMenuItem->Click += gcnew System::EventHandler(this, &MainGui::checkForUpdatesToolStripMenuItem_Click);
//
// panel1
//
this->panel1->AllowDrop = true;
this->panel1->Controls->Add(this->ProgressBar);
this->panel1->Controls->Add(this->ButRun);
this->panel1->Controls->Add(this->ButClose);
this->panel1->Dock = System::Windows::Forms::DockStyle::Bottom;
this->panel1->Location = System::Drawing::Point(0, 551);
this->panel1->Margin = System::Windows::Forms::Padding(5, 10, 5, 10);
this->panel1->Name = L"panel1";
this->panel1->Size = System::Drawing::Size(626, 37);
this->panel1->TabIndex = 2;
//
// ProgressBar
//
this->ProgressBar->Dock = System::Windows::Forms::DockStyle::Fill;
this->ProgressBar->Location = System::Drawing::Point(0, 0);
this->ProgressBar->Margin = System::Windows::Forms::Padding(10);
this->ProgressBar->MarqueeAnimationSpeed = 5;
this->ProgressBar->Name = L"ProgressBar";
this->ProgressBar->Size = System::Drawing::Size(432, 37);
this->ProgressBar->Style = System::Windows::Forms::ProgressBarStyle::Marquee;
this->ProgressBar->TabIndex = 1;
this->ProgressBar->Visible = false;
//
// ButRun
//
this->ButRun->AutoSize = true;
this->ButRun->Dock = System::Windows::Forms::DockStyle::Right;
this->ButRun->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"ButRun.Image")));
this->ButRun->Location = System::Drawing::Point(432, 0);
this->ButRun->Name = L"ButRun";
this->ButRun->Size = System::Drawing::Size(119, 37);
this->ButRun->TabIndex = 2;
this->ButRun->Text = L"Run Game";
this->ButRun->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
this->ButRun->UseVisualStyleBackColor = true;
this->ButRun->Click += gcnew System::EventHandler(this, &MainGui::ButRun_Click);
//
// ButClose
//
this->ButClose->Dock = System::Windows::Forms::DockStyle::Right;
this->ButClose->Location = System::Drawing::Point(551, 0);
this->ButClose->Name = L"ButClose";
this->ButClose->Size = System::Drawing::Size(75, 37);
this->ButClose->TabIndex = 0;
this->ButClose->Text = L"Close";
this->ButClose->UseVisualStyleBackColor = true;
//
// GroupPackages
//
this->GroupPackages->Controls->Add(this->ListPackages);
this->GroupPackages->Controls->Add(this->PanelDisplay);
this->GroupPackages->Controls->Add(this->panel2);
this->GroupPackages->Dock = System::Windows::Forms::DockStyle::Fill;
this->GroupPackages->Location = System::Drawing::Point(0, 52);
this->GroupPackages->Name = L"GroupPackages";
this->GroupPackages->Size = System::Drawing::Size(626, 499);
this->GroupPackages->TabIndex = 3;
this->GroupPackages->TabStop = false;
this->GroupPackages->Text = L"Installed Packages";
//
// PanelDisplay
//
this->PanelDisplay->AllowDrop = true;
this->PanelDisplay->Controls->Add(this->TextDesc);
this->PanelDisplay->Controls->Add(this->PictureDisplay);
this->PanelDisplay->Dock = System::Windows::Forms::DockStyle::Bottom;
this->PanelDisplay->Location = System::Drawing::Point(3, 402);
this->PanelDisplay->Name = L"PanelDisplay";
this->PanelDisplay->Size = System::Drawing::Size(620, 68);
this->PanelDisplay->TabIndex = 2;
//
// TextDesc
//
this->TextDesc->Dock = System::Windows::Forms::DockStyle::Fill;
this->TextDesc->Location = System::Drawing::Point(72, 0);
this->TextDesc->Name = L"TextDesc";
this->TextDesc->ReadOnly = true;
this->TextDesc->Size = System::Drawing::Size(548, 68);
this->TextDesc->TabIndex = 1;
this->TextDesc->Text = L"";
//
// PictureDisplay
//
this->PictureDisplay->Dock = System::Windows::Forms::DockStyle::Left;
this->PictureDisplay->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"PictureDisplay.Image")));
this->PictureDisplay->Location = System::Drawing::Point(0, 0);
this->PictureDisplay->Name = L"PictureDisplay";
this->PictureDisplay->Size = System::Drawing::Size(72, 68);
this->PictureDisplay->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->PictureDisplay->TabIndex = 2;
this->PictureDisplay->TabStop = false;
//
// panel2
//
this->panel2->AllowDrop = true;
this->panel2->Controls->Add(this->button1);
this->panel2->Controls->Add(this->ButUninstall);
this->panel2->Controls->Add(this->ButDisable);
this->panel2->Controls->Add(this->ButInstall);
this->panel2->Dock = System::Windows::Forms::DockStyle::Bottom;
this->panel2->Location = System::Drawing::Point(3, 470);
this->panel2->Name = L"panel2";
this->panel2->Size = System::Drawing::Size(620, 26);
this->panel2->TabIndex = 0;
//
// button1
//
this->button1->Dock = System::Windows::Forms::DockStyle::Left;
this->button1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button1.Image")));
this->button1->Location = System::Drawing::Point(122, 0);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(121, 26);
this->button1->TabIndex = 3;
this->button1->Text = L"Install Archive";
this->button1->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &MainGui::button1_Click);
//
// ButUninstall
//
this->ButUninstall->AutoSize = true;
this->ButUninstall->Dock = System::Windows::Forms::DockStyle::Right;
this->ButUninstall->Location = System::Drawing::Point(357, 0);
this->ButUninstall->Name = L"ButUninstall";
this->ButUninstall->Size = System::Drawing::Size(122, 26);
this->ButUninstall->TabIndex = 2;
this->ButUninstall->Text = L"Uninstall";
this->ButUninstall->UseVisualStyleBackColor = true;
//
// ButDisable
//
this->ButDisable->AutoSize = true;
this->ButDisable->Dock = System::Windows::Forms::DockStyle::Right;
this->ButDisable->Location = System::Drawing::Point(479, 0);
this->ButDisable->Name = L"ButDisable";
this->ButDisable->Size = System::Drawing::Size(141, 26);
this->ButDisable->TabIndex = 1;
this->ButDisable->Text = L"Disable";
this->ButDisable->UseVisualStyleBackColor = true;
//
// ButInstall
//
this->ButInstall->AutoSize = true;
this->ButInstall->Dock = System::Windows::Forms::DockStyle::Left;
this->ButInstall->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"ButInstall.Image")));
this->ButInstall->Location = System::Drawing::Point(0, 0);
this->ButInstall->Name = L"ButInstall";
this->ButInstall->Size = System::Drawing::Size(122, 26);
this->ButInstall->TabIndex = 0;
this->ButInstall->Text = L"Install Package";
this->ButInstall->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
this->ButInstall->UseVisualStyleBackColor = true;
//
// statusStrip1
//
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->LabelStatus});
this->statusStrip1->Location = System::Drawing::Point(0, 588);
this->statusStrip1->Name = L"statusStrip1";
this->statusStrip1->Size = System::Drawing::Size(626, 22);
this->statusStrip1->TabIndex = 5;
this->statusStrip1->Text = L"statusStrip1";
//
// LabelStatus
//
this->LabelStatus->Name = L"LabelStatus";
this->LabelStatus->Size = System::Drawing::Size(0, 17);
//
// imageList1
//
this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^ >(resources->GetObject(L"imageList1.ImageStream")));
this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
this->imageList1->Images->SetKeyName(0, L"ship.png");
this->imageList1->Images->SetKeyName(1, L"package.png");
this->imageList1->Images->SetKeyName(2, L"fake.png");
this->imageList1->Images->SetKeyName(3, L"library.png");
this->imageList1->Images->SetKeyName(4, L"archive.png");
//
// imageList2
//
this->imageList2->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^ >(resources->GetObject(L"imageList2.ImageStream")));
this->imageList2->TransparentColor = System::Drawing::Color::Transparent;
this->imageList2->Images->SetKeyName(0, L"application");
this->imageList2->Images->SetKeyName(1, L"exe");
this->imageList2->Images->SetKeyName(2, L"doc");
this->imageList2->Images->SetKeyName(3, L"pdf");
this->imageList2->Images->SetKeyName(4, L"xls");
this->imageList2->Images->SetKeyName(5, L"xlsx");
//
// imageList3
//
this->imageList3->ColorDepth = System::Windows::Forms::ColorDepth::Depth8Bit;
this->imageList3->ImageSize = System::Drawing::Size(16, 16);
this->imageList3->TransparentColor = System::Drawing::Color::Transparent;
//
// backgroundWorker2
//
this->backgroundWorker2->WorkerReportsProgress = true;
this->backgroundWorker2->WorkerSupportsCancellation = true;
this->backgroundWorker2->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &MainGui::backgroundWorker2_DoWork);
this->backgroundWorker2->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &MainGui::backgroundWorker2_RunWorkerCompleted);
//
// MainGui
//
this->AllowDrop = true;
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(626, 610);
this->Controls->Add(this->GroupPackages);
this->Controls->Add(this->panel1);
this->Controls->Add(this->GroupDir);
this->Controls->Add(this->statusStrip1);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->Name = L"MainGui";
this->StartPosition = System::Windows::Forms::FormStartPosition::Manual;
this->Text = L"X-Universe Plugin Manager Lite";
this->Load += gcnew System::EventHandler(this, &MainGui::MainGui_Load);
this->GroupDir->ResumeLayout(false);
this->contextMenuStrip1->ResumeLayout(false);
this->panel1->ResumeLayout(false);
this->panel1->PerformLayout();
this->GroupPackages->ResumeLayout(false);
this->PanelDisplay->ResumeLayout(false);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->PictureDisplay))->EndInit();
this->panel2->ResumeLayout(false);
this->panel2->PerformLayout();
this->statusStrip1->ResumeLayout(false);
this->statusStrip1->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void MainGui_Load(System::Object^ sender, System::EventArgs^ e) {
if ( m_iSaveGameManager == -1 )
{
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 )
{
m_iSaveGameManager = 1;
this->PrepareSaveGameManager();
}
else
m_iSaveGameManager = 0;
}
m_pMenuBar->SetSaveGameManager((m_iSaveGameManager == 1) ? true : false);
// auto update
if ( m_iSizeX != -1 && m_iSizeY != -1 )
this->Size = System::Drawing::Size(m_iSizeX, m_iSizeY);
this->UpdateBuiltInPackages();
this->AutoUpdate();
}
private: System::Void ButRun_Click(System::Object^ sender, System::EventArgs^ e) {
this->LaunchGame();
}
private: System::Void uninstallToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
if ( m_pListItem )
{
ArrayList ^List = gcnew ArrayList();
List->Add(m_pListItem);
this->UninstallList(List);
}
}
private: System::Void ContextEnable_Click(System::Object^ sender, System::EventArgs^ e) {
if ( m_pListItem )
{
ArrayList ^List = gcnew ArrayList();
List->Add(m_pListItem);
this->DisableList(List);
}
}
private: System::Void ContextDisable_Click(System::Object^ sender, System::EventArgs^ e) {
if ( m_pListItem )
{
ArrayList ^List = gcnew ArrayList();
List->Add(m_pListItem);
this->DisableList(List);
}
}
private: System::Void ListPackages_DragOver(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e);
private: System::Void ListPackages_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e);
private: System::Void UninstallSelectedContext_Click(System::Object^ sender, System::EventArgs^ e) {
UninstallEvent(sender, e);
}
private: System::Void ContextName_Click(System::Object^ sender, System::EventArgs^ e) {
CBaseFile *p = this->GetFileFromItem(m_pListItem);
if ( p )
{
SpkExplorer::PackageInfo ^info = gcnew SpkExplorer::PackageInfo(p, m_pPackages->GetLanguage());
info->ShowDialog(this);
}
}
private: System::Void contextMenuStrip1_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
this->OpenContextMenu(sender, e);
}
private: System::Void ListPackages_MouseDoubleClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
ListViewItem ^item = this->FindSelectedItem();
if ( item )
{
CBaseFile *p = this->GetFileFromItem(item);
if ( p )
{
SpkExplorer::PackageInfo ^info = gcnew SpkExplorer::PackageInfo(p, m_pPackages->GetLanguage());
info->ShowDialog(this);
}
}
}
private: System::Void emailAuthorToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
}
private: System::Void visitForumPageToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
}
private: System::Void visitWebSiteToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->RunFromToolItem(cli::safe_cast<ToolStripMenuItem ^>(sender));
}
private: System::Void checkForUpdatesToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
if ( m_pListItem )
{
CBaseFile *p = this->GetFileFromItem(m_pListItem);
if ( p )
{
CheckUpdate ^update = gcnew CheckUpdate(m_pPackages, this->imageList1);
update->OnePackage(p);
this->ClearSelectedItems();
if ( update->ShowDialog(this) == Windows::Forms::DialogResult::OK )
{
for ( int i = 0; i < update->GetInstallList()->Count; i++ )
this->InstallPackage(Convert::ToString(update->GetInstallList()[i]), false, false, true);
this->StartInstalling(false, true);
}
}
}
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->InstallArchive();
}
private: System::Void backgroundWorker2_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) {
m_pConverted = (CArchiveFile *)m_pPackages->CreateFromArchive(CyStringFromSystemString(m_sConvertFile), true);
}
private: System::Void backgroundWorker2_RunWorkerCompleted(System::Object^ sender, System::ComponentModel::RunWorkerCompletedEventArgs^ e) {
if ( m_pWait )
{
m_pWait->Close();
delete m_pWait;
m_pWait = nullptr;
}
if ( !m_pConverted )
this->DisplayMessageBox(false, "Unable to open", "Unable to open archive file, " + m_sConvertFile, MessageBoxButtons::OK, MessageBoxIcon::Error);
else
{
bool errored = false;
int errorNum = m_pPackages->PrepareInstallPackage(m_pConverted, false, false, IC_ALL);
if ( errorNum != INSTALLCHECK_OK )
{
if ( errorNum == INSTALLCHECK_NOSHIP )
{
this->DisplayMessageBox(false, "No Ships", "Ships are not supported for " + SystemStringFromCyString(m_pPackages->GetGameName()), MessageBoxButtons::OK, MessageBoxIcon::Stop);
errored = true;
}
else if ( m_pPackages->PrepareInstallPackage(m_pConverted, false, false, IC_MODIFIED) != INSTALLCHECK_OK )
{
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);
errored = true;
}
}
if ( !errored )
this->StartInstallingArchive(false, true);
}
}
};
}