Fix issues with icon loading

This commit is contained in:
2026-01-24 16:55:54 -07:00
parent 8480bbc0f7
commit 44b594a7f2
4 changed files with 60 additions and 30 deletions

View File

@@ -166,8 +166,8 @@ public class IconMarketplaceDownloadIcon : MonoBehaviour
{
GameObject newIcon = Instantiate(sample, content.transform);
newIcon.name = "IconEntry";
Tools.RenderFromBase64(Tools.FixIconData(entry.Data).Item1, newIcon.transform.GetChild(0).GetChild(0).GetComponent<Image>());
var (d, h) = Tools.FixIconData(entry.Data);
if (d != null && h != null && Tools.Sha512Sum(Convert.FromBase64String(d)) == h) Tools.RenderFromBase64(d, newIcon.transform.GetChild(0).GetChild(0).GetComponent<Image>());
newIcon.transform.GetChild(1).GetComponent<TMP_Text>().text = "Bird Name: " + entry.Name;
newIcon.transform.GetChild(2).GetComponent<TMP_Text>().text = "Price " + Tools.FormatWithCommas(entry.Price) + " coins";
newIcon.transform.GetChild(3).GetComponent<TMP_Text>().text = "Designer Name: " + entry.CreatorUsername;