diff --git a/Wabbajack.Common/StoreHandlers/GOGHandler.cs b/Wabbajack.Common/StoreHandlers/GOGHandler.cs index 70d9e9e2..2bebd135 100644 --- a/Wabbajack.Common/StoreHandlers/GOGHandler.cs +++ b/Wabbajack.Common/StoreHandlers/GOGHandler.cs @@ -56,6 +56,9 @@ namespace Wabbajack.Common.StoreHandlers public override bool LoadAllGames() { + if(Games == null) + Games = new List(); + 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 => diff --git a/Wabbajack.Common/StoreHandlers/SteamHandler.cs b/Wabbajack.Common/StoreHandlers/SteamHandler.cs index f7bbb2e5..e412f552 100644 --- a/Wabbajack.Common/StoreHandlers/SteamHandler.cs +++ b/Wabbajack.Common/StoreHandlers/SteamHandler.cs @@ -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 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(); + SteamUniverses.Do(u => { Directory.EnumerateFiles(u, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f => diff --git a/Wabbajack.Common/StoreHandlers/StoreHandler.cs b/Wabbajack.Common/StoreHandlers/StoreHandler.cs index b303553e..a644bb4b 100644 --- a/Wabbajack.Common/StoreHandlers/StoreHandler.cs +++ b/Wabbajack.Common/StoreHandlers/StoreHandler.cs @@ -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;