Merge pull request #9 from EpicMorg/develop

Develop
This commit is contained in:
Alex_Z 2020-06-10 23:32:36 +03:00 committed by GitHub
commit ac26ae83e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,8 +85,17 @@
libraryPaths.Add(Path.Combine(steamPath, "steamapps")); libraryPaths.Add(Path.Combine(steamPath, "steamapps"));
try {
dynamic configObject = VdfConvert.Deserialize(File.ReadAllText(configPath)).Value; dynamic configObject = VdfConvert.Deserialize(File.ReadAllText(configPath)).Value;
var configLibraryPaths = ((VObject)configObject.Software.Valve.Steam) dynamic valve;
try {
valve = configObject.Software.Valve;
} catch {
valve = configObject.Software.valve;
}
var configLibraryPaths = ((VObject)valve.Steam)
.Children() .Children()
.Where(item => item.Key.StartsWith("BaseInstallFolder")) .Where(item => item.Key.StartsWith("BaseInstallFolder"))
.Select(item => item.Value.ToString()) .Select(item => item.Value.ToString())
@ -94,6 +103,7 @@
.Select(line => Path.Combine(line, "steamapps")); .Select(line => Path.Combine(line, "steamapps"));
libraryPaths.AddRange(configLibraryPaths); libraryPaths.AddRange(configLibraryPaths);
} catch { }
result.SteamLibraryFolders = libraryPaths.ToArray(); result.SteamLibraryFolders = libraryPaths.ToArray();