Subversion Repositories spk

Rev

Rev 89 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "../StdAfx.h"
#include "MenuBar.h"

#include "MainGui.h"
#include "FakePatchAssign.h"

namespace PluginManager {
        void MenuBar::SendEvent(int menuevent)
        {
                MainGui ^gui = cli::safe_cast<MainGui ^>(this->Parent);

                switch(menuevent)
                {
                        case MENUEVENT_EXIT:
                                gui->Close();
                                break;
                        case MENUEVENT_PACKAGEUPDATE:
                                gui->PackageUpdates();
                                break;
                        case MENUEVENT_FAKEPATCHCONTROL:
                                gui->FakePatchControlDialog();
                                break;
                        case MENUEVENT_FAKEPATCHCOMPAT:
                                gui->CheckFakePatchCompatability();
                                break;
                        case MENUEVENT_COMMANDSLOTS:
                                gui->CommandSlotsDialog();
                                break;
                        case MENUEVENT_EDITGLOBAL:
                                gui->EditGlobalsDialog();
                                break;
                        case MENUEVENT_EDITWARES:
                                gui->EditWaresDialog();
                                break;
                        case MENUEVENT_ABOUT:
                                gui->AboutDialog();
                                break;
                        case MENUEVENT_FILELOG:
                                gui->ViewFileLog();
                                break;
                        case MENUEVENT_FINDPACKAGE:
                                gui->FindPackagesOnline();
                                break;
                        case MENUEVENT_SAVEGAMEMANAGER:
                                gui->SetSaveGameManager(this->enabledToolStripMenuItem->Checked);
                                break;
                        case MENUEVENT_INSTALLARCHIVE:
                                gui->InstallArchive();
                                break;
                        case MENUEVENT_EXPORTPACKAGE:
                                gui->ExportPackageList();
                                break;
                        case MENUEVENT_VERIFYFILES:
                                gui->VerifyInstalledFiles();
                                break;
                        case MENUEVENT_DIRECTORYCONTROL:
                                gui->OpenDirectoryControl();
                                break;
                }
        }

        void MenuBar::ViewFakePatchs()
        {
                 FakePatchAssign ^fpa = gcnew FakePatchAssign(cli::safe_cast<MainGui ^>(this->Parent)->GetPackageControl());
                 fpa->ShowDialog(this->Parent);
        }

        void MenuBar::SetupEvents()
        {
                this->installPackageToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::InstallEvent);
                this->vanillaToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::VanillaEvent);
                this->modifiedToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModifiedEvent);
                this->modSelectorToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::ModSelectorEvent);
                this->packageBrowserToolStripMenuItem->Click += gcnew EventHandler(cli::safe_cast<MainGui ^>(this->Parent), &PluginManager::MainGui::PackageBrowserEvent);
        }
};