public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { this.screenData = (DRewardPopupScreenCoinsXP)screenData; popupController.RewardPopupAnimator.SetTrigger("ChestDismiss"); CoinsText.text = string.Format(Service.Get <Localizer>().GetTokenTranslation("GlobalUI.Notification.Coins"), this.screenData.CoinCount); if (this.screenData.CoinCount == 0) { CoinsGO.SetActive(value: false); } if (this.screenData.XPCount == 0) { XPGO.SetActive(value: false); } else { CoroutineRunner.Start(loadMascotXPPrefab(this.screenData.mascotName), this, "RewardPopupScreenCoinsXP.loadMascotXPPrefab"); } CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); if (cPDataEntityCollection.TryGetComponent <MembershipData>(cPDataEntityCollection.LocalPlayerHandle, out var component)) { component.MembershipDataUpdated += onMembershipDataUpdated; } Service.Get <TrayNotificationManager>().DismissAllNotifications(); membershipNotificationText = Service.Get <Localizer>().GetTokenTranslation("MemberNotification.RewardScreen.LevelText"); checkMembershipDisclaimer(); }
private static List <DRewardPopupScreen> buildXPScreen(DRewardPopup popupData) { List <DRewardPopupScreen> list = new List <DRewardPopupScreen>(); if ((popupData.RewardData.TryGetValue <CoinReward>(out var rewardable) && !rewardable.IsEmpty()) || popupData.XP > 0) { DRewardPopupScreenCoinsXP dRewardPopupScreenCoinsXP = new DRewardPopupScreenCoinsXP(); dRewardPopupScreenCoinsXP.CoinCount = rewardable.Coins; dRewardPopupScreenCoinsXP.XPCount = popupData.XP; dRewardPopupScreenCoinsXP.mascotName = popupData.MascotName; dRewardPopupScreenCoinsXP.ShowXpAndCoinsUI = popupData.ShowXpAndCoinsUI; dRewardPopupScreenCoinsXP.IsRewardsAllNonMember = true; list.Add(dRewardPopupScreenCoinsXP); } return(list); }