Пример #1
0
 public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController)
 {
     this.screenData         = (DRewardPopupScreenQuests)screenData;
     RewardCategoryText.text = Service.Get <Localizer>().GetTokenTranslation(TITLE_TEXT_KEY);
     isIntroComplete         = false;
     loadItems(this.screenData.quests);
     UnlockedText.SetActive(Service.Get <CPDataEntityCollection>().IsLocalPlayerMember() && !this.screenData.IsRewardsAllNonMember);
     Service.Get <TrayNotificationManager>().DismissAllNotifications();
     membershipNotificationText = Service.Get <Localizer>().GetTokenTranslation("MemberNotification.RewardScreen.QuestText");
     checkMembershipDisclaimer();
 }
        private static List <DRewardPopupScreen> buildQuestsScreen(DRewardPopup popupData, bool checkForNonMemberScreens)
        {
            DRewardPopupScreenQuests dRewardPopupScreenQuests = new DRewardPopupScreenQuests();
            List <QuestDefinition>   list = new List <QuestDefinition>();
            bool isRewardsAllNonMember    = false;

            if (popupData.PopupType == DRewardPopup.RewardPopupType.levelUp)
            {
                MascotService mascotService = Service.Get <MascotService>();
                Mascot        mascot        = mascotService.GetMascot(popupData.MascotName);
                int           num           = Service.Get <ProgressionService>().MascotLevel(mascot.Name);
                if (popupData.MascotName == "AuntArctic" && num == 1)
                {
                    foreach (Mascot mascot2 in mascotService.Mascots)
                    {
                        if (!mascot2.IsQuestGiver || !(mascot2.Name != "AuntArctic"))
                        {
                            continue;
                        }
                        for (int i = 0; i < mascot2.KnownQuests.Length; i++)
                        {
                            QuestDefinition questDefinition = mascot2.KnownQuests[i];
                            if (questDefinition.QuestNumber == 1 && questDefinition.ChapterNumber == 1)
                            {
                                list.Add(questDefinition);
                            }
                            if (list.Count >= 2)
                            {
                                break;
                            }
                        }
                    }
                }
                if (list.Count < 2)
                {
                    for (int i = 0; i < mascot.KnownQuests.Length; i++)
                    {
                        QuestDefinition questDefinition = mascot.KnownQuests[i];
                        if (!questDefinition.Prototyped && questDefinition.LevelRequirement == num)
                        {
                            list.Add(questDefinition);
                        }
                        if (list.Count >= 2)
                        {
                            break;
                        }
                    }
                }
            }
            List <DRewardPopupScreen> list2 = new List <DRewardPopupScreen>();

            if (list.Count > 0)
            {
                dRewardPopupScreenQuests.quests = list.ToArray();
                if (checkForNonMemberScreens)
                {
                    for (int i = 0; i < dRewardPopupScreenQuests.quests.Length; i++)
                    {
                        if (dRewardPopupScreenQuests.quests[i].isMemberOnly)
                        {
                            isRewardsAllNonMember = false;
                            break;
                        }
                        isRewardsAllNonMember = true;
                    }
                }
                dRewardPopupScreenQuests.IsRewardsAllNonMember = isRewardsAllNonMember;
                list2.Add(dRewardPopupScreenQuests);
            }
            return(list2);
        }