Append to download path if same as install path

This commit is contained in:
Unnoen 2021-02-01 14:51:27 +11:00
parent cfa69948c7
commit 0f263f04ac
No known key found for this signature in database
GPG Key ID: 8F8E42252BA20553

View File

@ -76,18 +76,30 @@ namespace Wabbajack
})
.ToProperty(this, nameof(CanInstall));
// Have Installation location updates modify the downloads location if empty
// Have Installation location updates modify the downloads location if empty or the same path
this.WhenAny(x => x.Location.TargetPath)
.Skip(1) // Don't do it initially
.Subscribe(installPath =>
{
if (DownloadLocation.TargetPath == default)
if (DownloadLocation.TargetPath == default || DownloadLocation.TargetPath == installPath)
{
DownloadLocation.TargetPath = installPath.Combine("downloads");
}
})
.DisposeWith(CompositeDisposable);
// Have Download location updates change if the same as the install path
this.WhenAny(x => x.DownloadLocation.TargetPath)
.Skip(1) // Don't do it initially
.Subscribe(downloadPath =>
{
if (downloadPath == Location.TargetPath)
{
DownloadLocation.TargetPath = Location.TargetPath.Combine("downloads");
}
})
.DisposeWith(CompositeDisposable);
// Load settings
_CurrentSettings = installerVM.WhenAny(x => x.ModListLocation.TargetPath)
.Select(path => path == default ? null : installerVM.MWVM.Settings.Installer.Mo2ModlistSettings.TryCreate(path))