mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Update progress bars
This commit is contained in:
parent
7443a0b3f3
commit
b9e44101aa
@ -54,6 +54,13 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM
|
|||||||
private const string LastLoadedModlist = "last-loaded-modlist";
|
private const string LastLoadedModlist = "last-loaded-modlist";
|
||||||
private const string InstallSettingsPrefix = "install-settings-";
|
private const string InstallSettingsPrefix = "install-settings-";
|
||||||
|
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
|
public Percent StatusProgress { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
|
public string StatusText { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public ModList ModList { get; set; }
|
public ModList ModList { get; set; }
|
||||||
|
|
||||||
@ -195,6 +202,8 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM
|
|||||||
ModList = await StandardInstaller.LoadFromFile(_dtos, path);
|
ModList = await StandardInstaller.LoadFromFile(_dtos, path);
|
||||||
ModListImage = BitmapFrame.Create(await StandardInstaller.ModListImageStream(path));
|
ModListImage = BitmapFrame.Create(await StandardInstaller.ModListImageStream(path));
|
||||||
|
|
||||||
|
StatusText = $"Install configuration for {ModList.Name}";
|
||||||
|
|
||||||
var hex = (await ModListLocation.TargetPath.ToString().Hash()).ToHex();
|
var hex = (await ModListLocation.TargetPath.ToString().Hash()).ToHex();
|
||||||
var prevSettings = await _settingsManager.Load<SavedInstallSettings>(InstallSettingsPrefix + hex);
|
var prevSettings = await _settingsManager.Load<SavedInstallSettings>(InstallSettingsPrefix + hex);
|
||||||
|
|
||||||
@ -243,6 +252,13 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM
|
|||||||
GameFolder = _gameLocator.GameLocation(ModList.GameType)
|
GameFolder = _gameLocator.GameLocation(ModList.GameType)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
installer.OnStatusUpdate = update =>
|
||||||
|
{
|
||||||
|
StatusText = update.StatusText;
|
||||||
|
StatusProgress = update.StepsProgress;
|
||||||
|
|
||||||
|
};
|
||||||
await installer.Begin(CancellationToken.None);
|
await installer.Begin(CancellationToken.None);
|
||||||
|
|
||||||
InstallState = InstallState.Success;
|
InstallState = InstallState.Success;
|
||||||
@ -254,6 +270,7 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class SavedInstallSettings
|
class SavedInstallSettings
|
||||||
{
|
{
|
||||||
public AbsolutePath ModListLocation { get; set; }
|
public AbsolutePath ModListLocation { get; set; }
|
||||||
|
@ -58,6 +58,16 @@ namespace Wabbajack
|
|||||||
ViewModel.WhenAnyValue(vm => vm.BeginCommand)
|
ViewModel.WhenAnyValue(vm => vm.BeginCommand)
|
||||||
.BindToStrict(this, view => view.InstallationConfigurationView.BeginButton.Command)
|
.BindToStrict(this, view => view.InstallationConfigurationView.BeginButton.Command)
|
||||||
.DisposeWith(disposables);
|
.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
|
// Slideshow
|
||||||
ViewModel.WhenAnyValue(vm => vm.SlideShowTitle)
|
ViewModel.WhenAnyValue(vm => vm.SlideShowTitle)
|
||||||
|
Loading…
Reference in New Issue
Block a user