1 |
cycrow |
1 |
#include "../StdAfx.h"
|
|
|
2 |
#include "MenuBar.h"
|
|
|
3 |
|
|
|
4 |
#include "MainGui.h"
|
|
|
5 |
#include "FakePatchAssign.h"
|
|
|
6 |
|
|
|
7 |
namespace PluginManager {
|
|
|
8 |
void MenuBar::SendEvent(int menuevent)
|
|
|
9 |
{
|
|
|
10 |
MainGui ^gui = cli::safe_cast<MainGui ^>(this->Parent);
|
|
|
11 |
|
|
|
12 |
switch(menuevent)
|
|
|
13 |
{
|
|
|
14 |
case MENUEVENT_EXIT:
|
|
|
15 |
gui->Close();
|
|
|
16 |
break;
|
|
|
17 |
case MENUEVENT_PACKAGEUPDATE:
|
|
|
18 |
gui->PackageUpdates();
|
|
|
19 |
break;
|
|
|
20 |
case MENUEVENT_FAKEPATCHCONTROL:
|
|
|
21 |
gui->FakePatchControlDialog();
|
|
|
22 |
break;
|
|
|
23 |
case MENUEVENT_FAKEPATCHCOMPAT:
|
|
|
24 |
gui->CheckFakePatchCompatability();
|
|
|
25 |
break;
|
89 |
cycrow |
26 |
case MENUEVENT_COMMANDSLOTS:
|
|
|
27 |
gui->CommandSlotsDialog();
|
|
|
28 |
break;
|
1 |
cycrow |
29 |
case MENUEVENT_EDITGLOBAL:
|
|
|
30 |
gui->EditGlobalsDialog();
|
|
|
31 |
break;
|
88 |
cycrow |
32 |
case MENUEVENT_EDITWARES:
|
|
|
33 |
gui->EditWaresDialog();
|
|
|
34 |
break;
|
1 |
cycrow |
35 |
case MENUEVENT_ABOUT:
|
|
|
36 |
gui->AboutDialog();
|
|
|
37 |
break;
|
|
|
38 |
case MENUEVENT_FILELOG:
|
|
|
39 |
gui->ViewFileLog();
|
|
|
40 |
break;
|
|
|
41 |
case MENUEVENT_FINDPACKAGE:
|
|
|
42 |
gui->FindPackagesOnline();
|
|
|
43 |
break;
|
|
|
44 |
case MENUEVENT_SAVEGAMEMANAGER:
|
145 |
cycrow |
45 |
if (this->enabledToolStripMenuItem->Checked)
|
|
|
46 |
{
|
|
|
47 |
MessageBox::Show(this, "Save game managed is current disabled in this version");
|
|
|
48 |
this->enabledToolStripMenuItem->Checked = false;
|
|
|
49 |
}
|
|
|
50 |
else
|
|
|
51 |
gui->SetSaveGameManager(this->enabledToolStripMenuItem->Checked);
|
1 |
cycrow |
52 |
break;
|
|
|
53 |
case MENUEVENT_INSTALLARCHIVE:
|
|
|
54 |
gui->InstallArchive();
|
|
|
55 |
break;
|
|
|
56 |
case MENUEVENT_EXPORTPACKAGE:
|
|
|
57 |
gui->ExportPackageList();
|
|
|
58 |
break;
|
|
|
59 |
case MENUEVENT_VERIFYFILES:
|
|
|
60 |
gui->VerifyInstalledFiles();
|
|
|
61 |
break;
|
121 |
cycrow |
62 |
case MENUEVENT_DIRECTORYCONTROL:
|
|
|
63 |
gui->OpenDirectoryControl();
|
|
|
64 |
break;
|
1 |
cycrow |
65 |
}
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
void MenuBar::ViewFakePatchs()
|
|
|
69 |
{
|
|
|
70 |
FakePatchAssign ^fpa = gcnew FakePatchAssign(cli::safe_cast<MainGui ^>(this->Parent)->GetPackageControl());
|
|
|
71 |
fpa->ShowDialog(this->Parent);
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
void MenuBar::SetupEvents()
|
|
|
75 |
{
|
|
|
76 |
this->installPackageToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::InstallEvent);
|
|
|
77 |
this->vanillaToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::VanillaEvent);
|
|
|
78 |
this->modifiedToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModifiedEvent);
|
|
|
79 |
this->modSelectorToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModSelectorEvent);
|
|
|
80 |
this->packageBrowserToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::PackageBrowserEvent);
|
|
|
81 |
}
|
|
|
82 |
};
|