Ejemplo n.º 1
0
 private void AddList(QuestParam qparam, bool isActive = false)
 {
     if (qparam == null || qparam.IsMulti)
     {
         DebugUtility.LogWarning("UnitTobiraEnhanceWindow.cs => AddList():qparam is Null Reference!");
     }
     else if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.QuestListItemTemplate, (UnityEngine.Object)null))
     {
         DebugUtility.LogWarning("UnitTobiraEnhanceWindow.cs => AddList():QuestListItemTemplate is Null Reference!");
     }
     else if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.QuestListParent, (UnityEngine.Object)null))
     {
         DebugUtility.LogWarning("UnitTobiraEnhanceWindow.cs => AddList():QuestListParent is Null Reference!");
     }
     else
     {
         GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.QuestListItemTemplate);
         gameObject.get_transform().SetParent(this.QuestListParent, false);
         gameObject.SetActive(true);
         this.mGainedQuests.Add(gameObject);
         Button component = (Button)gameObject.GetComponent <Button>();
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
         {
             bool flag = qparam.IsDateUnlock(-1L);
             ((Selectable)component).set_interactable(flag && isActive);
         }
         DataSource.Bind <QuestParam>(gameObject, qparam);
     }
 }
Ejemplo n.º 2
0
        private bool RefreshQuests()
        {
            this.mCurrentChapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            this.mQuests.Clear();
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            for (int index = 0; index < availableQuests.Length; ++index)
            {
                QuestParam questParam = availableQuests[index];
                if (!availableQuests[index].IsMulti && (this.ShowAllQuests || this.mCurrentChapter != null && !(this.mCurrentChapter.iname != questParam.ChapterID)))
                {
                    if (this.mCurrentChapter.IsGpsQuest())
                    {
                        if (!questParam.gps_enable || questParam.type != QuestTypes.Gps)
                        {
                            continue;
                        }
                    }
                    else if (questParam.type == QuestTypes.Gps)
                    {
                        continue;
                    }
                    if (questParam.IsDateUnlock(-1L))
                    {
                        this.mQuests.Add(questParam);
                    }
                }
            }
            this.RefreshChapterTimer();
            return(this.mQuests.Count > 0);
        }
Ejemplo n.º 3
0
        private bool setQuestVariables(string questId, bool story)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].iname == questId)
                {
                    GlobalVars.SelectedSection.Set(availableQuests[index].Chapter.section);
                    GlobalVars.SelectedChapter.Set(availableQuests[index].ChapterID);
                    return(true);
                }
            }
            if (story)
            {
                QuestParam lastStoryQuest = instance.Player.FindLastStoryQuest();
                if (lastStoryQuest != null && lastStoryQuest.IsDateUnlock(Network.GetServerTime()))
                {
                    GlobalVars.SelectedSection.Set(lastStoryQuest.Chapter.section);
                    GlobalVars.SelectedChapter.Set(lastStoryQuest.ChapterID);
                    return(true);
                }
            }
            return(false);
        }
        private void AddPanel(QuestParam questparam, QuestParam[] availableQuests)
        {
            if (questparam == null || questparam.IsMulti)
            {
                return;
            }
            GameObject  gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.QuestListItemTemplate);
            SRPG_Button component1 = (SRPG_Button)gameObject.GetComponent <SRPG_Button>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                component1.AddListener(new SRPG_Button.ButtonClickEvent(this.OnQuestSelect));
            }
            this.mGainedQuests.Add(gameObject);
            Button component2 = (Button)gameObject.GetComponent <Button>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
            {
                bool flag1 = questparam.IsDateUnlock(-1L);
                bool flag2 = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p == questparam)) != null;
                ((Selectable)component2).set_interactable(flag1 && flag2);
            }
            DataSource.Bind <QuestParam>(gameObject, questparam);
            gameObject.get_transform().SetParent((Transform)this.QuestListParent, false);
            gameObject.SetActive(true);
        }
Ejemplo n.º 5
0
        private void CreateStoryList()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object)MonoSingleton <GameManager> .GetInstanceDirect(), (UnityEngine.Object)null))
            {
                return;
            }
            List <QuestParam> collaboSkillQuests = CollaboSkillQuestList.GetCollaboSkillQuests(this.CurrentUnit1, this.CurrentUnit2);

            if (collaboSkillQuests == null)
            {
                DebugUtility.LogError(string.Format("連携スキルクエストが見つかりません:{0} × {1}", (object)this.CurrentUnit1.UnitParam.iname, (object)this.CurrentUnit2.UnitParam.iname));
            }
            else
            {
                QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
                for (int index = 0; index < collaboSkillQuests.Count; ++index)
                {
                    QuestParam questParam = collaboSkillQuests[index];
                    bool       flag1      = questParam.IsDateUnlock(-1L);
                    bool       flag2      = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p == questParam)) != null;
                    bool       flag3      = questParam.state == QuestStates.Cleared;
                    bool       flag4      = flag1 && flag2 && !flag3;
                    GameObject gameObject;
                    if (flag2 || flag3)
                    {
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.StoryQuestItemTemplate);
                        ((Selectable)gameObject.GetComponent <Button>()).set_interactable(flag4);
                    }
                    else
                    {
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.StoryQuestDisableItemTemplate);
                    }
                    gameObject.SetActive(true);
                    gameObject.get_transform().SetParent(this.QuestList, false);
                    DataSource.Bind <QuestParam>(gameObject, questParam);
                    CharacterQuestListItem component1 = (CharacterQuestListItem)gameObject.GetComponent <CharacterQuestListItem>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
                    {
                        component1.SetUp(this.CurrentUnit1, this.CurrentUnit2, questParam);
                    }
                    ListItemEvents component2 = (ListItemEvents)gameObject.GetComponent <ListItemEvents>();
                    component2.OnSelect      = new ListItemEvents.ListItemEvent(this.OnQuestSelect);
                    component2.OnOpenDetail  = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail);
                    component2.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail);
                    this.mStoryQuestListItems.Add(gameObject);
                }
            }
        }
Ejemplo n.º 6
0
        private void OnMultiTowerSelect(GameObject go)
        {
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(go, (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            long serverTime = Network.GetServerTime();

            if (dataOfClass.IsJigen && !dataOfClass.IsDateUnlock(serverTime))
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                GlobalVars.SelectedMultiTowerID = dataOfClass.iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 201);
            }
        }
Ejemplo n.º 7
0
 private void OnQuestSelect(QuestParam quest)
 {
     if (quest == null)
     {
         DebugUtility.LogWarning("UnitTobiraEnhanceWindow.cs => OnQuestSelect():quest is Null Reference!");
     }
     else if (!quest.IsDateUnlock(-1L))
     {
         UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.DISABLE_QUEST_DATE_UNLOCK"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
     }
     else if (Array.Find <QuestParam>(MonoSingleton <GameManager> .GetInstanceDirect().Player.AvailableQuests, (Predicate <QuestParam>)(p => p.iname == quest.iname)) == null)
     {
         UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.DISABLE_QUEST_CHALLENGE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
     }
     else
     {
         GlobalVars.SelectedQuestID = quest.iname;
         FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
     }
 }
        private void OnQuestSelect(SRPG_Button button)
        {
            QuestParam quest = DataSource.FindDataOfClass <QuestParam>(this.mGainedQuests[this.mGainedQuests.IndexOf(((Component)button).get_gameObject())], (QuestParam)null);

            if (quest == null)
            {
                return;
            }
            if (!quest.IsDateUnlock(-1L))
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.DISABLE_QUEST_DATE_UNLOCK"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else if (Array.Find <QuestParam>(MonoSingleton <GameManager> .Instance.Player.AvailableQuests, (Predicate <QuestParam>)(p => p == quest)) == null)
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.DISABLE_QUEST_CHALLENGE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                GlobalVars.SelectedQuestID = quest.iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
            }
        }
        private void RefreshItems()
        {
            Transform transform  = ((Component)this).get_transform();
            DateTime  serverTime = TimeManager.ServerTime;

            for (int index = transform.get_childCount() - 1; index >= 0; --index)
            {
                Transform child = transform.GetChild(index);
                if (!Object.op_Equality((Object)child, (Object)null) && ((Component)child).get_gameObject().get_activeSelf())
                {
                    Object.DestroyImmediate((Object)((Component)child).get_gameObject());
                }
            }
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null))
            {
                return;
            }
            List <ChapterParam> chapterParamList = new List <ChapterParam>();

            for (int index = 0; index < MonoSingleton <GameManager> .Instance.Quests.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                QuestListV2_MultiPlayCategory.\u003CRefreshItems\u003Ec__AnonStorey267 itemsCAnonStorey267 = new QuestListV2_MultiPlayCategory.\u003CRefreshItems\u003Ec__AnonStorey267();
                QuestParam quest = MonoSingleton <GameManager> .Instance.Quests[index];
                if (quest != null && quest.type == QuestTypes.Multi && (quest.IsMultiEvent == GlobalVars.SelectedMultiPlayQuestIsEvent && quest.IsMultiVersus == (GlobalVars.SelectedMultiPlayRoomType == JSON_MyPhotonRoomParam.EType.VERSUS)) && quest.IsDateUnlock(-1L))
                {
                    // ISSUE: reference to a compiler-generated field
                    itemsCAnonStorey267.area = MonoSingleton <GameManager> .Instance.FindArea(quest.ChapterID);

                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated method
                    if (itemsCAnonStorey267.area != null && itemsCAnonStorey267.area.IsAvailable(serverTime) && chapterParamList.Find(new Predicate <ChapterParam>(itemsCAnonStorey267.\u003C\u003Em__2CA)) == null)
                    {
                        // ISSUE: reference to a compiler-generated field
                        chapterParamList.Add(itemsCAnonStorey267.area);
                    }
                }
            }
            for (int index = 0; index < chapterParamList.Count; ++index)
            {
                ListItemEvents listItemEvents1 = (ListItemEvents)null;
                if (!string.IsNullOrEmpty(chapterParamList[index].prefabPath))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("QuestChapters/");
                    stringBuilder.Append(chapterParamList[index].prefabPath);
                    listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString());
                }
                if (Object.op_Equality((Object)listItemEvents1, (Object)null))
                {
                    listItemEvents1 = this.ItemTemplate;
                }
                ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                DataSource.Bind <ChapterParam>(((Component)listItemEvents2).get_gameObject(), chapterParamList[index]);
                listItemEvents2.OnSelect      = new ListItemEvents.ListItemEvent(this.OnSelectItem);
                listItemEvents2.OnOpenDetail  = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail);
                listItemEvents2.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail);
                Transform child1 = ((Component)listItemEvents2).get_transform().FindChild("bg");
                if (Object.op_Inequality((Object)child1, (Object)null))
                {
                    Transform child2 = child1.FindChild("timer_base");
                    if (Object.op_Inequality((Object)child2, (Object)null) && chapterParamList[index].end <= 0L)
                    {
                        ((Component)child2).get_gameObject().SetActive(false);
                    }
                }
                ((Component)listItemEvents2).get_transform().SetParent(transform, false);
                ((Component)listItemEvents2).get_gameObject().SetActive(true);
            }
            if (!this.isQuestFilter)
            {
                return;
            }
            this.isScaledDown = false;
            this.ScaleDownBanners();
        }
Ejemplo n.º 10
0
 private bool IsAvailableQuest(QuestParam questParam, long currentTime)
 {
     return(!string.IsNullOrEmpty(questParam.ChapterID) && !questParam.IsMulti && questParam.IsDateUnlock(currentTime));
 }
Ejemplo n.º 11
0
        private BannerParam[] makeValidBannerParams()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            BannerParam[] banners = instance.MasterParam.Banners;
            if (banners == null)
            {
                return(new BannerParam[0]);
            }
            List <BannerParam> bannerParamList = new List <BannerParam>();

            GachaParam[] gachas          = instance.Gachas;
            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            QuestParam   questParam1     = (QuestParam)null;
            QuestParam   lastStoryQuest  = instance.Player.FindLastStoryQuest();
            long         serverTime      = Network.GetServerTime();
            DateTime     now             = TimeManager.FromUnixTime(serverTime);

            for (int index = 0; index < banners.Length; ++index)
            {
                BannerParam banner = banners[index];
                if (!string.IsNullOrEmpty(banner.banner) && bannerParamList.FindIndex((Predicate <BannerParam>)(p => p.iname == banner.iname)) == -1 && banner.IsHomeBanner)
                {
                    if (banner.type == BannerType.shop)
                    {
                        if (instance.IsLimitedShopOpen)
                        {
                            if (instance.LimitedShopList != null && !string.IsNullOrEmpty(banner.sval))
                            {
                                JSON_ShopListArray.Shops shops = Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, (Predicate <JSON_ShopListArray.Shops>)(p => p.gname == banner.sval));
                                if (shops != null)
                                {
                                    banner.begin_at = TimeManager.FromUnixTime(shops.start).ToString();
                                    banner.end_at   = TimeManager.FromUnixTime(shops.end).ToString();
                                    if (!banner.IsAvailablePeriod(now))
                                    {
                                        continue;
                                    }
                                }
                                else
                                {
                                    continue;
                                }
                            }
                            else if (!banner.IsAvailablePeriod(now))
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.storyQuest)
                    {
                        if (lastStoryQuest != null)
                        {
                            if (string.IsNullOrEmpty(banner.sval))
                            {
                                questParam1 = lastStoryQuest;
                                if (!banner.IsAvailablePeriod(now))
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == banner.sval));
                                if (questParam2 == null || questParam2.iname != lastStoryQuest.iname && questParam2.state == QuestStates.New)
                                {
                                    questParam2 = lastStoryQuest;
                                }
                                if (!questParam2.IsDateUnlock(serverTime))
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.eventQuest || banner.type == BannerType.multiQuest)
                    {
                        if (!string.IsNullOrEmpty(banner.sval))
                        {
                            QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == banner.sval));
                            if (questParam2 == null || !questParam2.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                        else if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.gacha)
                    {
                        if (!string.IsNullOrEmpty(banner.sval))
                        {
                            GachaParam gachaParam = Array.Find <GachaParam>(gachas, (Predicate <GachaParam>)(p => p.iname == banner.sval));
                            if (gachaParam != null)
                            {
                                banner.begin_at = TimeManager.FromUnixTime(gachaParam.startat).ToString();
                                banner.end_at   = TimeManager.FromUnixTime(gachaParam.endat).ToString();
                                if (!banner.IsAvailablePeriod(now))
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.url)
                    {
                        if (string.IsNullOrEmpty(banner.sval) || !banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.towerQuest)
                    {
                        if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.arena)
                    {
                        if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.pvp)
                    {
                        if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.ordealQuest)
                    {
                        if (!string.IsNullOrEmpty(banner.sval))
                        {
                            QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == banner.sval));
                            if (questParam2 == null || !questParam2.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                        else if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    bannerParamList.Add(banner);
                }
            }
            for (int index1 = 0; index1 < bannerParamList.Count - 1; ++index1)
            {
                for (int index2 = index1 + 1; index2 < bannerParamList.Count; ++index2)
                {
                    if (bannerParamList[index1].priority > bannerParamList[index2].priority)
                    {
                        BannerParam bannerParam = bannerParamList[index1];
                        bannerParamList[index1] = bannerParamList[index2];
                        bannerParamList[index2] = bannerParam;
                    }
                }
            }
            return(bannerParamList.ToArray());
        }
        private void RefreshItems(QuestListV2_MultiPlayCategory.DISPLAY_QUEST_TYPE dispMode)
        {
            Transform transform  = ((Component)this).get_transform();
            DateTime  serverTime = TimeManager.ServerTime;

            for (int index = transform.get_childCount() - 1; index >= 0; --index)
            {
                Transform child = transform.GetChild(index);
                if (!UnityEngine.Object.op_Equality((UnityEngine.Object)child, (UnityEngine.Object)null) && ((Component)child).get_gameObject().get_activeSelf())
                {
                    UnityEngine.Object.DestroyImmediate((UnityEngine.Object)((Component)child).get_gameObject());
                }
            }
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            List <ChapterParam> chapterParamList = new List <ChapterParam>();

            for (int index = 0; index < MonoSingleton <GameManager> .Instance.Quests.Length; ++index)
            {
                QuestParam quest = MonoSingleton <GameManager> .Instance.Quests[index];
                if (quest != null && (quest.type == QuestTypes.Multi || quest.IsMultiAreaQuest) && (quest.IsMultiEvent == GlobalVars.SelectedMultiPlayQuestIsEvent && quest.IsMultiVersus == (GlobalVars.SelectedMultiPlayRoomType == JSON_MyPhotonRoomParam.EType.VERSUS) && (!quest.IsMultiAreaQuest || dispMode == QuestListV2_MultiPlayCategory.DISPLAY_QUEST_TYPE.WithGps)) && ((!quest.IsMultiAreaQuest || quest.gps_enable) && quest.IsDateUnlock(-1L)))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea(quest.ChapterID);

                    if (area != null && area.IsAvailable(serverTime) && chapterParamList.Find((Predicate <ChapterParam>)(a => a.iname.Equals(area.iname))) == null)
                    {
                        chapterParamList.Add(area);
                    }
                }
            }
            Dictionary <string, int> indexList = new Dictionary <string, int>();

            for (int index = 0; index < chapterParamList.Count; ++index)
            {
                indexList.Add(chapterParamList[index].iname, index);
            }
            chapterParamList.Sort((Comparison <ChapterParam>)((x, y) =>
            {
                bool flag1 = x.IsMultiGpsQuest();
                bool flag2 = y.IsMultiGpsQuest();
                if (flag1 && !flag2)
                {
                    return(-1);
                }
                if (!flag1 && flag2)
                {
                    return(1);
                }
                if (!indexList.ContainsKey(x.iname) || !indexList.ContainsKey(y.iname))
                {
                    return(0);
                }
                return(indexList[x.iname] - indexList[y.iname]);
            }));
            for (int index = 0; index < chapterParamList.Count; ++index)
            {
                ListItemEvents listItemEvents1 = (ListItemEvents)null;
                if (!string.IsNullOrEmpty(chapterParamList[index].prefabPath))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("QuestChapters/");
                    stringBuilder.Append(chapterParamList[index].prefabPath);
                    listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString());
                }
                if (UnityEngine.Object.op_Equality((UnityEngine.Object)listItemEvents1, (UnityEngine.Object)null))
                {
                    listItemEvents1 = this.ItemTemplate;
                }
                ListItemEvents listItemEvents2 = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                DataSource.Bind <ChapterParam>(((Component)listItemEvents2).get_gameObject(), chapterParamList[index]);
                listItemEvents2.OnSelect      = new ListItemEvents.ListItemEvent(this.OnSelectItem);
                listItemEvents2.OnOpenDetail  = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail);
                listItemEvents2.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail);
                Transform child1 = ((Component)listItemEvents2).get_transform().FindChild("bg");
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child1, (UnityEngine.Object)null))
                {
                    Transform child2 = child1.FindChild("timer_base");
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child2, (UnityEngine.Object)null) && chapterParamList[index].end <= 0L)
                    {
                        ((Component)child2).get_gameObject().SetActive(false);
                    }
                }
                ((Component)listItemEvents2).get_transform().SetParent(transform, false);
                ((Component)listItemEvents2).get_gameObject().SetActive(true);
            }
        }
Ejemplo n.º 13
0
        public static BannerParam[] MakeValidBannerParams(bool _is_home_banner = true)
        {
            List <BannerParam> bannerParamList = new List <BannerParam>();
            GameManager        instance        = MonoSingleton <GameManager> .Instance;

            BannerParam[] banners = instance.MasterParam.Banners;
            if (banners == null)
            {
                DebugUtility.LogError("バナーの設定がありません、有効なバナーを1つ以上設定してください");
                return((BannerParam[])null);
            }
            QuestParam lastStoryQuest = instance.Player.FindLastStoryQuest();

            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            DateTime     now             = TimeManager.FromUnixTime(serverTime);

            for (int index = 0; index < banners.Length; ++index)
            {
                BannerParam param = banners[index];
                bool        flag  = true;
                if (param != null && !string.IsNullOrEmpty(param.banner) && bannerParamList.FindIndex((Predicate <BannerParam>)(p => p.iname == param.iname)) == -1 && (!_is_home_banner || param.IsHomeBanner))
                {
                    if (param.type == BannerType.shop)
                    {
                        if (instance.IsLimitedShopOpen)
                        {
                            if (instance.LimitedShopList != null && !string.IsNullOrEmpty(param.sval))
                            {
                                JSON_ShopListArray.Shops shops = Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, (Predicate <JSON_ShopListArray.Shops>)(p => p.gname == param.sval));
                                if (shops != null)
                                {
                                    param.begin_at = TimeManager.FromUnixTime(shops.start).ToString();
                                    param.end_at   = TimeManager.FromUnixTime(shops.end).ToString();
                                }
                                else
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (param.type == BannerType.storyQuest)
                    {
                        flag = false;
                        if (lastStoryQuest != null)
                        {
                            QuestParam questParam;
                            if (string.IsNullOrEmpty(param.sval))
                            {
                                questParam = lastStoryQuest;
                            }
                            else
                            {
                                questParam = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == param.sval));
                                if (questParam == null || questParam.iname != lastStoryQuest.iname && questParam.state == QuestStates.New)
                                {
                                    questParam = lastStoryQuest;
                                }
                            }
                            if (!questParam.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (param.type == BannerType.eventQuest || param.type == BannerType.multiQuest)
                    {
                        if (!string.IsNullOrEmpty(param.sval))
                        {
                            QuestParam questParam = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == param.sval));
                            if (questParam == null || !questParam.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                    }
                    else if (param.type != BannerType.towerQuest && param.type != BannerType.gacha)
                    {
                        if (param.type == BannerType.url)
                        {
                            if (string.IsNullOrEmpty(param.sval))
                            {
                                continue;
                            }
                        }
                        else if (param.type == BannerType.arena || param.type == BannerType.pvp || param.type != BannerType.ordealQuest)
                        {
                            ;
                        }
                    }
                    if (!flag || param.IsAvailablePeriod(now))
                    {
                        bannerParamList.Add(param);
                    }
                }
            }
            bannerParamList.Sort((Comparison <BannerParam>)((a, b) => a.priority - b.priority));
            return(bannerParamList.ToArray());
        }
Ejemplo n.º 14
0
        private void RefreshItems()
        {
            Transform transform = ((Component)this).get_transform();

            for (int index = transform.get_childCount() - 1; index >= 0; --index)
            {
                Transform child = transform.GetChild(index);
                if (!Object.op_Equality((Object)child, (Object)null) && ((Component)child).get_gameObject().get_activeSelf())
                {
                    Object.DestroyImmediate((Object)((Component)child).get_gameObject());
                }
            }
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null))
            {
                return;
            }
            for (int index = 0; index < MonoSingleton <GameManager> .Instance.Quests.Length; ++index)
            {
                QuestParam quest = MonoSingleton <GameManager> .Instance.Quests[index];
                if (quest != null && quest.type == QuestTypes.Multi && (quest.IsMultiEvent == GlobalVars.SelectedMultiPlayQuestIsEvent && !string.IsNullOrEmpty(quest.ChapterID)) && (quest.ChapterID.Equals(GlobalVars.SelectedMultiPlayArea) && quest.IsDateUnlock(-1L)))
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    ((Object)gameObject).set_hideFlags((HideFlags)52);
                    DataSource.Bind <QuestParam>(gameObject, quest);
                    ListItemEvents component = (ListItemEvents)gameObject.GetComponent <ListItemEvents>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.OnSelect      = new ListItemEvents.ListItemEvent(this.OnSelectItem);
                        component.OnOpenDetail  = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail);
                        component.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail);
                    }
                    gameObject.get_transform().SetParent(transform, false);
                    gameObject.get_gameObject().SetActive(true);
                }
            }
        }
Ejemplo n.º 15
0
        private BannerParam[] makeValidBannerParams()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            BannerParam[] banners = instance.MasterParam.Banners;
            if (banners == null)
            {
                return(new BannerParam[0]);
            }
            List <BannerParam> bannerParamList = new List <BannerParam>();

            GachaParam[] gachas          = instance.Gachas;
            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            QuestParam   questParam1     = (QuestParam)null;
            QuestParam   lastStoryQuest  = instance.Player.FindLastStoryQuest();
            long         serverTime      = Network.GetServerTime();
            DateTime     now             = TimeManager.FromUnixTime(serverTime);

            for (int index = 0; index < banners.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                EventBannerScroll.\u003CmakeValidBannerParams\u003Ec__AnonStorey326 paramsCAnonStorey326 = new EventBannerScroll.\u003CmakeValidBannerParams\u003Ec__AnonStorey326();
                // ISSUE: reference to a compiler-generated field
                paramsCAnonStorey326.banner = banners[index];
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                if (!string.IsNullOrEmpty(paramsCAnonStorey326.banner.banner) && bannerParamList.FindIndex(new Predicate <BannerParam>(paramsCAnonStorey326.\u003C\u003Em__35B)) == -1)
                {
                    // ISSUE: reference to a compiler-generated field
                    if (paramsCAnonStorey326.banner.type == BannerType.shop)
                    {
                        if (instance.IsLimitedShopOpen)
                        {
                            // ISSUE: reference to a compiler-generated field
                            if (instance.LimitedShopList != null && !string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                            {
                                // ISSUE: reference to a compiler-generated method
                                Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, new Predicate <JSON_ShopListArray.Shops>(paramsCAnonStorey326.\u003C\u003Em__35C));
                            }
                            else
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (paramsCAnonStorey326.banner.type == BannerType.storyQuest)
                        {
                            if (lastStoryQuest != null)
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                                {
                                    questParam1 = lastStoryQuest;
                                    // ISSUE: reference to a compiler-generated field
                                    if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                    {
                                        continue;
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey326.\u003C\u003Em__35D));
                                    if (questParam2 == null || questParam2.iname != lastStoryQuest.iname && questParam2.state == QuestStates.New)
                                    {
                                        questParam2 = lastStoryQuest;
                                    }
                                    if (!questParam2.IsDateUnlock(serverTime))
                                    {
                                        continue;
                                    }
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            if (paramsCAnonStorey326.banner.type == BannerType.eventQuest || paramsCAnonStorey326.banner.type == BannerType.multiQuest)
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (!string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey326.\u003C\u003Em__35E));
                                    if (questParam2 == null || !questParam2.IsDateUnlock(serverTime))
                                    {
                                        continue;
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                    {
                                        continue;
                                    }
                                }
                            }
                            else
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (paramsCAnonStorey326.banner.type == BannerType.gacha)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (!string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                                    {
                                        // ISSUE: reference to a compiler-generated method
                                        GachaParam gachaParam = Array.Find <GachaParam>(gachas, new Predicate <GachaParam>(paramsCAnonStorey326.\u003C\u003Em__35F));
                                        if (gachaParam != null)
                                        {
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey326.banner.begin_at = TimeManager.FromUnixTime(gachaParam.startat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey326.banner.end_at = TimeManager.FromUnixTime(gachaParam.endat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                            {
                                                continue;
                                            }
                                        }
                                        else
                                        {
                                            continue;
                                        }
                                    }
                                    else
                                    {
                                        // ISSUE: reference to a compiler-generated field
                                        if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                        {
                                            continue;
                                        }
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (paramsCAnonStorey326.banner.type == BannerType.url)
                                    {
                                        // ISSUE: reference to a compiler-generated field
                                        // ISSUE: reference to a compiler-generated field
                                        if (string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval) || !paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                        {
                                            continue;
                                        }
                                    }
                                    else
                                    {
                                        // ISSUE: reference to a compiler-generated field
                                        // ISSUE: reference to a compiler-generated field
                                        if (paramsCAnonStorey326.banner.type == BannerType.towerQuest && !paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                        {
                                            continue;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    // ISSUE: reference to a compiler-generated field
                    bannerParamList.Add(paramsCAnonStorey326.banner);
                }
            }
            for (int index1 = 0; index1 < bannerParamList.Count - 1; ++index1)
            {
                for (int index2 = index1 + 1; index2 < bannerParamList.Count; ++index2)
                {
                    if (bannerParamList[index1].priority > bannerParamList[index2].priority)
                    {
                        BannerParam bannerParam = bannerParamList[index1];
                        bannerParamList[index1] = bannerParamList[index2];
                        bannerParamList[index2] = bannerParam;
                    }
                }
            }
            return(bannerParamList.ToArray());
        }
Ejemplo n.º 16
0
        private bool RefreshRankingQuests()
        {
            List <RankingQuestParam> rankingQuesstParams = MonoSingleton <GameManager> .Instance.AvailableRankingQuesstParams;
            List <QuestParam>        questParamList      = new List <QuestParam>();

            for (int index = 0; index < rankingQuesstParams.Count; ++index)
            {
                QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(rankingQuesstParams[index].iname);

                if (quest != null && questParamList.Find((Predicate <QuestParam>)(q => q.iname == quest.iname)) == null)
                {
                    questParamList.Add(quest);
                }
            }
            this.mQuests.Clear();
            for (int index = 0; index < questParamList.Count; ++index)
            {
                QuestParam questParam = questParamList[index];
                if (!questParamList[index].IsMulti && questParam.type != QuestTypes.Gps && (questParam.IsDateUnlock(-1L) && questParam.IsQuestCondition()))
                {
                    this.mQuests.Add(questParam);
                }
            }
            this.RefreshChapterTimer();
            return(this.mQuests.Count > 0);
        }
Ejemplo n.º 17
0
        private void RefreshQuests()
        {
            this.mCurrentChapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            this.mQuests.Clear();
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            for (int index = 0; index < availableQuests.Length; ++index)
            {
                QuestParam questParam = availableQuests[index];
                if (!availableQuests[index].IsMulti && (this.ShowAllQuests || this.mCurrentChapter != null && !(this.mCurrentChapter.iname != questParam.ChapterID)) && questParam.IsDateUnlock(-1L))
                {
                    this.mQuests.Add(questParam);
                }
            }
            this.RefreshChapterTimer();
        }
Ejemplo n.º 18
0
        private void OnSelectItem(GameObject go)
        {
            if (Object.op_Inequality((Object)this.ScrollRect, (Object)null) && this.ListID != 0)
            {
                QuestListV2.mScrollPosCache[this.ListID] = this.ScrollRect.get_verticalNormalizedPosition();
            }
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(go, (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (dataOfClass.IsKeyQuest && !dataOfClass.IsKeyUnlock(-1L))
            {
                if (dataOfClass.Chapter != null && dataOfClass.Chapter.CheckHasKeyItem() && dataOfClass.IsDateUnlock(-1L))
                {
                    GlobalVars.KeyQuestTimeOver = true;
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 102);
                }
                else
                {
                    UIUtility.SystemMessage(LocalizedText.Get("sys.KEYQUEST_UNLOCK"), LocalizedText.Get("sys.KEYQUEST_AVAILABLE_CAUTION"), new UIUtility.DialogResultEvent(this.OnCloseKeyQuest), (GameObject)null, true, -1);
                }
            }
            else
            {
                GlobalVars.SelectedQuestID = dataOfClass.iname;
                GlobalVars.LastQuestState.Set(dataOfClass.state);
                if (dataOfClass.IsScenario)
                {
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
                }
                else
                {
                    if ((int)dataOfClass.aplv > MonoSingleton <GameManager> .Instance.Player.Lv)
                    {
                        NotifyList.Push(LocalizedText.Get("sys.QUEST_AP_CONDITION", new object[1]
                        {
                            (object)dataOfClass.aplv
                        }));
                    }
                    FlowNode_OnQuestSelect objectOfType = (FlowNode_OnQuestSelect)Object.FindObjectOfType <FlowNode_OnQuestSelect>();
                    if (!Object.op_Inequality((Object)objectOfType, (Object)null))
                    {
                        return;
                    }
                    objectOfType.Selected();
                }
            }
        }
Ejemplo n.º 19
0
        private bool RefreshRankingQuests()
        {
            List <RankingQuestParam> rankingQuesstParams = MonoSingleton <GameManager> .Instance.AvailableRankingQuesstParams;
            List <QuestParam>        questParamList      = new List <QuestParam>();

            for (int index = 0; index < rankingQuesstParams.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                QuestListV2.\u003CRefreshRankingQuests\u003Ec__AnonStorey36C questsCAnonStorey36C = new QuestListV2.\u003CRefreshRankingQuests\u003Ec__AnonStorey36C();
                // ISSUE: reference to a compiler-generated field
                questsCAnonStorey36C.quest = MonoSingleton <GameManager> .Instance.FindQuest(rankingQuesstParams[index].iname);

                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                if (questsCAnonStorey36C.quest != null && questParamList.Find(new Predicate <QuestParam>(questsCAnonStorey36C.\u003C\u003Em__3EF)) == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    questParamList.Add(questsCAnonStorey36C.quest);
                }
            }
            this.mQuests.Clear();
            for (int index = 0; index < questParamList.Count; ++index)
            {
                QuestParam questParam = questParamList[index];
                if (!questParamList[index].IsMulti && questParam.type != QuestTypes.Gps && (questParam.IsDateUnlock(-1L) && questParam.IsQuestCondition()))
                {
                    this.mQuests.Add(questParam);
                }
            }
            this.RefreshChapterTimer();
            return(this.mQuests.Count > 0);
        }