Merge pull request #326 from erri120/steam-fixes-2

Added more verbose output to the SteamHandler when finding libs/games
This commit is contained in:
Timothy Baldridge 2020-01-01 06:09:15 -08:00 committed by GitHub
commit 7b6f445304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,8 @@ namespace Wabbajack.Common
{
var steamKey = Registry.CurrentUser.OpenSubKey(SteamRegKey);
SteamPath = steamKey?.GetValue("SteamPath").ToString();
if(string.IsNullOrWhiteSpace(SteamPath) || steamKey == null || !Directory.Exists(SteamPath))
Utils.ErrorThrow(new Exception("Could not find the Steam folder!"));
if(!init) return;
LoadInstallFolders();
LoadAllSteamGames();
@ -92,10 +94,15 @@ namespace Wabbajack.Common
if (!l.Contains("BaseInstallFolder_")) return;
var s = GetVdfValue(l);
s = Path.Combine(s, "steamapps");
if(Directory.Exists(s))
paths.Add(s);
if (!Directory.Exists(s))
return;
paths.Add(s);
Utils.Log($"Steam Library found at {s}");
});
Utils.Log($"Total number of Steam Libraries found: {paths.Count}");
// Default path in the Steam folder isn't in the configs
if(Directory.Exists(Path.Combine(SteamPath, "steamapps")))
paths.Add(Path.Combine(SteamPath, "steamapps"));
@ -145,9 +152,13 @@ namespace Wabbajack.Common
g.RequiredFiles.TrueForAll(s => File.Exists(Path.Combine(steamGame.InstallDir, s)))
)?.Game;
games.Add(steamGame);
Utils.Log($"Found Game: {steamGame.Name} ({steamGame.AppId}) at {steamGame.InstallDir}");
});
});
Utils.Log($"Total number of Steam Games found: {games.Count}");
Games = games;
}