private void buttonSave_Click(object sender, EventArgs e)
        {
            string modPath = launcher.GetCurrentMod().installPath;

            Game game  = launcher.GetGamesList()[comboGames.EditValue.ToString()];
            int  appID = game.GetAppId();

            gameinfo.getChildByKey("filesystem").setValue("steamappid", appID.ToString());

            searchPaths.Add(new string[] { "platform", "|all_source_engine_paths|platform/platform_misc.vpk" });
            searchPaths.Add(new string[] { "platform", "|all_source_engine_paths|platform" });

            SourceSDK.KeyValue searchPathsKV = gameinfo.getChildByKey("filesystem").getChildByKey("searchpaths");
            searchPathsKV.clearChildren();
            foreach (String[] searchPath in searchPaths)
            {
                searchPathsKV.addChild(new SourceSDK.KeyValue(searchPath[0], searchPath[1]));
            }

            string path = modPath + "\\gameinfo.txt";

            SourceSDK.KeyValue.writeChunkFile(path, gameinfo, false, new UTF8Encoding(false));

            Close();
        }
        private void createButton_Click(object sender, EventArgs e)
        {
            modFolder = textFolder.EditValue.ToString();

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

            string appId = game.GetAppId().ToString();

            string mod      = modFolder + " (" + modFolder + ")";
            string gamePath = game.installPath;
            string modPath  = baseModPath + modFolder;

            // Copy the mod template
            string templatePath = AppDomain.CurrentDomain.BaseDirectory +
                                  "Templates\\" +
                                  game.name +
                                  "\\" +
                                  gameBranch +
                                  "\\";

            foreach (string file in Directory.GetFiles(templatePath, "*", SearchOption.AllDirectories))
            {
                string destinationPath      = modPath + "\\" + file.Replace(templatePath, string.Empty);
                string destinationDirectory = new FileInfo(destinationPath).Directory.FullName;
                Directory.CreateDirectory(destinationDirectory);
                File.Copy(file, destinationPath);
            }
            switch (engine)
            {
            case Engine.SOURCE:
            {
                File.Move(modPath + "\\resource\\template_english.txt", modPath + "\\resource\\" + modFolder + "_english.txt");

                SourceSDK.KeyValue gameInfo = SourceSDK.KeyValue.readChunkfile(modPath + "\\gameinfo.txt");
                gameInfo.setValue("game", modFolder);
                gameInfo.setValue("title", modFolder);

                SourceSDK.KeyValue.writeChunkFile(modPath + "\\gameinfo.txt", gameInfo, false, new UTF8Encoding(false));
            }
            break;

            case Engine.SOURCE2:
            {
                SourceSDK.KeyValue gameInfo = SourceSDK.KeyValue.readChunkfile(modPath + "\\gameinfo.gi");
                gameInfo.setValue("game", modFolder);
                gameInfo.setValue("title", modFolder);

                SourceSDK.KeyValue searchPaths = gameInfo.getChildByKey("filesystem").getChildByKey("searchpaths");
                searchPaths.clearChildren();
                searchPaths.addChild("game", modFolder);
                searchPaths.addChild("game", "hlvr");
                searchPaths.addChild("game", "core");
                searchPaths.addChild("mod", modFolder);
                searchPaths.addChild("write", modFolder);

                SourceSDK.KeyValue.writeChunkFile(modPath + "\\gameinfo.gi", gameInfo, false, new UTF8Encoding(false));
            }
            break;

            case Engine.GOLDSRC:
            {
                SourceSDK.KeyValue gameInfo = SourceSDK.Config.readChunkfile(modPath + "\\liblist.gam");
                gameInfo.setValue("game", modFolder);

                SourceSDK.Config.writeChunkFile(modPath + "\\liblist.gam", gameInfo, false, new UTF8Encoding(false));
            }
            break;
            }


            DialogResult = DialogResult.OK;
            Close();
        }