From 37151a49967e20dd4f83612617250b97d3d12fed Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Tue, 29 Jul 2025 19:31:34 -0700 Subject: [PATCH] Fix the marketplace not working in the game player This took me 3 weeks to figure out, I hate everything --- .../IconMarketplaceDownloadIcon.cs | 11 ++++------- Assets/Scripts/Types/MarketplaceIconType.cs | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/IconMarketplace/IconMarketplaceDownloadIcon.cs b/Assets/Scripts/IconMarketplace/IconMarketplaceDownloadIcon.cs index 044b1a3..199f260 100644 --- a/Assets/Scripts/IconMarketplace/IconMarketplaceDownloadIcon.cs +++ b/Assets/Scripts/IconMarketplace/IconMarketplaceDownloadIcon.cs @@ -1,6 +1,6 @@ using System.Collections; using System.Linq; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; using TMPro; using UnityEngine; using UnityEngine.Networking; @@ -72,17 +72,16 @@ public class IconMarketplaceDownloadIcon : MonoBehaviour else { ShowStatus(null); - var jsonResponse = JArray.Parse(response); - foreach (var item in jsonResponse) + var icons = JsonConvert.DeserializeObject(response); + foreach (var entry in icons) { - MarketplaceIconType entry = ((JObject)item).ToObject(); GameObject newIcon = Instantiate(sample, content.transform); newIcon.name = "IconEntry"; Tools.RenderFromBase64(entry.Data, newIcon.transform.GetChild(0).GetChild(0).GetComponent()); newIcon.transform.GetChild(1).GetComponent().text = "Bird Name: " + entry.Name; newIcon.transform.GetChild(2).GetComponent().text = "Price " + entry.Price + " coin"; - newIcon.transform.GetChild(3).GetComponent().text = "Designer Name: " + ((JObject)item)["username"].ToString(); + newIcon.transform.GetChild(3).GetComponent().text = "Designer Name: " + entry.CreatorUsername; var btn = newIcon.transform.GetChild(4).GetComponent