diff --git a/CreamInstaller/Epic/EpicStore.cs b/CreamInstaller/Epic/EpicStore.cs index 056c0b8..b0a6042 100644 --- a/CreamInstaller/Epic/EpicStore.cs +++ b/CreamInstaller/Epic/EpicStore.cs @@ -13,9 +13,9 @@ namespace CreamInstaller.Epic; internal static class EpicStore { - internal static async Task> ParseDlcAppIds(string categoryNamespace) + internal static async Task> ParseDlcAppIds(string categoryNamespace) { - List<(string id, string name, string product, string icon)> dlcIds = new(); + List<(string id, string name, string product, string icon, string developer)> dlcIds = new(); Response response = await QueryGraphQL(categoryNamespace); if (response is null) return dlcIds; @@ -35,7 +35,7 @@ internal static class EpicStore break; } } - (string id, string name, string product, string icon) app = (element.Items[0].Id, element.Title, product, icon); + (string id, string name, string product, string icon, string developer) app = (element.Items[0].Id, element.Title, product, icon, element.Developer); if (!dlcIds.Contains(app)) dlcIds.Add(app); } diff --git a/CreamInstaller/Epic/GraphQL/Request.cs b/CreamInstaller/Epic/GraphQL/Request.cs index 8797e68..09f03e3 100644 --- a/CreamInstaller/Epic/GraphQL/Request.cs +++ b/CreamInstaller/Epic/GraphQL/Request.cs @@ -34,6 +34,7 @@ internal class Request pageSlug } } + developer } } searchStore(category: ""games/edition/base"", namespace: $namespace) { @@ -52,6 +53,7 @@ internal class Request pageSlug } } + developer } } } diff --git a/CreamInstaller/Epic/GraphQL/Response.cs b/CreamInstaller/Epic/GraphQL/Response.cs index 4bcae56..ec82135 100644 --- a/CreamInstaller/Epic/GraphQL/Response.cs +++ b/CreamInstaller/Epic/GraphQL/Response.cs @@ -53,9 +53,6 @@ public class Element [JsonProperty(PropertyName = "title")] public string Title { get; protected set; } - [JsonProperty(PropertyName = "offerType")] - public string OfferType { get; protected set; } - [JsonProperty(PropertyName = "items")] public Item[] Items { get; protected set; } @@ -64,6 +61,9 @@ public class Element [JsonProperty(PropertyName = "catalogNs")] public CatalogNs CatalogNs { get; protected set; } + + [JsonProperty(PropertyName = "developer")] + public string Developer { get; protected set; } } public class Item diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs index 7651877..3aea1f5 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/SelectForm.cs @@ -201,6 +201,7 @@ internal partial class SelectForm : CustomForm selection.ProductUrl = "https://store.steampowered.com/app/" + appId; selection.IconUrl = IconGrabber.SteamAppImagesPath + @$"\{appId}\{appInfo?.Value?.GetChild("common")?.GetChild("icon")?.ToString()}.jpg"; selection.ClientIconUrl = IconGrabber.SteamAppImagesPath + @$"\{appId}\{appInfo?.Value?.GetChild("common")?.GetChild("clienticon")?.ToString()}.ico"; + selection.Publisher = appInfo?.Value?.GetChild("extended")?.GetChild("publisher")?.ToString(); if (Program.Canceled) return; Program.Invoke(selectionTreeView, delegate @@ -260,19 +261,19 @@ internal partial class SelectForm : CustomForm return; } if (Program.Canceled) return; - ConcurrentDictionary dlc = new(); + ConcurrentDictionary dlc = new(); List dlcTasks = new(); - List<(string id, string name, string product, string icon)> dlcIds = await EpicStore.ParseDlcAppIds(@namespace); + List<(string id, string name, string product, string icon, string developer)> dlcIds = await EpicStore.ParseDlcAppIds(@namespace); if (dlcIds.Count > 0) { - foreach ((string id, string name, string product, string icon) in dlcIds) + foreach ((string id, string name, string product, string icon, string developer) in dlcIds) { if (Program.Canceled) return; AddToRemainingDLCs(id); Task task = Task.Run(() => { if (Program.Canceled) return; - dlc[id] = (name, product, icon); + dlc[id] = (name, product, icon, developer); RemoveFromRemainingDLCs(id); progress.Report(++CompleteTasks); }); @@ -301,11 +302,12 @@ internal partial class SelectForm : CustomForm selection.Name = name; selection.RootDirectory = directory; selection.DllDirectories = dllDirectories; - foreach (KeyValuePair pair in dlc) + foreach (KeyValuePair pair in dlc) if (pair.Value.name == selection.Name) { selection.ProductUrl = "https://www.epicgames.com/store/product/" + pair.Value.product; selection.IconUrl = pair.Value.icon; + selection.Publisher = pair.Value.developer; } if (Program.Canceled) return; @@ -318,7 +320,7 @@ internal partial class SelectForm : CustomForm programNode.Checked = selection.Enabled; programNode.Remove(); selectionTreeView.Nodes.Add(programNode); - foreach (KeyValuePair pair in dlc) + foreach (KeyValuePair pair in dlc) { if (Program.Canceled || programNode is null) return; string dlcId = pair.Key; diff --git a/CreamInstaller/Paradox/ParadoxLauncher.cs b/CreamInstaller/Paradox/ParadoxLauncher.cs index a1e1e73..9c3ec57 100644 --- a/CreamInstaller/Paradox/ParadoxLauncher.cs +++ b/CreamInstaller/Paradox/ParadoxLauncher.cs @@ -2,8 +2,6 @@ using System.Linq; using System.Windows.Forms; -using CreamInstaller.Steam; - using Microsoft.Win32; namespace CreamInstaller.Paradox; @@ -29,15 +27,13 @@ internal static class ParadoxLauncher paradoxLauncher.ExtraDlc.Clear(); foreach (ProgramSelection selection in ProgramSelection.AllUsableEnabled) { - if (selection == paradoxLauncher) continue; - if (selection.AppInfo?.Value?.GetChild("extended")?.GetChild("publisher")?.ToString() != "Paradox Interactive") continue; + if (selection == paradoxLauncher || selection.Publisher != "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?.Value?.GetChild("extended")?.GetChild("publisher")?.ToString() != "Paradox Interactive") continue; + if (selection == paradoxLauncher || selection.Publisher != "Paradox Interactive") continue; paradoxLauncher.ExtraDlc.Add(new(selection.Id, selection.Name, selection.AllDlc)); } } diff --git a/CreamInstaller/ProgramSelection.cs b/CreamInstaller/ProgramSelection.cs index 655d199..2f0b5af 100644 --- a/CreamInstaller/ProgramSelection.cs +++ b/CreamInstaller/ProgramSelection.cs @@ -20,6 +20,8 @@ internal class ProgramSelection internal string IconUrl = null; internal string ClientIconUrl = null; + internal string Publisher = null; + internal string RootDirectory = null; internal List DllDirectories = null;