From c001e0d6d2c353bb8aa553ebb822e10a37b7c3a9 Mon Sep 17 00:00:00 2001 From: pointfeev Date: Thu, 3 Mar 2022 07:36:51 -0500 Subject: [PATCH] more context menu --- CreamInstaller/Epic/EpicStore.cs | 11 ++++++++++- CreamInstaller/Epic/GraphQL/Request.cs | 2 -- CreamInstaller/Paradox/ParadoxLauncher.cs | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CreamInstaller/Epic/EpicStore.cs b/CreamInstaller/Epic/EpicStore.cs index 47b9169..9227036 100644 --- a/CreamInstaller/Epic/EpicStore.cs +++ b/CreamInstaller/Epic/EpicStore.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Drawing; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; @@ -26,7 +27,15 @@ internal static class EpicStore string product = null; try { product = element.CatalogNs.Mappings[0].PageSlug; } catch { } string icon = null; - try { icon = element.KeyImages[0].Url; } catch { } + for (int i = 0; i < element.KeyImages?.Length; i++) + { + KeyImage keyImage = element.KeyImages[i]; + if (keyImage.Type == "Thumbnail") + { + icon = keyImage.Url; + break; + } + } (string id, string name, string product, string icon) app = (element.Items[0].Id, element.Title, product, icon); if (!dlcIds.Contains(app)) dlcIds.Add(app); diff --git a/CreamInstaller/Epic/GraphQL/Request.cs b/CreamInstaller/Epic/GraphQL/Request.cs index 1b05624..8797e68 100644 --- a/CreamInstaller/Epic/GraphQL/Request.cs +++ b/CreamInstaller/Epic/GraphQL/Request.cs @@ -22,7 +22,6 @@ internal class Request elements { id title - offerType items { id } @@ -41,7 +40,6 @@ internal class Request elements { id title - offerType items { id } diff --git a/CreamInstaller/Paradox/ParadoxLauncher.cs b/CreamInstaller/Paradox/ParadoxLauncher.cs index 0471e13..a1e1e73 100644 --- a/CreamInstaller/Paradox/ParadoxLauncher.cs +++ b/CreamInstaller/Paradox/ParadoxLauncher.cs @@ -30,14 +30,14 @@ internal static class ParadoxLauncher foreach (ProgramSelection selection in ProgramSelection.AllUsableEnabled) { if (selection == paradoxLauncher) continue; - if (selection.AppInfo is null || selection.AppInfo.Value?.GetChild("extended")?.GetChild("publisher")?.ToString() != "Paradox Interactive") continue; + if (selection.AppInfo?.Value?.GetChild("extended")?.GetChild("publisher")?.ToString() != "Paradox Interactive") continue; paradoxLauncher.ExtraDlc.Add(new(selection.Id, selection.Name, selection.SelectedDlc)); } if (!paradoxLauncher.ExtraDlc.Any()) foreach (ProgramSelection selection in ProgramSelection.AllUsable) { if (selection == paradoxLauncher) continue; - if (selection.AppInfo is null || selection.AppInfo.Value?.GetChild("extended")?.GetChild("publisher")?.ToString() != "Paradox Interactive") continue; + if (selection.AppInfo?.Value?.GetChild("extended")?.GetChild("publisher")?.ToString() != "Paradox Interactive") continue; paradoxLauncher.ExtraDlc.Add(new(selection.Id, selection.Name, selection.AllDlc)); } }