Bug fixes

This commit is contained in:
erri120 2020-01-03 18:22:30 +01:00
parent 62c3178ff2
commit 259863458d
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
3 changed files with 20 additions and 2 deletions

View File

@ -56,6 +56,9 @@ namespace Wabbajack.Common.StoreHandlers
public override bool LoadAllGames()
{
if(Games == null)
Games = new List<AStoreGame>();
try
{
string[] keys = GOGKey.GetSubKeyNames();
@ -94,9 +97,16 @@ namespace Wabbajack.Common.StoreHandlers
var path = pathValue.ToString();
var game = new GOGGame() {ID = gameID, Name = gameName, Path = path};
var game = new GOGGame
{
ID = gameID,
Name = gameName,
Path = path
};
var gameMeta = GameRegistry.Games.Values.FirstOrDefault(g =>
g.GOGIDs != null
&&
g.GOGIDs.Contains(game.ID)
&&
g.RequiredFiles.TrueForAll(file =>

View File

@ -36,7 +36,7 @@ namespace Wabbajack.Common.StoreHandlers
private const string SteamRegKey = @"Software\Valve\Steam";
private string SteamPath { get; set; }
public string SteamPath { get; set; }
private List<string> SteamUniverses { get; set; }
private string SteamConfig => Path.Combine(SteamPath, "config", "config.vdf");
@ -123,6 +123,9 @@ namespace Wabbajack.Common.StoreHandlers
return false;
}
if(Games == null)
Games = new List<AStoreGame>();
SteamUniverses.Do(u =>
{
Directory.EnumerateFiles(u, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f =>

View File

@ -57,6 +57,11 @@ namespace Wabbajack.Common.StoreHandlers
return StoreGames.FirstOrDefault(g => g.Game == game)?.Path;
}
public string GetGamePath(Game game, StoreType type)
{
return StoreGames.FirstOrDefault(g => g.Type == type && g.Game == game)?.Path;
}
public string GetGamePath(int id)
{
return StoreGames.FirstOrDefault(g => g.ID == id)?.Path;