From 0f263f04acb2567c7050bf1be291c50d57015ced Mon Sep 17 00:00:00 2001 From: Unnoen Date: Mon, 1 Feb 2021 14:51:27 +1100 Subject: [PATCH] Append to download path if same as install path --- .../View Models/Installers/MO2InstallerVM.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Wabbajack/View Models/Installers/MO2InstallerVM.cs b/Wabbajack/View Models/Installers/MO2InstallerVM.cs index a49bb832..2499f462 100644 --- a/Wabbajack/View Models/Installers/MO2InstallerVM.cs +++ b/Wabbajack/View Models/Installers/MO2InstallerVM.cs @@ -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))