mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Updated GameLocation property
This commit is contained in:
parent
ceebe0b745
commit
9d4325a5fe
@ -67,19 +67,12 @@ namespace Wabbajack.Common
|
||||
public List<string> RequiredFiles { get; internal set; }
|
||||
public bool Disabled { get; internal set; }
|
||||
|
||||
public string GameLocation
|
||||
public string GameLocation(bool steam)
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Consts.TestMode)
|
||||
return Directory.GetCurrentDirectory();
|
||||
if (Consts.TestMode)
|
||||
return Directory.GetCurrentDirectory();
|
||||
|
||||
return (string) Registry.GetValue(GameLocationRegistryKey, "installed path", null)
|
||||
??
|
||||
(string) Registry.GetValue(
|
||||
GameLocationRegistryKey.Replace(@"HKEY_LOCAL_MACHINE\SOFTWARE\",
|
||||
@"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\"), "installed path", null);
|
||||
}
|
||||
return steam ? SteamHandler.Instance.Games.FirstOrDefault(g => g.Game == Game)?.InstallDir : GOGHandler.Instance.Games.FirstOrDefault(g => g.Game == Game)?.Path;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace Wabbajack.Lib
|
||||
var game = GameRegistry.Games[ModList.GameType];
|
||||
|
||||
if (GameFolder == null)
|
||||
GameFolder = game.GameLocation;
|
||||
GameFolder = game.GameLocation(SteamHandler.Instance.Games.Any(g => g.Game == game.Game));
|
||||
|
||||
if (GameFolder == null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user