private void gameGallery_ItemCheckedChanged(object sender,
                                                    DevExpress.XtraBars.Ribbon.GalleryItemEventArgs e)
        {
            string branchAndGame = e.Item.Tag.ToString();
            string engineName    = branchAndGame.Split('/')[0];

            gameName   = branchAndGame.Split('/')[1];
            gameBranch = branchAndGame.Split('/')[2];

            switch (engineName)
            {
            case "source":
                engine = Engine.SOURCE;
                SetBaseModPath(Launcher.GetInstallPath() + "\\steamapps\\sourcemods\\");
                break;

            case "source2":
                engine = Engine.SOURCE2;
                SetBaseModPath(launcher.GetGamesList()[gameName].installPath + "\\game\\");
                break;

            case "goldsrc":
                engine = Engine.GOLDSRC;
                SetBaseModPath(launcher.GetGamesList()[gameName].installPath + "\\");
                break;
            }

            ValidateModFolder();

            checkModDetails();
        }
Beispiel #2
0
        private void menuChoreography_ItemClick(object sender, ItemClickEventArgs e)
        {
            // Faceposer
            if (e.Item == menuChoreographyFaceposer)
            {
                string gamePath = launcher.GetGamesList()[(toolsGames.EditValue.ToString())].installPath;

                string toolPath = gamePath + "\\bin\\hlfaceposer.exe";
                Process.Start(toolPath);
            }
        }
        private void SearchPathsForm_Load(object sender, EventArgs e)
        {
            string modPath = launcher.GetCurrentMod().installPath;

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

            gameinfo = SourceSDK.KeyValue.readChunkfile(gameinfoPath);

            comboGames.Properties.Items.Clear();
            string appID = gameinfo.getChildByKey("filesystem").getValue("steamappid");

            foreach (KeyValuePair <string, Game> item in launcher.GetGamesList())
            {
                comboGames.Properties.Items.Add(item.Key);
                Game   game      = launcher.GetGamesList()[item.Key];
                string gameAppID = game.GetAppId().ToString();
                if (appID == gameAppID.ToString())
                {
                    comboGames.EditValue = item.Key;
                }
            }

            searchPaths = new List <string[]>();
            foreach (SourceSDK.KeyValue searchPath in gameinfo.getChildByKey("filesystem")
                     .getChildByKey("searchpaths")
                     .getChildren())
            {
                string key = searchPath.getKey();
                if (key == "platform")
                {
                    continue;
                }

                searchPaths.Add(new string[] { key, searchPath.getValue() });
            }

            UpdateList();
        }
        private void NewModForm_Load(object sender, EventArgs e)
        {
            launcher = new Launcher();
            SetBaseModPath(Launcher.GetInstallPath() + "\\steamapps\\sourcemods\\");

            List <string> gamesList = launcher.GetGamesList().Keys.ToList();

            foreach (DevExpress.XtraBars.Ribbon.GalleryItem item in gameGallery.Gallery.GetAllItems())
            {
                string branchName = item.Tag.ToString().Split('/')[2];

                if (gamesList.Contains(item.Tag.ToString().Split('/')[1]))
                {
                    item.Enabled = true;
                    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\Assets\\Posters\\" + branchName + ".png"))
                    {
                        item.ImageOptions.Image = Bitmap.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\Assets\\Posters\\" + branchName + ".png");
                    }
                }
                else
                {
                    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\Assets\\Posters\\" + branchName + "_notinstalled.png"))
                    {
                        item.ImageOptions.Image = Bitmap.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\Assets\\Posters\\" + branchName + "_notinstalled.png");
                    }
                }
            }

            checkModDetails();

            string templateModName = "mymod";

            int counter = 1;

            if (Directory.Exists(baseModPath + templateModName))
            {
                do
                {
                    counter++;
                    templateModName = "mymod" + counter;
                } while (Directory.Exists(baseModPath + templateModName));
            }

            textFolder.EditValue = templateModName;
        }
Beispiel #5
0
 private void gamesCombo_TextChanged(object sender, EventArgs e)
 {
     launcher.SetCurrentGame(launcher.GetGamesList()[gamesCombo.EditValue.ToString()]);
     game = gamesCombo.EditValue.ToString();
     updateModsCombo();
 }