Steam Lib search for beat saber folder

This commit is contained in:
Theenoro
2022-05-15 01:04:38 +02:00
parent a2f01c6100
commit aa2e6cbc60
4 changed files with 37 additions and 5 deletions

View File

@@ -12,31 +12,44 @@ namespace BeatSaber_Versions.controller.helper
public static String getBSFolder()
{
String f = @"C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf";
String basicBeatSaberPath = "";
if (File.Exists(f))
{
dynamic steam = VdfConvert.Deserialize(File.ReadAllText(f));
dynamic libs = steam.Value;
bool found = false;
foreach (dynamic lib in libs)
{
if (found)
{
break;
}
Console.Write(lib);
foreach(dynamic opt in lib)
{
Console.Write(opt);
}
dynamic games = lib.Value[lib.Value.Count-1];
foreach(dynamic game in games)
String path = lib.Value[0].Value.Value;
dynamic games = lib.Value.apps;
foreach (dynamic game in games)
{
Console.Write(game);
if (game.Key == "620980")
{
basicBeatSaberPath = $"{path}\\Beat Saber";
found = true;
break;
}
}
}
}
return "";
return basicBeatSaberPath;
}
}
}