Add more types, should be done for those I think

This commit is contained in:
2025-07-16 21:31:18 -07:00
parent ce673da55b
commit 90d5c2d8c2
7 changed files with 27 additions and 12 deletions

View File

@@ -70,14 +70,14 @@ public class IconMarketplaceDownloadIcon : MonoBehaviour
var jsonResponse = JArray.Parse(response);
foreach (var item in jsonResponse)
{
DownloadIconType entry = ((JObject)item).ToObject<DownloadIconType>();
MarketplaceIconType entry = ((JObject)item).ToObject<MarketplaceIconType>();
GameObject newIcon = Instantiate(sample, content.transform);
newIcon.name = "IconEntry";
Tools.RenderFromBase64(entry.Data, 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 " + entry.Price + " coin";
newIcon.transform.GetChild(3).GetComponent<TMP_Text>().text = "Designer Name: " + entry.Username;
newIcon.transform.GetChild(3).GetComponent<TMP_Text>().text = "Designer Name: " + entry.CreatorUsername;
newIcon.transform.GetChild(4).GetChild(0).GetComponent<TMP_Text>().text = "Purchase";
newIcon.transform.GetChild(4).GetComponent<Button>().onClick.AddListener(() => HandlePurchase(entry));
@@ -86,7 +86,7 @@ public class IconMarketplaceDownloadIcon : MonoBehaviour
}
}
void HandlePurchase(DownloadIconType data)
void HandlePurchase(MarketplaceIconType data)
{
//will work on this
}

View File

@@ -42,14 +42,14 @@ public class IconMarketplaceManager : MonoBehaviour
switch (panelIndex)
{
case 0:
coinText.text = "You have " + Tools.FormatWithCommas((BazookaManager.Instance.GetCustomBirdIconData()["totalCoins"] ?? "0").ToString()) + " coins";
coinText.text = "You have " + Tools.FormatWithCommas(BazookaManager.Instance.GetCustomBirdIconData().Balance) + " coins";
normalPanel.SetActive(true);
downloadPanel.SetActive(false);
uploadPanel.SetActive(false);
break;
case 1:
downloadPanelScript.Load();
downloadPanelScript.balanceText.text = "You have " + Tools.FormatWithCommas((BazookaManager.Instance.GetCustomBirdIconData()["totalCoins"] ?? "0").ToString()) + " coins to spend";
downloadPanelScript.balanceText.text = "You have " + Tools.FormatWithCommas(BazookaManager.Instance.GetCustomBirdIconData().Balance) + " coins to spend";
normalPanel.SetActive(false);
downloadPanel.SetActive(true);
uploadPanel.SetActive(false);