Pass in default install directory to managers
parent
20de9d6cae
commit
b77e7f6e53
|
@ -37,7 +37,7 @@ namespace LANCommander.PlaynitePlugin
|
||||||
|
|
||||||
var result = Plugin.PlayniteApi.Dialogs.ActivateGlobalProgress(progress =>
|
var result = Plugin.PlayniteApi.Dialogs.ActivateGlobalProgress(progress =>
|
||||||
{
|
{
|
||||||
var gameManager = new GameManager(Plugin.LANCommanderClient);
|
var gameManager = new GameManager(Plugin.LANCommanderClient, Plugin.Settings.InstallDirectory);
|
||||||
|
|
||||||
gameManager.OnArchiveExtractionProgress += (long pos, long len) =>
|
gameManager.OnArchiveExtractionProgress += (long pos, long len) =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace LANCommander.PlaynitePlugin
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var gameManager = new LANCommander.SDK.GameManager(Plugin.LANCommanderClient);
|
var gameManager = new LANCommander.SDK.GameManager(Plugin.LANCommanderClient, Plugin.Settings.InstallDirectory);
|
||||||
|
|
||||||
gameManager.Uninstall(Game.InstallDirectory);
|
gameManager.Uninstall(Game.InstallDirectory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,14 +25,16 @@ namespace LANCommander.SDK
|
||||||
public delegate void OnArchiveExtractionProgressHandler(long position, long length);
|
public delegate void OnArchiveExtractionProgressHandler(long position, long length);
|
||||||
public event OnArchiveExtractionProgressHandler OnArchiveExtractionProgress;
|
public event OnArchiveExtractionProgressHandler OnArchiveExtractionProgress;
|
||||||
|
|
||||||
public GameManager(Client client)
|
public GameManager(Client client, string defaultInstallDirectory)
|
||||||
{
|
{
|
||||||
Client = client;
|
Client = client;
|
||||||
|
DefaultInstallDirectory = defaultInstallDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameManager(Client client, ILogger logger)
|
public GameManager(Client client, string defaultInstallDirectory, ILogger logger)
|
||||||
{
|
{
|
||||||
Client = client;
|
Client = client;
|
||||||
|
DefaultInstallDirectory = DefaultInstallDirectory;
|
||||||
Logger = logger;
|
Logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +55,7 @@ namespace LANCommander.SDK
|
||||||
{
|
{
|
||||||
Logger?.LogTrace("Attempting to download and extract game");
|
Logger?.LogTrace("Attempting to download and extract game");
|
||||||
|
|
||||||
return DownloadAndExtract(game);
|
return DownloadAndExtract(game, DefaultInstallDirectory);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.Success && !result.Canceled)
|
if (!result.Success && !result.Canceled)
|
||||||
|
|
Loading…
Reference in New Issue