Renaming fix

This commit is contained in:
Justin Swanson 2019-12-02 23:40:59 -06:00
parent 0dc0c11e9f
commit 4d7c9a3733
4 changed files with 14 additions and 14 deletions

View File

@ -33,7 +33,7 @@ namespace Wabbajack
private readonly ObservableAsPropertyHelper<ModListVM> _modList; private readonly ObservableAsPropertyHelper<ModListVM> _modList;
public ModListVM ModList => _modList.Value; public ModListVM ModList => _modList.Value;
public FilePickerVM ModListPath { get; } public FilePickerVM ModListLocation { get; }
private readonly ObservableAsPropertyHelper<ISubInstallerVM> _installer; private readonly ObservableAsPropertyHelper<ISubInstallerVM> _installer;
public ISubInstallerVM Installer => _installer.Value; public ISubInstallerVM Installer => _installer.Value;
@ -98,7 +98,7 @@ namespace Wabbajack
MWVM = mainWindowVM; MWVM = mainWindowVM;
ModListPath = new FilePickerVM() ModListLocation = new FilePickerVM()
{ {
ExistCheckOption = FilePickerVM.ExistCheckOptions.On, ExistCheckOption = FilePickerVM.ExistCheckOptions.On,
PathType = FilePickerVM.PathTypeOptions.File, PathType = FilePickerVM.PathTypeOptions.File,
@ -134,11 +134,11 @@ namespace Wabbajack
MWVM.Settings.SaveSignal MWVM.Settings.SaveSignal
.Subscribe(_ => .Subscribe(_ =>
{ {
MWVM.Settings.Installer.LastInstalledListLocation = ModListPath.TargetPath; MWVM.Settings.Installer.LastInstalledListLocation = ModListLocation.TargetPath;
}) })
.DisposeWith(CompositeDisposable); .DisposeWith(CompositeDisposable);
_modList = this.WhenAny(x => x.ModListPath.TargetPath) _modList = this.WhenAny(x => x.ModListLocation.TargetPath)
.ObserveOn(RxApp.TaskpoolScheduler) .ObserveOn(RxApp.TaskpoolScheduler)
.Select(modListPath => .Select(modListPath =>
{ {
@ -161,7 +161,7 @@ namespace Wabbajack
.ToProperty(this, nameof(TargetManager)); .ToProperty(this, nameof(TargetManager));
// Add additional error check on modlist // Add additional error check on modlist
ModListPath.AdditionalError = this.WhenAny(x => x.ModList) ModListLocation.AdditionalError = this.WhenAny(x => x.ModList)
.Select<ModListVM, IErrorResponse>(modList => .Select<ModListVM, IErrorResponse>(modList =>
{ {
if (modList == null) return ErrorResponse.Fail("Modlist path resulted in a null object."); if (modList == null) return ErrorResponse.Fail("Modlist path resulted in a null object.");
@ -303,7 +303,7 @@ namespace Wabbajack
private void OpenReadmeWindow() private void OpenReadmeWindow()
{ {
if (string.IsNullOrEmpty(ModList.Readme)) return; if (string.IsNullOrEmpty(ModList.Readme)) return;
using (var fs = new FileStream(ModListPath.TargetPath, FileMode.Open, FileAccess.Read, FileShare.Read)) using (var fs = new FileStream(ModListLocation.TargetPath, FileMode.Open, FileAccess.Read, FileShare.Read))
using (var ar = new ZipArchive(fs, ZipArchiveMode.Read)) using (var ar = new ZipArchive(fs, ZipArchiveMode.Read))
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {

View File

@ -54,7 +54,7 @@ namespace Wabbajack
canExecute: Observable.CombineLatest( canExecute: Observable.CombineLatest(
this.WhenAny(x => x.Location.InError), this.WhenAny(x => x.Location.InError),
this.WhenAny(x => x.DownloadLocation.InError), this.WhenAny(x => x.DownloadLocation.InError),
installerVM.WhenAny(x => x.ModListPath.InError), installerVM.WhenAny(x => x.ModListLocation.InError),
resultSelector: (loc, modlist, download) => resultSelector: (loc, modlist, download) =>
{ {
return !loc && !download && !modlist; return !loc && !download && !modlist;
@ -67,7 +67,7 @@ namespace Wabbajack
try try
{ {
installer = new MO2Installer( installer = new MO2Installer(
archive: installerVM.ModListPath.TargetPath, archive: installerVM.ModListLocation.TargetPath,
modList: installerVM.ModList.SourceModList, modList: installerVM.ModList.SourceModList,
outputFolder: Location.TargetPath, outputFolder: Location.TargetPath,
downloadFolder: DownloadLocation.TargetPath); downloadFolder: DownloadLocation.TargetPath);
@ -120,7 +120,7 @@ namespace Wabbajack
.DisposeWith(CompositeDisposable); .DisposeWith(CompositeDisposable);
// Load settings // Load settings
_CurrentSettings = installerVM.WhenAny(x => x.ModListPath.TargetPath) _CurrentSettings = installerVM.WhenAny(x => x.ModListLocation.TargetPath)
.Select(path => path == null ? null : installerVM.MWVM.Settings.Installer.Mo2ModlistSettings.TryCreate(path)) .Select(path => path == null ? null : installerVM.MWVM.Settings.Installer.Mo2ModlistSettings.TryCreate(path))
.ToProperty(this, nameof(CurrentSettings)); .ToProperty(this, nameof(CurrentSettings));
this.WhenAny(x => x.CurrentSettings) this.WhenAny(x => x.CurrentSettings)
@ -145,7 +145,7 @@ namespace Wabbajack
private void SaveSettings(Mo2ModlistInstallationSettings settings) private void SaveSettings(Mo2ModlistInstallationSettings settings)
{ {
_installerVM.MWVM.Settings.Installer.LastInstalledListLocation = _installerVM.ModListPath.TargetPath; _installerVM.MWVM.Settings.Installer.LastInstalledListLocation = _installerVM.ModListLocation.TargetPath;
if (settings == null) return; if (settings == null) return;
settings.InstallationLocation = Location.TargetPath; settings.InstallationLocation = Location.TargetPath;
settings.DownloadLocation = DownloadLocation.TargetPath; settings.DownloadLocation = DownloadLocation.TargetPath;

View File

@ -36,7 +36,7 @@ namespace Wabbajack
canExecute: Observable.CombineLatest( canExecute: Observable.CombineLatest(
this.WhenAny(x => x.TargetGame) this.WhenAny(x => x.TargetGame)
.Select(game => VortexCompiler.IsActiveVortexGame(game)), .Select(game => VortexCompiler.IsActiveVortexGame(game)),
installerVM.WhenAny(x => x.ModListPath.InError), installerVM.WhenAny(x => x.ModListLocation.InError),
resultSelector: (isVortexGame, modListErr) => isVortexGame && !modListErr), resultSelector: (isVortexGame, modListErr) => isVortexGame && !modListErr),
execute: async () => execute: async () =>
{ {
@ -47,7 +47,7 @@ namespace Wabbajack
var download = VortexCompiler.RetrieveDownloadLocation(TargetGame); var download = VortexCompiler.RetrieveDownloadLocation(TargetGame);
var staging = VortexCompiler.RetrieveStagingLocation(TargetGame); var staging = VortexCompiler.RetrieveStagingLocation(TargetGame);
installer = new VortexInstaller( installer = new VortexInstaller(
archive: installerVM.ModListPath.TargetPath, archive: installerVM.ModListLocation.TargetPath,
modList: installerVM.ModList.SourceModList, modList: installerVM.ModList.SourceModList,
outputFolder: staging, outputFolder: staging,
downloadFolder: download); downloadFolder: download);

View File

@ -54,7 +54,7 @@ namespace Wabbajack
if (IsStartingFromModlist(out var path)) if (IsStartingFromModlist(out var path))
{ {
Installer.Value.ModListPath.TargetPath = path; Installer.Value.ModListLocation.TargetPath = path;
ActivePane = Installer.Value; ActivePane = Installer.Value;
} }
else else
@ -83,7 +83,7 @@ namespace Wabbajack
var installer = Installer.Value; var installer = Installer.Value;
Settings.Installer.LastInstalledListLocation = path; Settings.Installer.LastInstalledListLocation = path;
ActivePane = installer; ActivePane = installer;
installer.ModListPath.TargetPath = path; installer.ModListLocation.TargetPath = path;
} }
} }
} }