Esempio n. 1
0
        public List <SteamLaunchableModGoldSrc> GetGoldSrcMods()
        {
            // gold source mods
            List <SteamLaunchableModGoldSrc> GoldSourceMods = new List <SteamLaunchableModGoldSrc>();
            string AppInstallDir  = SteamProcessInfo.GetGoldSrcModPath();
            UInt32 sourceModAppID = 70;

            if (Directory.Exists(AppInstallDir))
            {
                Directory.GetDirectories(AppInstallDir)
                .Where(dr => !GoldSrcModSkipFolders.Contains(Path.GetFileName(dr)))
                .Where(dr => File.Exists(Path.Combine(dr, "liblist.gam")))
                .ToList().ForEach(dr =>
                {
                    //VObject rootObj = VdfConvert.Deserialize("\"GameInfo\"\r\n{\r\n" + File.ReadAllText(Path.Combine(dr, "liblist.gam")) + "\r\n}");
                    //VObject tmp = (VObject)rootObj["GameInfo"];
                    //VToken tmp2 = tmp["gamedir"];
                    //UInt64 tmpID = SteamLaunchableShortcut.GetModShortcutID(tmp2.ToString(), sourceModAppID);
                    //if (tmpID > 0) GoldSourceMods.Add(tmpID);

                    SteamLaunchableModGoldSrc mod = SteamLaunchableModGoldSrc.Make(sourceModAppID, dr, Path.Combine(dr, "liblist.gam"));
                    if (mod != null)
                    {
                        GoldSourceMods.Add(mod);
                    }
                });
            }
            return(GoldSourceMods);
        }
Esempio n. 2
0
        public static SteamLaunchableModGoldSrc Make(UInt32 HostAppID, string ModPath, string liblistFilePath)
        {
            Dictionary <string, string> ConfigLines = ProcLibListGamFile(liblistFilePath);

            string gameDir   = ConfigLines.ContainsKey("gamedir") ? ConfigLines["gamedir"] : Path.GetFileName(ModPath);
            string gameTitle = ConfigLines.ContainsKey("game") ? ConfigLines["game"] : gameDir;
            SteamLaunchableModGoldSrc src = new SteamLaunchableModGoldSrc(HostAppID, gameDir, gameTitle)
            {
                ConfigLines = ConfigLines,
                ModPath     = ModPath
            };

            return(src);
        }