Forgot to make this render the icon lmao
This commit is contained in:
@@ -3,6 +3,7 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class StatsMenu : MonoBehaviour
|
||||
{
|
||||
@@ -18,6 +19,9 @@ public class StatsMenu : MonoBehaviour
|
||||
[SerializeField] private TMP_Text antiBerryStat;
|
||||
[SerializeField] private TMP_Text coinStat;
|
||||
|
||||
[SerializeField] private Image playerIcon;
|
||||
[SerializeField] private Image playerOverlay;
|
||||
|
||||
[SerializeField] private TMP_Text xpUsernameText;
|
||||
[SerializeField] private TMP_Text xpText;
|
||||
[SerializeField] private TMP_Text xpLevelText;
|
||||
@@ -36,6 +40,46 @@ public class StatsMenu : MonoBehaviour
|
||||
antiBerryStat.text = BazookaManager.Instance.GetGameStoreTotalAntiBerries().ToString();
|
||||
coinStat.text = BazookaManager.Instance.GetCustomBirdIconData().Balance.ToString();
|
||||
|
||||
var customIcon = BazookaManager.Instance.GetCustomBirdIconData().Selected;
|
||||
if (customIcon == null)
|
||||
{
|
||||
int icon = BazookaManager.Instance.GetBirdIcon();
|
||||
int overlay = BazookaManager.Instance.GetBirdOverlay();
|
||||
var iconColor = BazookaManager.Instance.GetColorSettingIcon();
|
||||
var overlayColor = BazookaManager.Instance.GetColorSettingOverlay();
|
||||
playerIcon.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + icon);
|
||||
if (icon == 1) playerIcon.sprite = Tools.GetIconForUser(BazookaManager.Instance.GetAccountID() ?? 0);
|
||||
playerOverlay.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_" + overlay);
|
||||
if (overlay != 0) playerOverlay.gameObject.SetActive(true);
|
||||
if (overlay == 8) playerOverlay.rectTransform.localPosition = new Vector3(-27.6232f, 23.42824f, 0f);
|
||||
else if (overlay == 11) playerOverlay.rectTransform.localPosition = new Vector3(-24.5611f, 32.250931f, 0f);
|
||||
else if (overlay == 13) playerOverlay.rectTransform.localPosition = new Vector3(-27.56624f, 23.25544f, 0f);
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color(
|
||||
int.Parse(iconColor[0].ToString()) / 255f,
|
||||
int.Parse(iconColor[1].ToString()) / 255f,
|
||||
int.Parse(iconColor[2].ToString()) / 255f
|
||||
);
|
||||
playerOverlay.color = new Color(
|
||||
int.Parse(overlayColor[0].ToString()) / 255f,
|
||||
int.Parse(overlayColor[1].ToString()) / 255f,
|
||||
int.Parse(overlayColor[2].ToString()) / 255f
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlay.color = Color.white;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var waitingForCustomIcon = playerIcon.gameObject.AddComponent<WaitingForCustomIcon>();
|
||||
waitingForCustomIcon.ID = customIcon;
|
||||
CustomIconLoader.Init(new[] { waitingForCustomIcon });
|
||||
}
|
||||
|
||||
var (_, level, currentXpInLevel, totalXpForLevel, percentDone) = Tools.GetLevelInfo();
|
||||
xpUsernameText.text = BazookaManager.Instance.GetAccountName() ?? "";
|
||||
xpText.text = currentXpInLevel.ToString() + "/" + totalXpForLevel.ToString() + " xp";
|
||||
|
||||
Reference in New Issue
Block a user