Esempio n. 1
0
        private void compileButton_Click(object sender, EventArgs e)
        {
            foreach (String fileName in vmfListBox.Items)
            {
                String propperPath = launcher.GetCurrentGame().installPath + "\\bin\\propper.exe";

                if (!File.Exists(propperPath))
                {
                    if (File.Exists(Application.StartupPath + "\\Tools\\Propper\\propper.exe"))
                    {
                        File.Copy(Application.StartupPath + "\\Tools\\Propper\\propper.exe", propperPath, true);
                        File.Copy(Application.StartupPath + "\\Tools\\Propper\\propper.fgd", propperPath, true);
                    }
                    else
                    {
                        MessageBox.Show("Could not find propper.exe");
                        return;
                    }
                }

                String modPath = launcher.GetCurrentMod().installPath;

                ProcessStartInfo startInfo = new ProcessStartInfo();
                startInfo.FileName  = propperPath;
                startInfo.Arguments = "-game \"" + modPath + "\" \"" + fileName + "\"";
                Process.Start(startInfo);
            }
        }
Esempio n. 2
0
        private void menuFile_ItemClick(object sender, ItemClickEventArgs e)
        {
            // New
            if (e.Item.Name == menuFileNew.Name)
            {
                NewModForm form = new NewModForm();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    string folder     = form.modFolder;
                    string title      = form.modFolder;
                    string gameName   = form.gameName;
                    string gameBranch = form.gameBranch;

                    Game game = launcher.GetGamesList()[gameName];

                    string modName = title + " (" + folder + ")";

                    launcher.SetCurrentGame(game);
                    toolsGames.EditValue = game.name;

                    updateToolsMods();

                    Mod mod = launcher.GetCurrentGame().GetModsList(launcher)[modName];
                    launcher.GetCurrentGame().SetCurrentMod(mod);
                    toolsMods.EditValue = mod.name;
                }
            }

            // Exit
            else if (e.Item.Name == menuFileExit.Name)
            {
                Close();
            }

            // Libraries
            else if (e.Item.Name == menuFileLibraries.Name)
            {
                LibrariesForm form = new LibrariesForm(launcher);
                form.ShowDialog();

                updateToolsGames();
            }
        }
        private void buttonAddVPK_Click(object sender, EventArgs e)
        {
            string gamePath = launcher.GetCurrentGame().installPath + "\\";

            vpkDialog.InitialDirectory = gamePath;
            if (vpkDialog.ShowDialog() == DialogResult.OK)
            {
                Uri path1 = new Uri(gamePath);
                Uri path2 = new Uri(vpkDialog.FileName);
                Uri diff  = path1.MakeRelativeUri(path2);

                string path = diff.OriginalString;
                path.Replace("\\", "/");
                path = "|all_source_engine_paths|" + path;
                path = path.Replace("_dir.vpk", ".vpk");
                path = path.Replace("%20", " ");
                searchPaths.Add(new string[] { "game", path });
            }

            UpdateList();
        }
Esempio n. 4
0
        private void buttonGamedata_Click(object sender, EventArgs e)
        {
            string hammerPath = launcher.GetCurrentGame().installPath + "\\bin\\";

            fgdDialog.InitialDirectory = hammerPath;
            if (fgdDialog.ShowDialog() == DialogResult.OK)
            {
                Uri path1 = new Uri(hammerPath);
                Uri path2 = new Uri(fgdDialog.FileName);
                Uri diff  = path1.MakeRelativeUri(path2);
                textGamedata.EditValue = diff.OriginalString;
            }
        }
        public GameInfo(Launcher launcher)
        {
            this.launcher = launcher;

            switch (launcher.GetCurrentGame().engine)
            {
            case Engine.SOURCE:
                root = KeyValue.readChunkfile(launcher.GetCurrentMod().installPath + "\\gameinfo.txt");
                break;

            case Engine.SOURCE2:
                root = KeyValue.readChunkfile(launcher.GetCurrentMod().installPath + "\\gameinfo.gi");
                break;
            }
        }
        private void ClientSchemeForm_Load(object sender, EventArgs e)
        {
            gamePath = launcher.GetCurrentGame().installPath;
            modPath  = launcher.GetCurrentMod().installPath;

            string path = modPath + "\\scripts\\hudlayout.res";

            Directory.CreateDirectory(Path.GetDirectoryName(path));

            if (!File.Exists(path))
            {
                MessageBox.Show("File does not exist.");
                Close();
            }

            loadFile(path);
            Application.DoEvents();
            startPreview();
        }