diff --git a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs index fc0bbba8..a924bc5f 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs @@ -54,6 +54,13 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM private const string LastLoadedModlist = "last-loaded-modlist"; private const string InstallSettingsPrefix = "install-settings-"; + + [Reactive] + public Percent StatusProgress { get; set; } + + [Reactive] + public string StatusText { get; set; } + [Reactive] public ModList ModList { get; set; } @@ -195,6 +202,8 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM ModList = await StandardInstaller.LoadFromFile(_dtos, path); ModListImage = BitmapFrame.Create(await StandardInstaller.ModListImageStream(path)); + StatusText = $"Install configuration for {ModList.Name}"; + var hex = (await ModListLocation.TargetPath.ToString().Hash()).ToHex(); var prevSettings = await _settingsManager.Load(InstallSettingsPrefix + hex); @@ -243,6 +252,13 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM GameFolder = _gameLocator.GameLocation(ModList.GameType) }); + + installer.OnStatusUpdate = update => + { + StatusText = update.StatusText; + StatusProgress = update.StepsProgress; + + }; await installer.Begin(CancellationToken.None); InstallState = InstallState.Success; @@ -254,6 +270,7 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM } + class SavedInstallSettings { public AbsolutePath ModListLocation { get; set; } diff --git a/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs b/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs index 53631651..c85b68cd 100644 --- a/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs @@ -58,6 +58,16 @@ namespace Wabbajack ViewModel.WhenAnyValue(vm => vm.BeginCommand) .BindToStrict(this, view => view.InstallationConfigurationView.BeginButton.Command) .DisposeWith(disposables); + + // Status + ViewModel.WhenAnyValue(vm => vm.StatusText) + .BindToStrict(this, view => view.TopProgressBar.Title) + .DisposeWith(disposables); + + ViewModel.WhenAnyValue(vm => vm.StatusProgress) + .Select(p => p.Value) + .BindToStrict(this, view => view.TopProgressBar.ProgressPercent) + .DisposeWith(disposables); // Slideshow ViewModel.WhenAnyValue(vm => vm.SlideShowTitle)