Subversion Repositories spk

Rev

Rev 89 | Go to most recent revision | 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_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:
45
				gui->SetSaveGameManager(this->enabledToolStripMenuItem->Checked);
46
				break;
47
			case MENUEVENT_INSTALLARCHIVE:
48
				gui->InstallArchive();
49
				break;
50
			case MENUEVENT_EXPORTPACKAGE:
51
				gui->ExportPackageList();
52
				break;
53
			case MENUEVENT_VERIFYFILES:
54
				gui->VerifyInstalledFiles();
55
				break;
121 cycrow 56
			case MENUEVENT_DIRECTORYCONTROL:
57
				gui->OpenDirectoryControl();
58
				break;
1 cycrow 59
		}
60
	}
61
 
62
	void MenuBar::ViewFakePatchs()
63
	{
64
		 FakePatchAssign ^fpa = gcnew FakePatchAssign(cli::safe_cast<MainGui ^>(this->Parent)->GetPackageControl());
65
		 fpa->ShowDialog(this->Parent);
66
	}
67
 
68
	void MenuBar::SetupEvents()
69
	{
70
		this->installPackageToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::InstallEvent);
71
		this->vanillaToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::VanillaEvent);
72
		this->modifiedToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModifiedEvent);
73
		this->modSelectorToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModSelectorEvent);
74
		this->packageBrowserToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::PackageBrowserEvent);
75
	}
76
};