Subversion Repositories spk

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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_REMOVEDIR:
18
				gui->RemoveDirectory();
19
				break;
20
			case MENUEVENT_PACKAGEUPDATE:
21
				gui->PackageUpdates();
22
				break;
23
			case MENUEVENT_FAKEPATCHCONTROL:
24
				gui->FakePatchControlDialog();
25
				break;
26
			case MENUEVENT_FAKEPATCHCOMPAT:
27
				gui->CheckFakePatchCompatability();
28
				break;
29
			case MENUEVENT_EDITGLOBAL:
30
				gui->EditGlobalsDialog();
31
				break;
32
			case MENUEVENT_ABOUT:
33
				gui->AboutDialog();
34
				break;
35
			case MENUEVENT_FILELOG:
36
				gui->ViewFileLog();
37
				break;
38
			case MENUEVENT_FINDPACKAGE:
39
				gui->FindPackagesOnline();
40
				break;
41
			case MENUEVENT_SAVEGAMEMANAGER:
42
				gui->SetSaveGameManager(this->enabledToolStripMenuItem->Checked);
43
				break;
44
			case MENUEVENT_INSTALLARCHIVE:
45
				gui->InstallArchive();
46
				break;
47
			case MENUEVENT_EXPORTPACKAGE:
48
				gui->ExportPackageList();
49
				break;
50
			case MENUEVENT_VERIFYFILES:
51
				gui->VerifyInstalledFiles();
52
				break;
53
		}
54
	}
55
 
56
	void MenuBar::ViewFakePatchs()
57
	{
58
		 FakePatchAssign ^fpa = gcnew FakePatchAssign(cli::safe_cast<MainGui ^>(this->Parent)->GetPackageControl());
59
		 fpa->ShowDialog(this->Parent);
60
	}
61
 
62
	void MenuBar::SetupEvents()
63
	{
64
		this->installPackageToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::InstallEvent);
65
		this->vanillaToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::VanillaEvent);
66
		this->modifiedToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModifiedEvent);
67
		this->addDirectoryToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::AddDirectoryEvent);
68
		this->modSelectorToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModSelectorEvent);
69
		this->packageBrowserToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::PackageBrowserEvent);
70
	}
71
};