From 4d688b7ab91682aebdd0c6eaf4c761d030abd721 Mon Sep 17 00:00:00 2001 From: JanuarySnow Date: Sun, 30 Jul 2023 00:43:33 +0100 Subject: [PATCH] added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title removed debug code change to pascal case and match existing code style update changelog --- CHANGELOG.md | 3 +++ .../View Models/Gallery/ModListMetadataVM.cs | 9 +++++++++ Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs | 9 ++++++++- Wabbajack.DTOs/ModList/ModListMetadata.cs | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 247c9e6f..f3f4dd05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +#### Version - TBA + * Added optional JSON flag for `DisplayVersionOnlyInInstallerView` to enable the installer image to only show version number. + #### Version - 3.2.0.1 - 7/23/2023 * Code cleanup: re-added some network and diagnostic code missing since 2.5 diff --git a/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs b/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs index 3bd14e44..93cce20c 100644 --- a/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs +++ b/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs @@ -82,6 +82,13 @@ namespace Wabbajack [Reactive] public string VersionText { get; private set; } + [Reactive] + public bool ImageContainsTitle { get; private set; } + + [Reactive] + + public bool DisplayVersionOnlyInInstallerView { get; private set; } + [Reactive] public IErrorResponse Error { get; private set; } @@ -123,6 +130,8 @@ namespace Wabbajack Metadata.DownloadMetadata.SizeOfArchives + Metadata.DownloadMetadata.SizeOfInstalledFiles ); VersionText = "Modlist version : " + Metadata.Version; + ImageContainsTitle = Metadata.ImageContainsTitle; + DisplayVersionOnlyInInstallerView = Metadata.DisplayVersionOnlyInInstallerView; IsBroken = metadata.ValidationSummary.HasFailures || metadata.ForceDown; // https://www.wabbajack.org/modlist/wj-featured/aldrnari OpenWebsiteCommand = ReactiveCommand.Create(() => UIUtils.OpenWebsite(new Uri($"https://www.wabbajack.org/modlist/{Metadata.NamespacedName}"))); diff --git a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs index c5198d13..838bcf29 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs @@ -521,7 +521,14 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM private void PopulateSlideShow(ModList modList) { - SlideShowTitle = modList.Name; + if (ModlistMetadata.ImageContainsTitle && ModlistMetadata.DisplayVersionOnlyInInstallerView) + { + SlideShowTitle = "v" + ModlistMetadata.Version.ToString(); + } + else + { + SlideShowTitle = modList.Name; + } SlideShowAuthor = modList.Author; SlideShowDescription = modList.Description; SlideShowImage = ModListImage; diff --git a/Wabbajack.DTOs/ModList/ModListMetadata.cs b/Wabbajack.DTOs/ModList/ModListMetadata.cs index fbb27dab..df3bfd50 100644 --- a/Wabbajack.DTOs/ModList/ModListMetadata.cs +++ b/Wabbajack.DTOs/ModList/ModListMetadata.cs @@ -30,6 +30,8 @@ public class ModlistMetadata [JsonPropertyName("image_contains_title")] public bool ImageContainsTitle { get; set; } + [JsonPropertyName("DisplayVersionOnlyInInstallerView")] public bool DisplayVersionOnlyInInstallerView { get; set; } + [JsonPropertyName("force_down")] public bool ForceDown { get; set; } [JsonPropertyName("links")] public LinksObject Links { get; set; } = new();