Every steam install has the root steam folder as a implicit game location

This commit is contained in:
Timothy Baldridge 2019-12-09 15:38:26 -07:00
parent b571c2682d
commit ba556be994
4 changed files with 9 additions and 5 deletions

View File

@ -67,12 +67,13 @@ namespace Wabbajack.Common
public List<string> RequiredFiles { get; internal set; }
public bool Disabled { get; internal set; }
public string GameLocation(bool steam)
public string GameLocation()
{
if (Consts.TestMode)
return Directory.GetCurrentDirectory();
return steam ? SteamHandler.Instance.Games.FirstOrDefault(g => g.Game == Game)?.InstallDir : GOGHandler.Instance.Games.FirstOrDefault(g => g.Game == Game)?.Path;
return SteamHandler.Instance.Games.FirstOrDefault(g => g.Game == Game)?.InstallDir ??
GOGHandler.Instance.Games.FirstOrDefault(g => g.Game == Game)?.Path;
}
}

View File

@ -95,6 +95,9 @@ namespace Wabbajack.Common
paths.Add(s);
});
// Default path in the Steam folder isn't in the configs
paths.Add(Path.Combine(SteamPath, "steamapps"));
InstallFolders = paths;
}

View File

@ -38,10 +38,10 @@ namespace Wabbajack.Lib
protected override bool _Begin()
{
ConfigureProcessor(18, RecommendQueueSize());
var game = GameRegistry.Games[ModList.GameType];
var game = ModList.GameType.MetaData();
if (GameFolder == null)
GameFolder = game.GameLocation(SteamHandler.Instance.Games.Any(g => g.Game == game.Game));
GameFolder = game.GameLocation();
if (GameFolder == null)
{

View File

@ -85,7 +85,7 @@ namespace Wabbajack.Lib
var manualFilesDir = Path.Combine(OutputFolder, Consts.ManualGameFilesDir);
var gameFolder = GameInfo.GameLocation(SteamHandler.Instance.Games.Any(g => g.Game == GameInfo.Game));
var gameFolder = GameInfo.GameLocation();
Info($"Copying files from {manualFilesDir} " +
$"to the game folder at {gameFolder}");