diff --git a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs b/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs index 26b154f8..ce6dc008 100644 --- a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs @@ -21,6 +21,7 @@ using Wabbajack.Common; using Wabbajack.Compiler; using Wabbajack.DTOs; using Wabbajack.DTOs.JsonConverters; +using Wabbajack.Installer; using Wabbajack.Models; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Paths; @@ -249,17 +250,25 @@ namespace Wabbajack var compiler = MO2Compiler.Create(_serviceProvider, mo2Settings); - compiler.OnStatusUpdate += (sender, update) => - { - RxApp.MainThreadScheduler.Schedule(update, (scheduler, update) => + var events = Observable.FromEventPattern(h => compiler.OnStatusUpdate += h, + h => compiler.OnStatusUpdate -= h) + .Throttle(TimeSpan.FromSeconds(0.5)) + .ObserveOnGuiThread() + .Subscribe(update => { - StatusText = update.StatusText; - StatusProgress = update.StepsProgress; - return Disposable.Empty; + StatusText = update.EventArgs.StatusText; + StatusProgress = update.EventArgs.StepsProgress; }); - }; - await compiler.Begin(token); + + try + { + await compiler.Begin(token); + } + finally + { + events.Dispose(); + } if (PublishUpdate) { diff --git a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs index 9ee7c521..be30ebd7 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs @@ -392,6 +392,7 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM catch (Exception ex) { TaskBarUpdate.Send($"Error during install of {ModList.Name}", TaskbarItemProgressState.Error); + _logger.LogError(ex, ex.Message); InstallState = InstallState.Failure; StatusText = $"Error during install of {ModList.Name}"; StatusProgress = Percent.Zero; diff --git a/Wabbajack.Hashing.PHash/Image.cs b/Wabbajack.Hashing.PHash/Image.cs index 58450401..3b55e5f1 100644 --- a/Wabbajack.Hashing.PHash/Image.cs +++ b/Wabbajack.Hashing.PHash/Image.cs @@ -106,6 +106,7 @@ public class ImageLoader DXGI_FORMAT.BC5_UNORM => CompressionFormat.Bc5, DXGI_FORMAT.BC7_UNORM => CompressionFormat.Bc7, DXGI_FORMAT.B8G8R8A8_UNORM => CompressionFormat.Bgra, + DXGI_FORMAT.R8G8B8A8_UNORM => CompressionFormat.Rgba, _ => throw new Exception($"Cannot re-encode texture with {dx} format, encoding not supported") }; }