mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #1289 from Unnoen/modify-download-path-if-same
Append "/downloads" to download path if the same as install path.
This commit is contained in:
commit
5ee8f2a4c3
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user