diff --git a/Wabbajack.App.Wpf/App.xaml.cs b/Wabbajack.App.Wpf/App.xaml.cs index c8f61860..c006b8c9 100644 --- a/Wabbajack.App.Wpf/App.xaml.cs +++ b/Wabbajack.App.Wpf/App.xaml.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Wabbajack.Common; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.Services.OSIntegrated; using Wabbajack.Util; diff --git a/Wabbajack.Lib/Consts.cs b/Wabbajack.App.Wpf/Consts.cs similarity index 95% rename from Wabbajack.Lib/Consts.cs rename to Wabbajack.App.Wpf/Consts.cs index bd07c0e4..63c0ee42 100644 --- a/Wabbajack.Lib/Consts.cs +++ b/Wabbajack.App.Wpf/Consts.cs @@ -1,7 +1,7 @@ using System; using Wabbajack.Paths; -namespace Wabbajack.Lib; +namespace Wabbajack; public static class Consts { diff --git a/Wabbajack.Lib/Error States/ErrorResponse.cs b/Wabbajack.App.Wpf/Error States/ErrorResponse.cs similarity index 100% rename from Wabbajack.Lib/Error States/ErrorResponse.cs rename to Wabbajack.App.Wpf/Error States/ErrorResponse.cs diff --git a/Wabbajack.Lib/Error States/GetResponse.cs b/Wabbajack.App.Wpf/Error States/GetResponse.cs similarity index 100% rename from Wabbajack.Lib/Error States/GetResponse.cs rename to Wabbajack.App.Wpf/Error States/GetResponse.cs diff --git a/Wabbajack.Lib/Extensions/ReactiveUIExt.cs b/Wabbajack.App.Wpf/Extensions/ReactiveUIExt.cs similarity index 99% rename from Wabbajack.Lib/Extensions/ReactiveUIExt.cs rename to Wabbajack.App.Wpf/Extensions/ReactiveUIExt.cs index 2db91177..cdef3164 100644 --- a/Wabbajack.Lib/Extensions/ReactiveUIExt.cs +++ b/Wabbajack.App.Wpf/Extensions/ReactiveUIExt.cs @@ -9,8 +9,8 @@ using System.Threading.Tasks; using DynamicData; using DynamicData.Kernel; using ReactiveUI; -using Wabbajack.Lib; -using Wabbajack.Lib.Extensions; +using Wabbajack; +using Wabbajack.Extensions; namespace Wabbajack { diff --git a/Wabbajack.Lib/Extensions/RxExt.cs b/Wabbajack.App.Wpf/Extensions/RxExt.cs similarity index 99% rename from Wabbajack.Lib/Extensions/RxExt.cs rename to Wabbajack.App.Wpf/Extensions/RxExt.cs index 491077e4..abc66c5a 100644 --- a/Wabbajack.Lib/Extensions/RxExt.cs +++ b/Wabbajack.App.Wpf/Extensions/RxExt.cs @@ -5,7 +5,7 @@ using System.Reactive.Disposables; using System.Reactive.Linq; using System.Threading.Tasks; -namespace Wabbajack.Lib.Extensions +namespace Wabbajack.Extensions { public static class RxExt { diff --git a/Wabbajack.Lib/Interventions/AErrorMessage.cs b/Wabbajack.App.Wpf/Interventions/AErrorMessage.cs similarity index 89% rename from Wabbajack.Lib/Interventions/AErrorMessage.cs rename to Wabbajack.App.Wpf/Interventions/AErrorMessage.cs index 3a5d69b2..94105a0f 100644 --- a/Wabbajack.Lib/Interventions/AErrorMessage.cs +++ b/Wabbajack.App.Wpf/Interventions/AErrorMessage.cs @@ -1,6 +1,6 @@ using System; -namespace Wabbajack.Lib.Interventions +namespace Wabbajack.Interventions { public abstract class AErrorMessage : Exception, IException { diff --git a/Wabbajack.Lib/Interventions/AUserIntervention.cs b/Wabbajack.App.Wpf/Interventions/AUserIntervention.cs similarity index 93% rename from Wabbajack.Lib/Interventions/AUserIntervention.cs rename to Wabbajack.App.Wpf/Interventions/AUserIntervention.cs index 0e30e4e9..c07d59fd 100644 --- a/Wabbajack.Lib/Interventions/AUserIntervention.cs +++ b/Wabbajack.App.Wpf/Interventions/AUserIntervention.cs @@ -6,9 +6,9 @@ using System.Threading.Tasks; using System.Windows.Input; using ReactiveUI; using Wabbajack.Common; -using Wabbajack.Lib.Interventions; +using Wabbajack.Interventions; -namespace Wabbajack.Lib +namespace Wabbajack { public abstract class AUserIntervention : ReactiveObject, IUserIntervention { diff --git a/Wabbajack.Lib/Interventions/ConfirmationIntervention.cs b/Wabbajack.App.Wpf/Interventions/ConfirmationIntervention.cs similarity index 97% rename from Wabbajack.Lib/Interventions/ConfirmationIntervention.cs rename to Wabbajack.App.Wpf/Interventions/ConfirmationIntervention.cs index 2a3a585b..f0ce1067 100644 --- a/Wabbajack.Lib/Interventions/ConfirmationIntervention.cs +++ b/Wabbajack.App.Wpf/Interventions/ConfirmationIntervention.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using System.Windows.Input; using ReactiveUI; -namespace Wabbajack.Lib +namespace Wabbajack { public abstract class ConfirmationIntervention : AUserIntervention { diff --git a/Wabbajack.Lib/Interventions/IError.cs b/Wabbajack.App.Wpf/Interventions/IError.cs similarity index 59% rename from Wabbajack.Lib/Interventions/IError.cs rename to Wabbajack.App.Wpf/Interventions/IError.cs index c70312c4..15c0c443 100644 --- a/Wabbajack.Lib/Interventions/IError.cs +++ b/Wabbajack.App.Wpf/Interventions/IError.cs @@ -1,4 +1,4 @@ -namespace Wabbajack.Lib.Interventions +namespace Wabbajack.Interventions { public interface IError : IStatusMessage { diff --git a/Wabbajack.Lib/Interventions/IException.cs b/Wabbajack.App.Wpf/Interventions/IException.cs similarity index 74% rename from Wabbajack.Lib/Interventions/IException.cs rename to Wabbajack.App.Wpf/Interventions/IException.cs index 4c82fa16..85d0d270 100644 --- a/Wabbajack.Lib/Interventions/IException.cs +++ b/Wabbajack.App.Wpf/Interventions/IException.cs @@ -1,6 +1,6 @@ using System; -namespace Wabbajack.Lib.Interventions +namespace Wabbajack.Interventions { public interface IException : IError { diff --git a/Wabbajack.Lib/Interventions/IStatusMessage.cs b/Wabbajack.App.Wpf/Interventions/IStatusMessage.cs similarity index 83% rename from Wabbajack.Lib/Interventions/IStatusMessage.cs rename to Wabbajack.App.Wpf/Interventions/IStatusMessage.cs index 28dbd3c1..7d01ad50 100644 --- a/Wabbajack.Lib/Interventions/IStatusMessage.cs +++ b/Wabbajack.App.Wpf/Interventions/IStatusMessage.cs @@ -1,6 +1,6 @@ using System; -namespace Wabbajack.Lib.Interventions +namespace Wabbajack.Interventions { public interface IStatusMessage { diff --git a/Wabbajack.Lib/Interventions/IUserIntervention.cs b/Wabbajack.App.Wpf/Interventions/IUserIntervention.cs similarity index 94% rename from Wabbajack.Lib/Interventions/IUserIntervention.cs rename to Wabbajack.App.Wpf/Interventions/IUserIntervention.cs index 93ccd771..3d1f1b08 100644 --- a/Wabbajack.Lib/Interventions/IUserIntervention.cs +++ b/Wabbajack.App.Wpf/Interventions/IUserIntervention.cs @@ -1,6 +1,6 @@ using ReactiveUI; -namespace Wabbajack.Lib.Interventions +namespace Wabbajack.Interventions { /// /// Defines a message that requires user interaction. The user must perform some action diff --git a/Wabbajack.Lib/LauncherUpdater.cs b/Wabbajack.App.Wpf/LauncherUpdater.cs similarity index 99% rename from Wabbajack.Lib/LauncherUpdater.cs rename to Wabbajack.App.Wpf/LauncherUpdater.cs index 90f476f7..94e7031e 100644 --- a/Wabbajack.Lib/LauncherUpdater.cs +++ b/Wabbajack.App.Wpf/LauncherUpdater.cs @@ -19,7 +19,7 @@ using Wabbajack.Paths; using Wabbajack.Paths.IO; using Wabbajack.RateLimiter; -namespace Wabbajack.Lib +namespace Wabbajack { public class LauncherUpdater { diff --git a/Wabbajack.Lib/LibCefHelpers/Init.cs b/Wabbajack.App.Wpf/LibCefHelpers/Init.cs similarity index 99% rename from Wabbajack.Lib/LibCefHelpers/Init.cs rename to Wabbajack.App.Wpf/LibCefHelpers/Init.cs index 4f86218c..36a4e434 100644 --- a/Wabbajack.Lib/LibCefHelpers/Init.cs +++ b/Wabbajack.App.Wpf/LibCefHelpers/Init.cs @@ -12,7 +12,7 @@ using Wabbajack.Common; using Wabbajack.DTOs.JsonConverters; using Cookie = CefSharp.Cookie; -namespace Wabbajack.Lib.LibCefHelpers +namespace Wabbajack.LibCefHelpers { public static class Helpers { diff --git a/Wabbajack.Lib/LoadingLock.cs b/Wabbajack.App.Wpf/LoadingLock.cs similarity index 100% rename from Wabbajack.Lib/LoadingLock.cs rename to Wabbajack.App.Wpf/LoadingLock.cs diff --git a/Wabbajack.App.Wpf/Messages/NavigateTo.cs b/Wabbajack.App.Wpf/Messages/NavigateTo.cs index ac42ceaf..f9eea96f 100644 --- a/Wabbajack.App.Wpf/Messages/NavigateTo.cs +++ b/Wabbajack.App.Wpf/Messages/NavigateTo.cs @@ -1,5 +1,5 @@ using ReactiveUI; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack.Messages; diff --git a/Wabbajack.App.Wpf/Settings.cs b/Wabbajack.App.Wpf/Settings.cs index 7d028136..9c2f65f2 100644 --- a/Wabbajack.App.Wpf/Settings.cs +++ b/Wabbajack.App.Wpf/Settings.cs @@ -6,9 +6,9 @@ using System.Threading.Tasks; using Newtonsoft.Json; using Wabbajack.Compiler; using Wabbajack.DTOs.JsonConverters; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.Paths; -using Consts = Wabbajack.Lib.Consts; +using Consts = Wabbajack.Consts; namespace Wabbajack { diff --git a/Wabbajack.Lib/StatusMessages/ConfirmUpdateOfExistingInstall.cs b/Wabbajack.App.Wpf/StatusMessages/ConfirmUpdateOfExistingInstall.cs similarity index 96% rename from Wabbajack.Lib/StatusMessages/ConfirmUpdateOfExistingInstall.cs rename to Wabbajack.App.Wpf/StatusMessages/ConfirmUpdateOfExistingInstall.cs index e7027c9c..bd68ac69 100644 --- a/Wabbajack.Lib/StatusMessages/ConfirmUpdateOfExistingInstall.cs +++ b/Wabbajack.App.Wpf/StatusMessages/ConfirmUpdateOfExistingInstall.cs @@ -1,6 +1,6 @@ using Wabbajack.Paths; -namespace Wabbajack.Lib +namespace Wabbajack { public class ConfirmUpdateOfExistingInstall : ConfirmationIntervention { diff --git a/Wabbajack.Lib/StatusMessages/CriticalFailureIntervention.cs b/Wabbajack.App.Wpf/StatusMessages/CriticalFailureIntervention.cs similarity index 94% rename from Wabbajack.Lib/StatusMessages/CriticalFailureIntervention.cs rename to Wabbajack.App.Wpf/StatusMessages/CriticalFailureIntervention.cs index 6984ba07..618776ef 100644 --- a/Wabbajack.Lib/StatusMessages/CriticalFailureIntervention.cs +++ b/Wabbajack.App.Wpf/StatusMessages/CriticalFailureIntervention.cs @@ -1,8 +1,8 @@ using System.Threading.Tasks; using Wabbajack.Common; -using Wabbajack.Lib.Interventions; +using Wabbajack.Interventions; -namespace Wabbajack.Lib +namespace Wabbajack { /// /// This should probably be replaced with an error, but this is just to get messageboxes out of the .Lib library diff --git a/Wabbajack.Lib/StatusMessages/ManuallyDownloadFile.cs b/Wabbajack.App.Wpf/StatusMessages/ManuallyDownloadFile.cs similarity index 97% rename from Wabbajack.Lib/StatusMessages/ManuallyDownloadFile.cs rename to Wabbajack.App.Wpf/StatusMessages/ManuallyDownloadFile.cs index c5d6a167..8b54ebde 100644 --- a/Wabbajack.Lib/StatusMessages/ManuallyDownloadFile.cs +++ b/Wabbajack.App.Wpf/StatusMessages/ManuallyDownloadFile.cs @@ -3,7 +3,7 @@ using System.Net.Http; using System.Threading.Tasks; using Wabbajack.DTOs.DownloadStates; -namespace Wabbajack.Lib +namespace Wabbajack { public class ManuallyDownloadFile : AUserIntervention { diff --git a/Wabbajack.Lib/StatusMessages/ManuallyDownloadNexusFile.cs b/Wabbajack.App.Wpf/StatusMessages/ManuallyDownloadNexusFile.cs similarity index 97% rename from Wabbajack.Lib/StatusMessages/ManuallyDownloadNexusFile.cs rename to Wabbajack.App.Wpf/StatusMessages/ManuallyDownloadNexusFile.cs index 48046cda..e0ebe573 100644 --- a/Wabbajack.Lib/StatusMessages/ManuallyDownloadNexusFile.cs +++ b/Wabbajack.App.Wpf/StatusMessages/ManuallyDownloadNexusFile.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using Wabbajack.DTOs.DownloadStates; -namespace Wabbajack.Lib +namespace Wabbajack { public class ManuallyDownloadNexusFile : AUserIntervention { diff --git a/Wabbajack.Lib/StatusMessages/NexusAPIQuotaExceeded.cs b/Wabbajack.App.Wpf/StatusMessages/NexusAPIQuotaExceeded.cs similarity index 84% rename from Wabbajack.Lib/StatusMessages/NexusAPIQuotaExceeded.cs rename to Wabbajack.App.Wpf/StatusMessages/NexusAPIQuotaExceeded.cs index 5a21e414..17222f80 100644 --- a/Wabbajack.Lib/StatusMessages/NexusAPIQuotaExceeded.cs +++ b/Wabbajack.App.Wpf/StatusMessages/NexusAPIQuotaExceeded.cs @@ -1,6 +1,6 @@ -using Wabbajack.Lib.Interventions; +using Wabbajack.Interventions; -namespace Wabbajack.Lib +namespace Wabbajack { public class NexusAPIQuotaExceeded : AErrorMessage { diff --git a/Wabbajack.Lib/StatusMessages/YesNoIntervention.cs b/Wabbajack.App.Wpf/StatusMessages/YesNoIntervention.cs similarity index 94% rename from Wabbajack.Lib/StatusMessages/YesNoIntervention.cs rename to Wabbajack.App.Wpf/StatusMessages/YesNoIntervention.cs index b37a2be6..a8e59eb6 100644 --- a/Wabbajack.Lib/StatusMessages/YesNoIntervention.cs +++ b/Wabbajack.App.Wpf/StatusMessages/YesNoIntervention.cs @@ -1,6 +1,6 @@ using Wabbajack.Common; -namespace Wabbajack.Lib +namespace Wabbajack { public class YesNoIntervention : ConfirmationIntervention { diff --git a/Wabbajack.App.Wpf/Util/FilePickerVM.cs b/Wabbajack.App.Wpf/Util/FilePickerVM.cs index 7ab95c98..c742d6f2 100644 --- a/Wabbajack.App.Wpf/Util/FilePickerVM.cs +++ b/Wabbajack.App.Wpf/Util/FilePickerVM.cs @@ -3,14 +3,11 @@ using Microsoft.WindowsAPICodePack.Dialogs; using ReactiveUI; using ReactiveUI.Fody.Helpers; using System; -using System.Collections.Generic; -using System.IO; using System.Linq; using System.Reactive.Linq; using System.Windows.Input; -using Wabbajack.Common; -using Wabbajack.Lib; -using Wabbajack.Lib.Extensions; +using Wabbajack; +using Wabbajack.Extensions; using Wabbajack.Paths; using Wabbajack.Paths.IO; diff --git a/Wabbajack.App.Wpf/Util/SystemParametersConstructor.cs b/Wabbajack.App.Wpf/Util/SystemParametersConstructor.cs index dcb2d640..db5153b2 100644 --- a/Wabbajack.App.Wpf/Util/SystemParametersConstructor.cs +++ b/Wabbajack.App.Wpf/Util/SystemParametersConstructor.cs @@ -10,7 +10,7 @@ using Silk.NET.Core.Native; using Silk.NET.DXGI; using Wabbajack.Common; using Wabbajack.Installer; -using Wabbajack.Lib; +using Wabbajack; using static PInvoke.User32; using UnmanagedType = System.Runtime.InteropServices.UnmanagedType; diff --git a/Wabbajack.App.Wpf/Util/UIUtils.cs b/Wabbajack.App.Wpf/Util/UIUtils.cs index d7eee0c2..431a9f92 100644 --- a/Wabbajack.App.Wpf/Util/UIUtils.cs +++ b/Wabbajack.App.Wpf/Util/UIUtils.cs @@ -15,7 +15,8 @@ using System.Windows.Forms; using System.Windows.Media.Imaging; using Wabbajack.Common; using Wabbajack.Hashing.xxHash64; -using Wabbajack.Lib.Extensions; +using Wabbajack.Extensions; +using Wabbajack.Models; using Wabbajack.Paths; using Wabbajack.Paths.IO; @@ -83,16 +84,18 @@ namespace Wabbajack return default; } - public static IObservable DownloadBitmapImage(this IObservable obs, Action exceptionHandler) + public static IObservable DownloadBitmapImage(this IObservable obs, Action exceptionHandler, + LoadingLock loadingLock) { return obs .ObserveOn(RxApp.TaskpoolScheduler) .SelectTask(async url => { + var ll = loadingLock.WithLoading(); try { var (found, mstream) = await FindCachedImage(url); - if (found) return mstream; + if (found) return (ll, mstream); var ret = new MemoryStream(); using (var client = new HttpClient()) @@ -104,16 +107,17 @@ namespace Wabbajack ret.Seek(0, SeekOrigin.Begin); await WriteCachedImage(url, ret.ToArray()); - return ret; + return (ll, ret); } catch (Exception ex) { exceptionHandler(ex); - return default; + return (ll, default); } }) - .Select(memStream => + .Select(x => { + var (ll, memStream) = x; if (memStream == null) return default; try { @@ -126,6 +130,7 @@ namespace Wabbajack } finally { + ll.Dispose(); memStream.Dispose(); } }) diff --git a/Wabbajack.App.Wpf/View Models/BackNavigatingVM.cs b/Wabbajack.App.Wpf/View Models/BackNavigatingVM.cs index 8ae8e46b..f6064104 100644 --- a/Wabbajack.App.Wpf/View Models/BackNavigatingVM.cs +++ b/Wabbajack.App.Wpf/View Models/BackNavigatingVM.cs @@ -7,7 +7,7 @@ using Microsoft.Extensions.Logging; using ReactiveUI; using ReactiveUI.Fody.Helpers; using Wabbajack.Common; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.Messages; namespace Wabbajack diff --git a/Wabbajack.App.Wpf/View Models/CPUDisplayVM.cs b/Wabbajack.App.Wpf/View Models/CPUDisplayVM.cs index 0a92f27e..03e09bd5 100644 --- a/Wabbajack.App.Wpf/View Models/CPUDisplayVM.cs +++ b/Wabbajack.App.Wpf/View Models/CPUDisplayVM.cs @@ -1,6 +1,6 @@ using System; using ReactiveUI.Fody.Helpers; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.RateLimiter; namespace Wabbajack diff --git a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs b/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs index 61760ab1..9a41d0f0 100644 --- a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs @@ -1,20 +1,16 @@ -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; -using System; -using System.Diagnostics; -using System.IO; +using System; using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Windows.Media.Imaging; -using DynamicData; using Microsoft.Extensions.Logging; -using Wabbajack.Compiler; -using Wabbajack.Lib.Extensions; -using Wabbajack.Lib.Interventions; +using Wabbajack.Extensions; +using Wabbajack.Interventions; using Wabbajack.Messages; using Wabbajack.RateLimiter; +using ReactiveUI; +using System.Reactive.Disposables; +using System.Reactive.Linq; +using DynamicData.Binding; +using ReactiveUI.Fody.Helpers; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/Compilers/MO2CompilerVM.cs b/Wabbajack.App.Wpf/View Models/Compilers/MO2CompilerVM.cs index f837f8a7..11aeab0d 100644 --- a/Wabbajack.App.Wpf/View Models/Compilers/MO2CompilerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Compilers/MO2CompilerVM.cs @@ -10,11 +10,11 @@ using Wabbajack.Common; using Wabbajack.Compiler; using Wabbajack.DTOs; using Wabbajack.DTOs.GitHub; -using Wabbajack.Lib; -using Wabbajack.Lib.Extensions; +using Wabbajack; +using Wabbajack.Extensions; using Wabbajack.Paths; using Wabbajack.Paths.IO; -using Consts = Wabbajack.Lib.Consts; +using Consts = Wabbajack.Consts; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/Compilers/ModlistSettingsEditorVM.cs b/Wabbajack.App.Wpf/View Models/Compilers/ModlistSettingsEditorVM.cs index 517e28e9..1552b98e 100644 --- a/Wabbajack.App.Wpf/View Models/Compilers/ModlistSettingsEditorVM.cs +++ b/Wabbajack.App.Wpf/View Models/Compilers/ModlistSettingsEditorVM.cs @@ -6,7 +6,7 @@ using Microsoft.WindowsAPICodePack.Dialogs; using ReactiveUI; using ReactiveUI.Fody.Helpers; using Wabbajack.Common; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/Gallery/ModListGalleryVM.cs b/Wabbajack.App.Wpf/View Models/Gallery/ModListGalleryVM.cs index 9d16df68..0c7199ce 100644 --- a/Wabbajack.App.Wpf/View Models/Gallery/ModListGalleryVM.cs +++ b/Wabbajack.App.Wpf/View Models/Gallery/ModListGalleryVM.cs @@ -4,22 +4,18 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using System.Reactive; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Threading.Tasks; using System.Windows.Input; using DynamicData; -using DynamicData.Binding; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using ReactiveUI; using ReactiveUI.Fody.Helpers; using Wabbajack.Common; using Wabbajack.Downloaders.GameFile; using Wabbajack.DTOs; -using Wabbajack.Hashing.xxHash64; -using Wabbajack.Lib.Extensions; +using Wabbajack.Messages; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Services.OSIntegrated; using Wabbajack.Services.OSIntegrated.Services; @@ -55,11 +51,9 @@ namespace Wabbajack private readonly ILogger _logger; private readonly GameLocator _locator; private readonly ModListDownloadMaintainer _maintainer; + private readonly SettingsManager _settingsManager; private FiltersSettings settings { get; set; } = new(); - - public bool Loaded => _Loaded.Value; - public ICommand ClearFiltersCommand { get; set; } public ModListGalleryVM(ILogger logger, Client wjClient, @@ -70,6 +64,7 @@ namespace Wabbajack _logger = logger; _locator = locator; _maintainer = maintainer; + _settingsManager = settingsManager; ClearFiltersCommand = ReactiveCommand.Create( () => @@ -80,11 +75,21 @@ namespace Wabbajack Search = string.Empty; GameType = ALL_GAME_TYPE; }); + + BackCommand = ReactiveCommand.Create( + () => + { + NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView); + }); this.WhenActivated(disposables => - { - var _ = LoadModLists(); + { + LoadModLists().FireAndForget(); + LoadSettings().FireAndForget(); + + Disposable.Create(() => SaveSettings().FireAndForget()) + .DisposeWith(disposables); var searchTextPredicates = this.ObservableForProperty(vm => vm.Search) .Select(change => change.Value) @@ -141,11 +146,47 @@ namespace Wabbajack }); } + private class FilterSettings + { + public string GameType { get; set; } + public bool ShowNSFW { get; set; } + public bool ShowUtilityLists { get; set; } + public bool OnlyInstalled { get; set; } + public string Search { get; set; } + } + public override void Unload() { Error = null; } + private async Task SaveSettings() + { + await _settingsManager.Save("modlist_gallery", new FilterSettings + { + GameType = GameType, + ShowNSFW = ShowNSFW, + ShowUtilityLists = ShowUtilityLists, + Search = Search, + OnlyInstalled = OnlyInstalled, + }); + } + + private async Task LoadSettings() + { + using var ll = LoadingLock.WithLoading(); + RxApp.MainThreadScheduler.Schedule(await _settingsManager.Load("modlist_gallery"), + (_, s) => + { + GameType = s.GameType; + ShowNSFW = s.ShowNSFW; + ShowUtilityLists = s.ShowUtilityLists; + Search = s.Search; + OnlyInstalled = s.OnlyInstalled; + return Disposable.Empty; + }); + } + private async Task LoadModLists() { using var ll = LoadingLock.WithLoading(); @@ -175,13 +216,5 @@ namespace Wabbajack return gameEntries; } - private void UpdateFiltersSettings() - { - settings.Game = GameType; - settings.Search = Search; - settings.ShowNSFW = ShowNSFW; - settings.ShowUtilityLists = ShowUtilityLists; - settings.OnlyInstalled = OnlyInstalled; - } } } \ No newline at end of file diff --git a/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs b/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs index 969a3a8d..eede9ac1 100644 --- a/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs +++ b/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs @@ -14,9 +14,10 @@ using ReactiveUI.Fody.Helpers; using Wabbajack.Common; using Wabbajack.DTOs; using Wabbajack.DTOs.ServerResponses; -using Wabbajack.Lib; -using Wabbajack.Lib.Extensions; +using Wabbajack; +using Wabbajack.Extensions; using Wabbajack.Messages; +using Wabbajack.Models; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Paths; using Wabbajack.Paths.IO; @@ -51,6 +52,8 @@ namespace Wabbajack public AbsolutePath Location { get; } + public LoadingLock LoadingImageLock { get; } = new(); + [Reactive] public List ModListTagList { get; private set; } @@ -97,7 +100,7 @@ namespace Wabbajack Location = LauncherUpdater.CommonFolder.Value.Combine("downloaded_mod_lists", Metadata.Links.MachineURL).WithExtension(Ext.Wabbajack); ModListTagList = new List(); - Metadata.tags.ForEach(tag => + Metadata.Tags.ForEach(tag => { ModListTagList.Add(new ModListTag(tag)); }); @@ -166,7 +169,8 @@ namespace Wabbajack .ObserveOnGuiThread() .Select(_ => { - _parent.MWVM.OpenInstaller(Location); + // TODO + //_parent.MWVM.OpenInstaller(Location); // Wait for modlist member to be filled, then open its readme return _parent.MWVM.Installer.Value.WhenAny(x => x.ModList) @@ -195,7 +199,7 @@ namespace Wabbajack { try { - return !IsDownloading && !(await maintainer.HaveModList(metadata)); + return !IsDownloading && await maintainer.HaveModList(metadata); } catch (Exception) { @@ -205,7 +209,7 @@ namespace Wabbajack .ToGuiProperty(this, nameof(Exists)); var imageObs = Observable.Return(Metadata.Links.ImageUri) - .DownloadBitmapImage((ex) => _logger.LogError("Error downloading modlist image {Title}", Metadata.Title)); + .DownloadBitmapImage((ex) => _logger.LogError("Error downloading modlist image {Title}", Metadata.Title), LoadingImageLock); _Image = imageObs .ToGuiProperty(this, nameof(Image)); @@ -221,7 +225,8 @@ namespace Wabbajack private async Task Download() { var (progress, task) = _maintainer.DownloadModlist(Metadata); - var dispose = progress.Subscribe(p => ProgressPercent = p); + var dispose = progress + .BindToStrict(this, vm => vm.ProgressPercent); await task; diff --git a/Wabbajack.App.Wpf/View Models/Installers/ISubInstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/ISubInstallerVM.cs index c3178832..30eb8e5b 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/ISubInstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/ISubInstallerVM.cs @@ -6,8 +6,8 @@ using System.Threading.Tasks; using ReactiveUI; using Wabbajack.Common; using Wabbajack.Installer; -using Wabbajack.Lib; -using Wabbajack.Lib.Interventions; +using Wabbajack; +using Wabbajack.Interventions; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs index 6715d3c2..74ec0db8 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs @@ -13,13 +13,13 @@ using Microsoft.Extensions.Logging; using Microsoft.WindowsAPICodePack.Dialogs; using Microsoft.WindowsAPICodePack.Shell; using Wabbajack.DTOs.JsonConverters; -using Wabbajack.Lib.Extensions; -using Wabbajack.Lib.Interventions; +using Wabbajack.Extensions; +using Wabbajack.Interventions; using Wabbajack.Messages; using Wabbajack.RateLimiter; using Wabbajack.View_Models; using Wabbajack.Paths.IO; -using Consts = Wabbajack.Lib.Consts; +using Consts = Wabbajack.Consts; using KnownFolders = Wabbajack.Paths.IO.KnownFolders; namespace Wabbajack; diff --git a/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs index aa5fa77f..e4a0c1de 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs @@ -11,8 +11,8 @@ using ReactiveUI; using ReactiveUI.Fody.Helpers; using Wabbajack.Common; using Wabbajack.Installer; -using Wabbajack.Lib; -using Wabbajack.Lib.Interventions; +using Wabbajack; +using Wabbajack.Interventions; using Wabbajack.Util; namespace Wabbajack diff --git a/Wabbajack.App.Wpf/View Models/MainWindowVM.cs b/Wabbajack.App.Wpf/View Models/MainWindowVM.cs index 6a17ae4e..81aa50f2 100644 --- a/Wabbajack.App.Wpf/View Models/MainWindowVM.cs +++ b/Wabbajack.App.Wpf/View Models/MainWindowVM.cs @@ -13,8 +13,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Wabbajack.Common; using Wabbajack.Downloaders.GameFile; -using Wabbajack.Lib; -using Wabbajack.Lib.Interventions; +using Wabbajack; +using Wabbajack.Interventions; using Wabbajack.Messages; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Paths; diff --git a/Wabbajack.App.Wpf/View Models/ModListVM.cs b/Wabbajack.App.Wpf/View Models/ModListVM.cs index 181447ce..1056f97e 100644 --- a/Wabbajack.App.Wpf/View Models/ModListVM.cs +++ b/Wabbajack.App.Wpf/View Models/ModListVM.cs @@ -12,10 +12,10 @@ using Wabbajack.Common; using Wabbajack.DTOs; using Wabbajack.DTOs.JsonConverters; using Wabbajack.Installer; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.Paths; using Wabbajack.Paths.IO; -using Consts = Wabbajack.Lib.Consts; +using Consts = Wabbajack.Consts; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/ModVM.cs b/Wabbajack.App.Wpf/View Models/ModVM.cs index fd73cf2b..14b0d80a 100644 --- a/Wabbajack.App.Wpf/View Models/ModVM.cs +++ b/Wabbajack.App.Wpf/View Models/ModVM.cs @@ -4,7 +4,7 @@ using System.Reactive.Linq; using System.Windows.Media.Imaging; using Microsoft.Extensions.Logging; using Wabbajack.DTOs.DownloadStates; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { @@ -25,7 +25,7 @@ namespace Wabbajack ImageObservable = Observable.Return(State.ImageURL?.ToString()) .ObserveOn(RxApp.TaskpoolScheduler) - .DownloadBitmapImage(ex => _logger.LogError(ex, "Skipping slide for mod {Name}", State.Name)) + .DownloadBitmapImage(ex => _logger.LogError(ex, "Skipping slide for mod {Name}", State.Name), LoadingLock) .Replay(1) .RefCount(TimeSpan.FromMilliseconds(5000)); } diff --git a/Wabbajack.App.Wpf/View Models/ModeSelectionVM.cs b/Wabbajack.App.Wpf/View Models/ModeSelectionVM.cs index ce4fd331..8a95c80d 100644 --- a/Wabbajack.App.Wpf/View Models/ModeSelectionVM.cs +++ b/Wabbajack.App.Wpf/View Models/ModeSelectionVM.cs @@ -7,7 +7,7 @@ using System.Reactive; using System.Reactive.Linq; using System.Windows.Input; using Wabbajack.Common; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.Messages; using Wabbajack.Paths.IO; diff --git a/Wabbajack.App.Wpf/View Models/Settings/AuthorFilesVM.cs b/Wabbajack.App.Wpf/View Models/Settings/AuthorFilesVM.cs index 8c7a14b9..50ec0a45 100644 --- a/Wabbajack.App.Wpf/View Models/Settings/AuthorFilesVM.cs +++ b/Wabbajack.App.Wpf/View Models/Settings/AuthorFilesVM.cs @@ -7,7 +7,7 @@ using System.Windows.Input; using Microsoft.Extensions.Logging; using ReactiveUI; using ReactiveUI.Fody.Helpers; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Services.OSIntegrated.TokenProviders; diff --git a/Wabbajack.App.Wpf/View Models/Settings/CredentialsLoginVM.cs b/Wabbajack.App.Wpf/View Models/Settings/CredentialsLoginVM.cs index 8e5a128a..0139161f 100644 --- a/Wabbajack.App.Wpf/View Models/Settings/CredentialsLoginVM.cs +++ b/Wabbajack.App.Wpf/View Models/Settings/CredentialsLoginVM.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using ReactiveUI; using ReactiveUI.Fody.Helpers; using Wabbajack.Downloaders.Interfaces; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs b/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs index ab6cc2a1..c378e619 100644 --- a/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs @@ -10,7 +10,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using Microsoft.Extensions.Logging; using ReactiveUI; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/Settings/SettingsVM.cs b/Wabbajack.App.Wpf/View Models/Settings/SettingsVM.cs index af1ddd54..7ea6ff77 100644 --- a/Wabbajack.App.Wpf/View Models/Settings/SettingsVM.cs +++ b/Wabbajack.App.Wpf/View Models/Settings/SettingsVM.cs @@ -10,7 +10,7 @@ using System.Windows.Input; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using ReactiveUI; -using Wabbajack.Lib; +using Wabbajack; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Services.OSIntegrated.TokenProviders; using Wabbajack.View_Models.Settings; diff --git a/Wabbajack.App.Wpf/View Models/SlideShow.cs b/Wabbajack.App.Wpf/View Models/SlideShow.cs index d4e7ec07..a45240e1 100644 --- a/Wabbajack.App.Wpf/View Models/SlideShow.cs +++ b/Wabbajack.App.Wpf/View Models/SlideShow.cs @@ -10,8 +10,8 @@ using ReactiveUI; using ReactiveUI.Fody.Helpers; using Wabbajack.Common; using Wabbajack.DTOs.DownloadStates; -using Wabbajack.Lib; -using Wabbajack.Lib.Extensions; +using Wabbajack; +using Wabbajack.Extensions; namespace Wabbajack.View_Models { diff --git a/Wabbajack.App.Wpf/View Models/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs b/Wabbajack.App.Wpf/View Models/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs index 86188872..cc46c6f1 100644 --- a/Wabbajack.App.Wpf/View Models/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs +++ b/Wabbajack.App.Wpf/View Models/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs @@ -4,8 +4,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Wabbajack.Common; -using Wabbajack.Lib; -using Wabbajack.Lib.Interventions; +using Wabbajack; +using Wabbajack.Interventions; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/UserInterventionHandlers.cs b/Wabbajack.App.Wpf/View Models/UserInterventionHandlers.cs index 2d7b2ad9..5bf2e912 100644 --- a/Wabbajack.App.Wpf/View Models/UserInterventionHandlers.cs +++ b/Wabbajack.App.Wpf/View Models/UserInterventionHandlers.cs @@ -5,8 +5,8 @@ using System.Windows; using Microsoft.Extensions.Logging; using ReactiveUI; using Wabbajack.Common; -using Wabbajack.Lib; -using Wabbajack.Lib.Interventions; +using Wabbajack; +using Wabbajack.Interventions; using Wabbajack.Messages; namespace Wabbajack diff --git a/Wabbajack.App.Wpf/View Models/WebBrowserVM.cs b/Wabbajack.App.Wpf/View Models/WebBrowserVM.cs index 5db62e9b..1fe8bfe5 100644 --- a/Wabbajack.App.Wpf/View Models/WebBrowserVM.cs +++ b/Wabbajack.App.Wpf/View Models/WebBrowserVM.cs @@ -11,9 +11,9 @@ using CefSharp.Wpf; using Microsoft.Extensions.Logging; using ReactiveUI; using ReactiveUI.Fody.Helpers; -using Wabbajack.Lib; -using Wabbajack.Lib.LibCefHelpers; -using Wabbajack.Lib.WebAutomation; +using Wabbajack; +using Wabbajack.LibCefHelpers; +using Wabbajack.WebAutomation; namespace Wabbajack { diff --git a/Wabbajack.Lib/ViewModel.cs b/Wabbajack.App.Wpf/ViewModel.cs similarity index 97% rename from Wabbajack.Lib/ViewModel.cs rename to Wabbajack.App.Wpf/ViewModel.cs index e480a994..8eb82a25 100644 --- a/Wabbajack.Lib/ViewModel.cs +++ b/Wabbajack.App.Wpf/ViewModel.cs @@ -6,7 +6,7 @@ using System.Reactive.Disposables; using System.Runtime.CompilerServices; using Wabbajack.Models; -namespace Wabbajack.Lib +namespace Wabbajack { public class ViewModel : ReactiveObject, IDisposable, IActivatableViewModel { diff --git a/Wabbajack.App.Wpf/Views/Common/CpuView.xaml.cs b/Wabbajack.App.Wpf/Views/Common/CpuView.xaml.cs index ea5c116f..d56efa07 100644 --- a/Wabbajack.App.Wpf/Views/Common/CpuView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Common/CpuView.xaml.cs @@ -15,7 +15,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using ReactiveUI; using ReactiveUI.Fody.Helpers; -using Wabbajack.Lib; +using Wabbajack; using System.Windows.Controls.Primitives; using System.Reactive.Linq; using Wabbajack.Common; diff --git a/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml b/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml index 95bb80a5..e7e94c72 100644 --- a/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml +++ b/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml @@ -3,13 +3,11 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks" - xmlns:lib="clr-namespace:Wabbajack.Lib;assembly=Wabbajack.Lib" xmlns:local="clr-namespace:Wabbajack" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450" d:DesignWidth="800" - x:TypeArguments="lib:ViewModel" + x:TypeArguments="local:ViewModel" ClipToBounds="True" mc:Ignorable="d"> diff --git a/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml.cs b/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml.cs index a1ace382..798aff39 100644 --- a/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Common/DetailImageView.xaml.cs @@ -7,7 +7,7 @@ using System.Reactive.Disposables; using System.Reactive.Linq; using System.Windows; using System.Windows.Media; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/Views/Common/FilePicker.xaml.cs b/Wabbajack.App.Wpf/Views/Common/FilePicker.xaml.cs index eda2b7ee..608cb1b0 100644 --- a/Wabbajack.App.Wpf/Views/Common/FilePicker.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Common/FilePicker.xaml.cs @@ -1,7 +1,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Data; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { /// diff --git a/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml b/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml index c054350f..52f64fa0 100644 --- a/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml +++ b/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml @@ -3,13 +3,12 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:lib="clr-namespace:Wabbajack.Lib;assembly=Wabbajack.Lib" xmlns:local="clr-namespace:Wabbajack" xmlns:mahapps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450" d:DesignWidth="800" - x:TypeArguments="lib:ViewModel" + x:TypeArguments="local:ViewModel" BorderThickness="0" mc:Ignorable="d"> diff --git a/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml.cs b/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml.cs index bfe0b43e..ebe3f7b3 100644 --- a/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Common/TopProgressView.xaml.cs @@ -4,7 +4,7 @@ using System.Windows.Controls; using ReactiveUI; using System; using ReactiveUI.Fody.Helpers; -using Wabbajack.Lib; +using Wabbajack; using System.Reactive.Disposables; namespace Wabbajack diff --git a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml index 4aa73a7c..464f1623 100644 --- a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml +++ b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml @@ -2,7 +2,7 @@ x:Class="Wabbajack.CompilerView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:lib="clr-namespace:Wabbajack.Lib;assembly=Wabbajack.Lib" + xmlns:lib="clr-namespace:Wabbajack;assembly=Wabbajack" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:local="clr-namespace:Wabbajack" diff --git a/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml b/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml index 70305d12..9a34046b 100644 --- a/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml +++ b/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml @@ -5,11 +5,12 @@ xmlns:common="clr-namespace:Wabbajack.Common;assembly=Wabbajack.Common" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks" - xmlns:lib="clr-namespace:Wabbajack.Lib;assembly=Wabbajack.Lib" + xmlns:lib="clr-namespace:Wabbajack;assembly=Wabbajack" xmlns:local="clr-namespace:Wabbajack" xmlns:mahapps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:rxui="http://reactiveui.net" + xmlns:lib1="clr-namespace:Wabbajack" d:DataContext="{d:DesignInstance local:InstallerVM}" d:DesignHeight="500" d:DesignWidth="800" @@ -304,7 +305,7 @@ x:Name="UserInterventionsControl" Content="{Binding ActiveGlobalUserIntervention}"> - + diff --git a/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml b/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml index 18e11b89..60620f63 100644 --- a/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml +++ b/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml @@ -3,7 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:lib="clr-namespace:Wabbajack.Lib;assembly=Wabbajack.Lib" + xmlns:lib="clr-namespace:Wabbajack;assembly=Wabbajack" xmlns:local="clr-namespace:Wabbajack" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:rxui="http://reactiveui.net" diff --git a/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml.cs b/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml.cs index b26994d0..093eb3eb 100644 --- a/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Interventions/ConfirmUpdateOfExistingInstallView.xaml.cs @@ -14,7 +14,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using ReactiveUI; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml b/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml index c7e40cd9..8437459e 100644 --- a/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml +++ b/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml @@ -3,13 +3,12 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:Wabbajack" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:lib="clr-namespace:Wabbajack.Lib;assembly=Wabbajack.Lib" xmlns:rxui="http://reactiveui.net" + xmlns:lib1="clr-namespace:Wabbajack" d:DesignHeight="450" d:DesignWidth="800" - x:TypeArguments="lib:ConfirmationIntervention" + x:TypeArguments="lib1:ConfirmationIntervention" mc:Ignorable="d"> diff --git a/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml.cs b/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml.cs index 91f9d783..e67a6fa5 100644 --- a/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Interventions/ConfirmationInterventionView.xaml.cs @@ -14,7 +14,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using ReactiveUI; -using Wabbajack.Lib; +using Wabbajack; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs index 5d2c36fd..836edea7 100644 --- a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs @@ -4,8 +4,8 @@ using System.Threading.Tasks; using MahApps.Metro.Controls; using Microsoft.Extensions.Logging; using Wabbajack.Common; -using Wabbajack.Lib; -using Wabbajack.Lib.LibCefHelpers; +using Wabbajack; +using Wabbajack.LibCefHelpers; using Wabbajack.Paths; using Wabbajack.Paths.IO; using Wabbajack.Util; diff --git a/Wabbajack.App.Wpf/Views/ModListGalleryView.xaml.cs b/Wabbajack.App.Wpf/Views/ModListGalleryView.xaml.cs index cc22413c..62225ac6 100644 --- a/Wabbajack.App.Wpf/Views/ModListGalleryView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/ModListGalleryView.xaml.cs @@ -31,15 +31,10 @@ namespace Wabbajack .StartWith(Visibility.Collapsed) .BindToStrict(this, x => x.ErrorIcon.Visibility) .DisposeWith(dispose); - - Observable.CombineLatest( - this.WhenAny(x => x.ViewModel.ModLists.Count) - .Select(x => x > 0), - this.WhenAny(x => x.ViewModel.Loaded), - resultSelector: (hasContent, loaded) => - { - return !hasContent && loaded; - }) + + this.WhenAny(x => x.ViewModel.ModLists.Count) + .CombineLatest(this.WhenAnyValue(x => x.ViewModel.LoadingLock.IsLoading)) + .Select(x => x.First == 0 && !x.Second) .DistinctUntilChanged() .Select(x => x ? Visibility.Visible : Visibility.Collapsed) .StartWith(Visibility.Collapsed) diff --git a/Wabbajack.App.Wpf/Views/ModListTileView.xaml b/Wabbajack.App.Wpf/Views/ModListTileView.xaml index 314e185c..51e68a6a 100644 --- a/Wabbajack.App.Wpf/Views/ModListTileView.xaml +++ b/Wabbajack.App.Wpf/Views/ModListTileView.xaml @@ -90,7 +90,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="UniformToFill"> - +