From d6edcf0a1e8b23f8f6442467bd5ed2a5e37cd9fc Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Fri, 26 Feb 2021 23:09:18 -0700 Subject: [PATCH 1/4] Sort the game entries --- Wabbajack/View Models/Gallery/ModListGalleryVM.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs index 12d6903d..fd33806e 100644 --- a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs +++ b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs @@ -37,7 +37,7 @@ namespace Wabbajack [Reactive] public bool ShowNSFW { get; set; } - + [Reactive] public bool ShowUtilityLists { get; set; } @@ -197,6 +197,7 @@ namespace Wabbajack { List gameEntries = new List { ALL_GAME_TYPE }; gameEntries.AddRange(EnumExtensions.GetAllItems().Select(gameType => gameType.GetDescription())); + gameEntries.Sort(); return gameEntries; } From 3deed0445293f2706b5683a3d3fcb7435f8246bf Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Fri, 26 Feb 2021 23:10:35 -0700 Subject: [PATCH 2/4] Widen the game selection combo box --- Wabbajack/Views/ModListGalleryView.xaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Wabbajack/Views/ModListGalleryView.xaml b/Wabbajack/Views/ModListGalleryView.xaml index 152090b9..ab0243fc 100644 --- a/Wabbajack/Views/ModListGalleryView.xaml +++ b/Wabbajack/Views/ModListGalleryView.xaml @@ -93,7 +93,7 @@ VerticalAlignment="Center" Content="Game" /> - + - + Date: Fri, 26 Feb 2021 23:14:34 -0700 Subject: [PATCH 3/4] Give proper descriptions to each game --- Wabbajack.Common/GameMetaData.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Wabbajack.Common/GameMetaData.cs b/Wabbajack.Common/GameMetaData.cs index 1621e0f4..3f7be36a 100644 --- a/Wabbajack.Common/GameMetaData.cs +++ b/Wabbajack.Common/GameMetaData.cs @@ -36,14 +36,21 @@ namespace Wabbajack.Common [Description("Darkest Dungeon")] DarkestDungeon, Dishonored, + [Description("Witcher 3")] Witcher3, [Description("Stardew Valley")] StardewValley, + [Description("Kingdom Come: Deliverance")] KingdomComeDeliverance, + [Description("MechWarrior 5: Mercenaries")] MechWarrior5Mercenaries, + [Description("No Man's Sky")] NoMansSky, + [Description("Dragon Age: Origins")] DragonAgeOrigins, + [Description("Dragon Age 2")] DragonAge2, + [Description("Dragon Age: Inquisition")] DragonAgeInquisition, [Description("Kerbal Space Program")] KerbalSpaceProgram, From d2a41de104ff4766749a4299e57dfe83e28e68f5 Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Fri, 26 Feb 2021 23:43:41 -0700 Subject: [PATCH 4/4] Fix randomness of lists presented The list of mod lists was being sorted two different times. The second time shuffled the list and then sorted using a method that made the list very consistently show the same order of mod lists. I think it was in order of most recently updated...? Now only one sort is performed and the list is properly shuffled each time the program is launched. --- .../ModListRegistry/ModListMetadata.cs | 20 ++++++++++++------- .../View Models/Gallery/ModListGalleryVM.cs | 5 ----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs b/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs index e9444a90..cc3a26f0 100644 --- a/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs +++ b/Wabbajack.Lib/ModListRegistry/ModListMetadata.cs @@ -34,10 +34,10 @@ namespace Wabbajack.Lib.ModListRegistry [JsonProperty("nsfw")] public bool NSFW { get; set; } - + [JsonProperty("utility_list")] public bool UtilityList { get; set; } - + [JsonProperty("image_contains_title")] public bool ImageContainsTitle { get; set; } @@ -50,13 +50,13 @@ namespace Wabbajack.Lib.ModListRegistry [JsonProperty("download_metadata")] public DownloadMetadata? DownloadMetadata { get; set; } - [JsonIgnore] + [JsonIgnore] public ModListSummary ValidationSummary { get; set; } = new ModListSummary(); [JsonName("Links")] public class LinksObject { - [JsonProperty("image")] + [JsonProperty("image")] public string ImageUri { get; set; } = string.Empty; [JsonProperty("readme")] @@ -92,7 +92,13 @@ namespace Wabbajack.Lib.ModListRegistry // ignored } - return metadata.OrderBy(m => (m.ValidationSummary?.HasFailures ?? false ? 1 : 0, m.Title)).ToList(); + var random = new Random(); + return metadata + // Sort randomly initially, just to give each list a fair shake + .Shuffle(random) + // Put broken lists at bottom + .OrderBy(m => (m.ValidationSummary?.HasFailures ?? false ? 1 : 0)) + .ToList(); } public static async Task> LoadUnlistedFromGithub() @@ -109,7 +115,7 @@ namespace Wabbajack.Lib.ModListRegistry } } - + public async ValueTask NeedsDownload(AbsolutePath modlistPath) { if (!modlistPath.Exists) return true; @@ -150,7 +156,7 @@ namespace Wabbajack.Lib.ModListRegistry public int Passed { get; set; } [JsonProperty("updating")] public int Updating { get; set; } - + [JsonProperty("mirrored")] public int Mirrored { get; set; } diff --git a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs index fd33806e..640dd4e4 100644 --- a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs +++ b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs @@ -95,7 +95,6 @@ namespace Wabbajack }) .DisposeWith(CompositeDisposable); - var random = new Random(); var sourceList = Observable.Return(Unit.Default) .ObserveOn(RxApp.TaskpoolScheduler) .SelectTask(async _ => @@ -106,8 +105,6 @@ namespace Wabbajack var list = await ModlistMetadata.LoadFromGithub(); Error = ErrorResponse.Success; return list - // Sort randomly initially, just to give each list a fair shake - .Shuffle(random) .AsObservableChangeSet(x => x.DownloadMetadata?.Hash ?? Hash.Empty); } catch (Exception ex) @@ -170,8 +167,6 @@ namespace Wabbajack return GameType == vm.Metadata.Game.GetDescription().ToString(); })) - // Put broken lists at bottom - .Sort(Comparer.Create((a, b) => a.IsBroken.CompareTo(b.IsBroken))) .Bind(ModLists) .Subscribe() .DisposeWith(CompositeDisposable);