Beispiel #1
0
 protected override void Start()
 {
     base.Start();
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null) && this.ItemTemplate.get_gameObject().get_activeInHierarchy())
     {
         this.ItemTemplate.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SpecialQuestItem, (UnityEngine.Object)null) && this.SpecialQuestItem.get_gameObject().get_activeInHierarchy())
     {
         this.SpecialQuestItem.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ExtraQuestItem, (UnityEngine.Object)null) && this.ExtraQuestItem.get_gameObject().get_activeInHierarchy())
     {
         this.ExtraQuestItem.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DetailTemplate, (UnityEngine.Object)null) && this.DetailTemplate.get_gameObject().get_activeInHierarchy())
     {
         this.DetailTemplate.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ScenarioQuestItem, (UnityEngine.Object)null) && this.ScenarioQuestItem.get_gameObject().get_activeInHierarchy())
     {
         this.ScenarioQuestItem.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.EliteQuestItem, (UnityEngine.Object)null) && this.EliteQuestItem.get_gameObject().get_activeInHierarchy())
     {
         this.EliteQuestItem.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.EliteQuestDisAbleItem, (UnityEngine.Object)null) && this.EliteQuestDisAbleItem.get_gameObject().get_activeInHierarchy())
     {
         this.EliteQuestDisAbleItem.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.StoryExtraQuestItem, (UnityEngine.Object)null) && this.StoryExtraQuestItem.get_gameObject().get_activeInHierarchy())
     {
         this.StoryExtraQuestItem.SetActive(false);
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.StoryExtraQuestDisableItem, (UnityEngine.Object)null) && this.StoryExtraQuestDisableItem.get_gameObject().get_activeInHierarchy())
     {
         this.StoryExtraQuestDisableItem.SetActive(false);
     }
     if (this.RefreshOnStart)
     {
         this.RefreshQuests();
         this.RefreshItems();
         GlobalVars.QuestDifficulty = QuestDifficulties.Normal;
         ChapterParam mCurrentChapter = this.mCurrentChapter;
         if (mCurrentChapter != null && mCurrentChapter.IsKeyQuest() && !mCurrentChapter.IsKeyUnlock(Network.GetServerTime()))
         {
             if (mCurrentChapter.CheckHasKeyItem())
             {
                 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);
             }
         }
     }
     MonoSingleton <GameManager> .Instance.OnPlayerLvChange += new GameManager.PlayerLvChangeEvent(this.RefreshItems);
 }
Beispiel #2
0
        private void OnItemSelect(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            int          num1            = 0;
            int          num2            = 0;

            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].ChapterID == dataOfClass.iname && !availableQuests[index].IsMulti)
                {
                    ++num1;
                    if (availableQuests[index].IsJigen && !availableQuests[index].IsDateUnlock(serverTime))
                    {
                        ++num2;
                    }
                }
            }
            if (num1 > 0 && num1 == num2)
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                GlobalVars.SelectedChapter.Set(dataOfClass.iname);
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
            }
        }
Beispiel #3
0
        private void RefreshChapterTimer()
        {
            if (!Object.op_Inequality((Object)this.ChapterTimer, (Object)null))
            {
                return;
            }
            bool flag = false;

            if (this.mCurrentChapter != null)
            {
                ChapterParam mCurrentChapter = this.mCurrentChapter;
                if (mCurrentChapter != null)
                {
                    DataSource.Bind <ChapterParam>(this.ChapterTimer, mCurrentChapter);
                    switch (mCurrentChapter.GetKeyQuestType())
                    {
                    case KeyQuestTypes.Timer:
                        flag = mCurrentChapter.key_end > 0L;
                        break;

                    case KeyQuestTypes.Count:
                        flag = false;
                        break;

                    default:
                        flag = mCurrentChapter.end > 0L;
                        break;
                    }
                }
            }
            this.ChapterTimer.SetActive(flag);
            GameParameter.UpdateAll(this.ChapterTimer);
        }
        private void EnterChapter(bool enter)
        {
            this.leftButton.SetActive(enter);
            this.rightButton.SetActive(enter);
            this.scrollRect.set_horizontal(enter);
            if (this.currentSectionID >= this.mItems.Count)
            {
                return;
            }
            SGWorldBannerItem component = (SGWorldBannerItem)((Component)this.mItems[this.currentSectionID]).GetComponent <SGWorldBannerItem>();

            if (!Object.op_Inequality((Object)component, (Object)null))
            {
                return;
            }
            if (!enter)
            {
                ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                if (area == null)
                {
                    return;
                }
                component.SetChapterText(area.name);
            }
            else
            {
                component.SetChapterText(string.Empty);
            }
        }
Beispiel #5
0
        private bool ChapterContainsPlayableQuest(ChapterParam chapter, ChapterParam[] allChapters, QuestParam[] availableQuests, long currentTime)
        {
            bool flag = false;

            for (int index = 0; index < allChapters.Length; ++index)
            {
                if (allChapters[index].parent == chapter)
                {
                    if (this.ChapterContainsPlayableQuest(allChapters[index], allChapters, availableQuests, currentTime))
                    {
                        return(true);
                    }
                    flag = true;
                }
            }
            if (!flag)
            {
                for (int index = 0; index < availableQuests.Length; ++index)
                {
                    if (availableQuests[index].ChapterID == chapter.iname && !availableQuests[index].IsMulti && availableQuests[index].IsDateUnlock(currentTime))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #6
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);
        }
        public static SectionParam GetHomeWorld()
        {
            GameManager  instance     = MonoSingleton <GameManager> .Instance;
            SectionParam sectionParam = (SectionParam)null;

            if (!string.IsNullOrEmpty((string)GlobalVars.SelectedSection))
            {
                sectionParam = instance.FindWorld((string)GlobalVars.SelectedSection);
                if (sectionParam != null && (string.IsNullOrEmpty(sectionParam.home) || sectionParam.hidden))
                {
                    sectionParam = (SectionParam)null;
                }
            }
            if (sectionParam == null)
            {
                QuestParam lastStoryQuest = instance.Player.FindLastStoryQuest();
                if (lastStoryQuest != null)
                {
                    ChapterParam area = instance.FindArea(lastStoryQuest.ChapterID);
                    if (area != null)
                    {
                        sectionParam = instance.FindWorld(area.section);
                    }
                }
            }
            return(sectionParam);
        }
Beispiel #8
0
        private void RestoreHierarchy()
        {
            ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (area != null)
            {
                this.mEventType = !area.IsKeyQuest() ? EventQuestList.EventQuestTypes.Normal : EventQuestList.EventQuestTypes.Key;
                if (area.parent != null)
                {
                    GlobalVars.SelectedChapter.Set(area.parent.iname);
                }
                else
                {
                    GlobalVars.SelectedChapter.Set((string)null);
                }
            }
            else
            {
                if (string.IsNullOrEmpty((string)GlobalVars.SelectedSection) || !this.IsSectionHidden((string)GlobalVars.SelectedSection))
                {
                    return;
                }
                GlobalVars.SelectedChapter.Set((string)null);
            }
        }
Beispiel #9
0
        private void Start()
        {
            this.Chapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (this.Chapter == null)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            else
            {
                if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null) && this.ItemTemplate.get_activeInHierarchy())
                {
                    this.ItemTemplate.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.Message, (Object)null))
                {
                    string    str       = (string)null;
                    ItemParam itemParam = (ItemParam)null;
                    int       num       = 0;
                    if (this.Chapter.keys.Count > 0)
                    {
                        KeyItem key = this.Chapter.keys[0];
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(key.iname);

                        num = key.num;
                    }
                    KeyQuestTypes keyQuestType     = this.Chapter.GetKeyQuestType();
                    bool          keyQuestTimeOver = GlobalVars.KeyQuestTimeOver;
                    switch (keyQuestType)
                    {
                    case KeyQuestTypes.Timer:
                        if (this.Chapter.keytime != 0L && itemParam != null)
                        {
                            TimeSpan timeSpan = TimeManager.FromUnixTime(this.Chapter.keytime) - TimeManager.FromUnixTime(0L);
                            if (timeSpan.TotalDays >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_D" : "sys.KEYQUEST_TIMEOVER_D", (object)itemParam.name, (object)num, (object)timeSpan.Days);
                                break;
                            }
                            if (timeSpan.TotalHours >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_H" : "sys.KEYQUEST_TIMEOVER_H", (object)itemParam.name, (object)num, (object)timeSpan.Hours);
                                break;
                            }
                            str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_M" : "sys.KEYQUEST_TIMEOVER_M", (object)itemParam.name, (object)num, (object)Mathf.Max(timeSpan.Minutes, 0));
                            break;
                        }
                        break;

                    case KeyQuestTypes.Count:
                        str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_COUNT" : "sys.KEYQUEST_TIMEOVER_COUNT", (object)itemParam.name, (object)num);
                        break;
                    }
                    this.Message.set_text(str);
                }
                this.Refresh();
            }
        }
Beispiel #10
0
        public void UpdateValue()
        {
            this.mEndTime = 0L;
            QuestParam dataOfClass1 = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (dataOfClass1 != null && dataOfClass1.Chapter != null)
            {
                switch (dataOfClass1.Chapter.GetKeyQuestType())
                {
                case KeyQuestTypes.Timer:
                    this.mEndTime = dataOfClass1.Chapter.key_end;
                    break;

                case KeyQuestTypes.Count:
                    this.mEndTime = 0L;
                    break;

                default:
                    this.mEndTime = dataOfClass1.Chapter.end;
                    break;
                }
                this.Refresh();
            }
            else
            {
                ChapterParam dataOfClass2 = DataSource.FindDataOfClass <ChapterParam>(((Component)this).get_gameObject(), (ChapterParam)null);
                if (dataOfClass2 != null)
                {
                    switch (dataOfClass2.GetKeyQuestType())
                    {
                    case KeyQuestTypes.Timer:
                        this.mEndTime = dataOfClass2.key_end;
                        break;

                    case KeyQuestTypes.Count:
                        this.mEndTime = 0L;
                        break;

                    default:
                        this.mEndTime = dataOfClass2.end;
                        break;
                    }
                    this.Refresh();
                }
                else
                {
                    if (dataOfClass1 == null || dataOfClass1.type != QuestTypes.Tower)
                    {
                        return;
                    }
                    this.mEndTime = dataOfClass1.end;
                    this.Refresh();
                }
            }
        }
Beispiel #11
0
 private bool IsChapterChildOf(ChapterParam child, ChapterParam parent)
 {
     for (; child != null; child = child.parent)
     {
         if (child == parent)
         {
             return(true);
         }
     }
     return(false);
 }
        private void OnItemSelect(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            GlobalVars.ReplaySelectedChapter.Set(dataOfClass.iname);
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 12);
        }
Beispiel #13
0
        private void Refresh()
        {
            GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems);
            this.mItems.Clear();
            GameManager         instance = MonoSingleton <GameManager> .Instance;
            ChapterParam        currentChapter;
            List <ChapterParam> availableChapters = this.GetAvailableChapters(instance.Chapters, instance.Player.AvailableQuests, Network.GetServerTime(), out currentChapter);

            this.mCurrentChapter = currentChapter;
            for (int index = 0; index < availableChapters.Count; ++index)
            {
                ChapterParam data = availableChapters[index];
                if (!string.IsNullOrEmpty(data.prefabPath))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("QuestChapters/");
                    stringBuilder.Append(data.prefabPath);
                    ListItemEvents listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString());
                    if (!UnityEngine.Object.op_Equality((UnityEngine.Object)listItemEvents1, (UnityEngine.Object)null))
                    {
                        ListItemEvents listItemEvents2 = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                        foreach (ButtonEvent componentsInChild in (ButtonEvent[])((Component)listItemEvents2).GetComponentsInChildren <ButtonEvent>(true))
                        {
                            componentsInChild.syncEvent = this.ChapterScrollRect;
                        }
                        DataSource.Bind <ChapterParam>(((Component)listItemEvents2).get_gameObject(), data);
                        if (data.quests != null && data.quests.Count > 0)
                        {
                            DataSource.Bind <QuestParam>(((Component)listItemEvents2).get_gameObject(), data.quests[0]);
                        }
                        KeyQuestBanner component = (KeyQuestBanner)((Component)listItemEvents2).get_gameObject().GetComponent <KeyQuestBanner>();
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                        {
                            component.UpdateValue();
                        }
                        ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                        ((Component)listItemEvents2).get_gameObject().SetActive(true);
                        listItemEvents2.OnSelect      = new ListItemEvents.ListItemEvent(this.OnItemSelect);
                        listItemEvents2.OnOpenDetail  = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail);
                        listItemEvents2.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail);
                        this.mItems.Add(listItemEvents2);
                    }
                }
            }
            for (int index = 0; index < this.mItems.Count; ++index)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mItems[index], (UnityEngine.Object)null))
                {
                    ((Component)this.mItems[index]).get_gameObject().get_transform().SetSiblingIndex(index);
                }
            }
            this.ResetScroll();
        }
Beispiel #14
0
        public void Activated(int pinID)
        {
            switch (pinID)
            {
            case 0:
                this.Refresh();
                break;

            case 1:
                WorldMapController instance = WorldMapController.FindInstance(this.WorldMapControllerID);
                if (!Object.op_Inequality((Object)instance, (Object)null))
                {
                    break;
                }
                instance.GotoArea((string)null);
                break;

            case 3:
                GlobalVars.SelectedChapter.Set((string)null);
                this.Refresh();
                break;

            case 4:
                ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                if (area != null)
                {
                    if (area.parent != null)
                    {
                        GlobalVars.SelectedChapter.Set(area.parent.iname);
                    }
                    else
                    {
                        GlobalVars.SelectedChapter.Set((string)null);
                    }
                    this.Refresh();
                    break;
                }
                this.ResetScroll();
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedSection) && this.IsSectionHidden((string)GlobalVars.SelectedSection))
                {
                    GlobalVars.SelectedChapter.Set((string)null);
                    this.Refresh();
                    break;
                }
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 40);
                break;
            }
        }
Beispiel #15
0
        private void RestoreHierarchy()
        {
            ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (area != null)
            {
                this.mTabIndex = (int)area.GetSubQuestType();
                if (area.IsGpsQuest())
                {
                    if (area.parent != null)
                    {
                        if (area.parent.HasGpsQuest())
                        {
                            this.mEventType = EventQuestList.EventQuestTypes.Gps;
                        }
                        else
                        {
                            this.mEventType = EventQuestList.EventQuestTypes.Normal;
                            GlobalVars.SelectedChapter.Set((string)null);
                            return;
                        }
                    }
                    else
                    {
                        this.mEventType = EventQuestList.EventQuestTypes.Normal;
                    }
                }
                else
                {
                    this.mEventType = !area.IsKeyQuest() ? (!area.IsBeginnerQuest() ? EventQuestList.EventQuestTypes.Normal : EventQuestList.EventQuestTypes.Beginner) : EventQuestList.EventQuestTypes.Key;
                }
                if (area.parent != null)
                {
                    GlobalVars.SelectedChapter.Set(area.parent.iname);
                }
                else
                {
                    GlobalVars.SelectedChapter.Set((string)null);
                }
            }
            else
            {
                if (string.IsNullOrEmpty((string)GlobalVars.SelectedSection) || !this.IsSectionHidden((string)GlobalVars.SelectedSection))
                {
                    return;
                }
                GlobalVars.SelectedChapter.Set((string)null);
            }
        }
Beispiel #16
0
        private void OnNodeSelect(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            foreach (ChapterParam chapter in MonoSingleton <GameManager> .Instance.Chapters)
            {
                if (chapter.parent == dataOfClass)
                {
                    GlobalVars.SelectedChapter.Set(dataOfClass.iname);
                    this.Refresh();
                    return;
                }
            }
            this.OnItemSelect(go);
        }
Beispiel #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();
        }
        private void OnSelectItem(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            if (dataOfClass != null)
            {
                GlobalVars.SelectedMultiPlayArea = dataOfClass.iname;
                DebugUtility.Log("Select Play Area:" + GlobalVars.SelectedMultiPlayArea);
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            if (!this.isQuestFilter)
            {
                return;
            }
            this.UpdateSelectedChildren();
        }
Beispiel #19
0
        public override void UpdateValue()
        {
            KeyItem dataOfClass1 = DataSource.FindDataOfClass <KeyItem>(((Component)this).get_gameObject(), (KeyItem)null);

            if (dataOfClass1 != null)
            {
                ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(dataOfClass1.iname);

                if (itemParam != null)
                {
                    ItemData itemDataByItemParam = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(itemParam);

                    int num = itemDataByItemParam == null ? 0 : itemDataByItemParam.Num;
                    if (Object.op_Inequality((Object)this.Icon, (Object)null))
                    {
                        MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.ItemIcon(itemParam));
                    }
                    if (Object.op_Inequality((Object)this.Frame, (Object)null))
                    {
                        this.Frame.set_sprite(GameSettings.Instance.GetItemFrame(itemParam));
                    }
                    if (Object.op_Inequality((Object)this.UseNum, (Object)null))
                    {
                        this.UseNum.set_text(dataOfClass1.num.ToString());
                    }
                    if (Object.op_Inequality((Object)this.Amount, (Object)null))
                    {
                        this.Amount.set_text(num.ToString());
                    }
                    if (Object.op_Inequality((Object)this.Locked, (Object)null))
                    {
                        ChapterParam dataOfClass2 = DataSource.FindDataOfClass <ChapterParam>(((Component)this).get_gameObject(), (ChapterParam)null);
                        this.Locked.SetActive(dataOfClass2 == null || !dataOfClass2.IsKeyQuest() || !dataOfClass2.IsKeyUnlock(Network.GetServerTime()));
                    }
                }
            }
            if (Object.op_Inequality((Object)this.QuestTimer, (Object)null))
            {
                this.QuestTimer.UpdateValue();
            }
            if (!Object.op_Inequality((Object)this.IconRoot, (Object)null) || !Object.op_Inequality((Object)this.Locked, (Object)null))
            {
                return;
            }
            this.IconRoot.SetActive(this.Locked.get_activeSelf());
        }
Beispiel #20
0
        private void OnItemSelect(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            int          num1            = 0;
            int          num2            = 0;

            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].ChapterID == dataOfClass.iname && !availableQuests[index].IsMulti)
                {
                    ++num1;
                    if (availableQuests[index].IsJigen && !availableQuests[index].IsDateUnlock(serverTime))
                    {
                        ++num2;
                    }
                }
            }
            if (num1 > 0 && num1 == num2)
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                if (dataOfClass.quests == null || dataOfClass.quests.Count <= 0)
                {
                    return;
                }
                this.mCurrentQuest         = dataOfClass.quests[0];
                GlobalVars.SelectedQuestID = this.mCurrentQuest.iname;
                DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), this.mCurrentQuest);
                this.ResetMissionButton();
                this.LoadBossData(this.mCurrentQuest);
                this.LoadTeam();
            }
        }
Beispiel #21
0
        private SubQuestTypes GetHighestPrioritySubType()
        {
            ChapterParam[] chapters        = MonoSingleton <GameManager> .Instance.Chapters;
            QuestParam[]   availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long           serverTime      = Network.GetServerTime();
            ChapterParam   currentChapter;

            using (List <ChapterParam> .Enumerator enumerator = this.GetAvailableChapters(EventQuestList.EventQuestTypes.Normal, chapters, availableQuests, (string)GlobalVars.SelectedSection, (string)null, serverTime, out currentChapter).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ChapterParam current = enumerator.Current;
                    if (current.GetSubQuestType() == SubQuestTypes.Special && this.ChapterContainsPlayableQuest(current, chapters, availableQuests, serverTime))
                    {
                        return(SubQuestTypes.Special);
                    }
                }
            }
            return(SubQuestTypes.Limited);
        }
Beispiel #22
0
        private void Start()
        {
            if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
            {
                ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                if (area != null)
                {
                    this.mEventType = !area.IsKeyQuest() ? EventQuestList.EventQuestTypes.Normal : EventQuestList.EventQuestTypes.Key;
                }
            }
            else if (GlobalVars.ReqEventPageListType == GlobalVars.EventQuestListType.KeyQuest)
            {
                GlobalVars.ReqEventPageListType = GlobalVars.EventQuestListType.EventQuest;
                ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters;
                if (chapters != null)
                {
                    for (int index = 0; index < chapters.Length; ++index)
                    {
                        if (chapters[index].IsKeyQuest())
                        {
                            this.mEventType = EventQuestList.EventQuestTypes.Key;
                            break;
                        }
                    }
                }
            }
            if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                this.ItemTemplate.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.Caution, (Object)null))
            {
                this.Caution.SetActive(false);
            }
            if (this.RefreshOnStart)
            {
                this.Refresh(this.mEventType);
            }
            this.RefreshQuestTypeText(this.mEventType);
        }
Beispiel #23
0
        private void OnNodeSelect(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            foreach (ChapterParam chapter in MonoSingleton <GameManager> .Instance.Chapters)
            {
                if (chapter.parent == dataOfClass)
                {
                    if (dataOfClass.IsGpsQuest())
                    {
                        GlobalVars.SelectedChapter.Set(dataOfClass.iname);
                        GlobalEvent.Invoke("GPS_MODE", (object)this);
                        return;
                    }
                    GlobalVars.SelectedChapter.Set(dataOfClass.iname);
                    this.Refresh(this.mEventType);
                    return;
                }
            }
            this.OnItemSelect(go);
        }
        private void UpdateSelectedChildren()
        {
            if (GlobalVars.SelectedMultiPlayArea == null)
            {
                return;
            }
            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))
                {
                    ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(((Component)child).get_gameObject(), (ChapterParam)null);
                    if (dataOfClass != null)
                    {
                        if (dataOfClass.iname != GlobalVars.SelectedMultiPlayArea)
                        {
                            M0         componentInChildren = ((Component)child).GetComponentInChildren <Image>();
                            ColorBlock colors = ((Selectable)((Component)child).GetComponentInChildren <Button>()).get_colors();
                            // ISSUE: explicit reference operation
                            Color disabledColor = ((ColorBlock)@colors).get_disabledColor();
                            ((Graphic)componentInChildren).set_color(disabledColor);
                        }
                        else
                        {
                            M0         componentInChildren = ((Component)child).GetComponentInChildren <Image>();
                            ColorBlock colors = ((Selectable)((Component)child).GetComponentInChildren <Button>()).get_colors();
                            // ISSUE: explicit reference operation
                            Color normalColor = ((ColorBlock)@colors).get_normalColor();
                            ((Graphic)componentInChildren).set_color(normalColor);
                        }
                    }
                }
            }
        }
Beispiel #25
0
        private void Refresh()
        {
            GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems);
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;
            PlayerData  player   = instance.Player;

            SectionParam[] sections    = instance.Sections;
            List <string>  stringList1 = new List <string>();
            List <string>  stringList2 = new List <string>();
            long           serverTime  = Network.GetServerTime();

            QuestParam[] availableQuests = player.AvailableQuests;
            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (!string.IsNullOrEmpty(availableQuests[index].ChapterID) && !stringList1.Contains(availableQuests[index].ChapterID) && (!availableQuests[index].IsMulti && availableQuests[index].IsDateUnlock(serverTime)))
                {
                    stringList1.Add(availableQuests[index].ChapterID);
                }
            }
            for (int index = 0; index < stringList1.Count; ++index)
            {
                ChapterParam area = instance.FindArea(stringList1[index]);
                if (area != null && !stringList2.Contains(area.section))
                {
                    stringList2.Add(area.section);
                }
            }
            for (int index = 0; index < sections.Length; ++index)
            {
                SectionParam sectionParam = sections[index];
                if (sections[index].IsDateUnlock() && stringList2.Contains(sections[index].iname))
                {
                    ListItemEvents listItemEvents1 = (ListItemEvents)null;
                    if (!string.IsNullOrEmpty(sectionParam.prefabPath))
                    {
                        StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                        stringBuilder.Append("QuestSections/");
                        stringBuilder.Append(sectionParam.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 <UIQuestSectionData>(((Component)listItemEvents2).get_gameObject(), new UIQuestSectionData(sections[index]));
                    ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                    ((Component)listItemEvents2).get_gameObject().SetActive(true);
                    listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
                    SGWorldBannerItem component = (SGWorldBannerItem)((Component)listItemEvents2).GetComponent <SGWorldBannerItem>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                        if (area != null && area.section == sections[index].iname)
                        {
                            component.SetChapterText(area.name);
                            this.currentSectionID = index;
                        }
                    }
                    this.mItems.Add(listItemEvents2);
                }
            }
        }
        private void Refresh()
        {
            if (this.sectionName == null)
            {
                this.sectionName = (string)GlobalVars.ReplaySelectedSection;
            }
            else if (this.sectionName.Equals((string)GlobalVars.ReplaySelectedSection))
            {
                return;
            }
            this.sectionName = (string)GlobalVars.ReplaySelectedSection;
            GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems);
            this.mItems.Clear();
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;
            List <ReplayQuestChapterList.ReplayChapterParam> replayChapterParamList = new List <ReplayQuestChapterList.ReplayChapterParam>();

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

            foreach (ChapterParam chapter in instance.Chapters)
            {
                bool flag1 = false;
                bool flag2 = false;
                foreach (QuestParam questParam in availableQuests)
                {
                    if (!(questParam.ChapterID != chapter.iname) && !questParam.IsMulti && questParam.IsReplayDateUnlock(serverTime) && ((!string.IsNullOrEmpty(questParam.event_start) || !string.IsNullOrEmpty(questParam.event_clear)) && (questParam.state == QuestStates.Challenged || questParam.state == QuestStates.Cleared)))
                    {
                        if (questParam.replayLimit && questParam.end > 0L)
                        {
                            flag2 = true;
                        }
                        flag1 = true;
                        break;
                    }
                }
                if (flag1 && (string.IsNullOrEmpty((string)GlobalVars.ReplaySelectedSection) || chapter.section == (string)GlobalVars.ReplaySelectedSection))
                {
                    replayChapterParamList.Add(new ReplayQuestChapterList.ReplayChapterParam()
                    {
                        chapterParam = chapter,
                        replayLimit  = flag2
                    });
                }
            }
            if (this.Descending)
            {
                replayChapterParamList.Reverse();
            }
            using (List <ReplayQuestChapterList.ReplayChapterParam> .Enumerator enumerator = replayChapterParamList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ReplayQuestChapterList.ReplayChapterParam current = enumerator.Current;
                    ChapterParam   chapterParam    = current.chapterParam;
                    ListItemEvents listItemEvents1 = (ListItemEvents)null;
                    if (!string.IsNullOrEmpty(chapterParam.prefabPath))
                    {
                        StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                        stringBuilder.Append("QuestChapters/");
                        stringBuilder.Append(chapterParam.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(), chapterParam);
                    ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                    ((Component)listItemEvents2).get_gameObject().SetActive(true);
                    listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
                    if (chapterParam.end > 0L)
                    {
                        this.SetTimerActive(((Component)listItemEvents2).get_transform(), current.replayLimit);
                    }
                    this.mItems.Add(listItemEvents2);
                }
            }
            if (Object.op_Inequality((Object)this.BackToCategories, (Object)null) && Object.op_Inequality((Object)this.BackToSection, (Object)null))
            {
                bool flag = false;
                foreach (SectionParam section in instance.Sections)
                {
                    if (section.iname == (string)GlobalVars.ReplaySelectedSection)
                    {
                        flag = section.hidden;
                        break;
                    }
                }
                this.BackToCategories.SetActive(flag);
                this.BackToSection.SetActive(!flag);
            }
            if (Object.op_Inequality((Object)this.ScrollRect, (Object)null))
            {
                this.ScrollRect.set_normalizedPosition(Vector2.get_one());
            }
            if (this.mItems.Count > 0)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 10);
            }
            else
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 11);
            }
        }
Beispiel #27
0
        private void Initialize(QuestBookmarkWindow.JSON_Item[] bookmarkItems)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;
            PlayerData  player   = instance.Player;

            SectionParam[] sections    = instance.Sections;
            List <string>  stringList1 = new List <string>();
            List <string>  stringList2 = new List <string>();
            long           serverTime  = Network.GetServerTime();

            foreach (QuestParam availableQuest in player.AvailableQuests)
            {
                if (this.IsAvailableQuest(availableQuest, serverTime) && !stringList1.Contains(availableQuest.ChapterID))
                {
                    stringList1.Add(availableQuest.ChapterID);
                }
            }
            using (List <string> .Enumerator enumerator = stringList1.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string       current = enumerator.Current;
                    ChapterParam area    = instance.FindArea(current);
                    if (area != null && !stringList2.Contains(area.section))
                    {
                        stringList2.Add(area.section);
                    }
                }
            }
            this.mAvailableSections = stringList2.ToArray();
            Dictionary <string, List <QuestParam> > dictionary = new Dictionary <string, List <QuestParam> >();

            foreach (QuestParam questParam in ((IEnumerable <QuestParam>)MonoSingleton <GameManager> .Instance.Quests).Where <QuestParam>((Func <QuestParam, bool>)(q => q.type == QuestTypes.Free)))
            {
                List <QuestParam> questParamList;
                if (!dictionary.TryGetValue(questParam.world, out questParamList))
                {
                    questParamList = new List <QuestParam>();
                    dictionary[questParam.world] = questParamList;
                }
                questParamList.Add(questParam);
            }
            int index1 = 0;

            if (bookmarkItems != null && bookmarkItems.Length > 0)
            {
                foreach (QuestBookmarkWindow.JSON_Item bookmarkItem in bookmarkItems)
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(bookmarkItem.iname);

                    List <QuestParam> itemDropQuestList = QuestDropParam.Instance.GetItemDropQuestList(itemParam, GlobalVars.GetDropTableGeneratedDateTime());
                    this.mBookmarkedPiecesOrigin.Add(new QuestBookmarkWindow.ItemAndQuests()
                    {
                        itemName = itemParam.iname,
                        quests   = itemDropQuestList
                    });
                }
                this.mBookmarkedPieces = this.mBookmarkedPiecesOrigin.ToList <QuestBookmarkWindow.ItemAndQuests>();
            }
            this.mSectionToPieces[this.BookmarkSectionName] = this.mBookmarkedPieces;
            if (index1 < this.ButtonSections.Length)
            {
                DataSource.Bind <string>(((Component)this.ButtonSections[index1]).get_gameObject(), this.BookmarkSectionName);
            }
            int index2;

            for (index2 = index1 + 1; index2 < this.ButtonSections.Length; ++index2)
            {
                if (index2 - 1 < sections.Length)
                {
                    SectionParam sectionParam = sections[index2 - 1];
                    if (sectionParam.IsDateUnlock() && stringList2.Contains(sectionParam.iname))
                    {
                        SRPG_Button buttonSection = this.ButtonSections[index2];
                        DataSource.Bind <string>(((Component)buttonSection).get_gameObject(), sectionParam.iname);
                        ((BookmarkToggleButton)((Component)buttonSection).GetComponent <BookmarkToggleButton>()).EnableShadow(false);
                        List <QuestParam> questParamList1 = dictionary[sectionParam.iname];
                        OrderedDictionary source          = new OrderedDictionary();
                        using (List <QuestParam> .Enumerator enumerator = questParamList1.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                QuestParam        current       = enumerator.Current;
                                ItemParam         hardDropPiece = QuestDropParam.Instance.GetHardDropPiece(current.iname, GlobalVars.GetDropTableGeneratedDateTime());
                                List <QuestParam> questParamList2;
                                if (source.Contains((object)hardDropPiece.iname))
                                {
                                    questParamList2 = source[(object)hardDropPiece.iname] as List <QuestParam>;
                                }
                                else
                                {
                                    questParamList2 = new List <QuestParam>();
                                    source[(object)hardDropPiece.iname] = (object)questParamList2;
                                }
                                questParamList2.Add(current);
                            }
                        }
                        this.mSectionToPieces[sectionParam.iname] = source.Cast <DictionaryEntry>().Select <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>((Func <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>)(kv => new QuestBookmarkWindow.ItemAndQuests()
                        {
                            itemName = kv.Key as string,
                            quests   = kv.Value as List <QuestParam>
                        })).ToList <QuestBookmarkWindow.ItemAndQuests>();
                    }
                    else
                    {
                        ((BookmarkToggleButton)((Component)this.ButtonSections[index2]).GetComponent <BookmarkToggleButton>()).EnableShadow(true);
                    }
                }
                else
                {
                    ((BookmarkToggleButton)((Component)this.ButtonSections[index2]).GetComponent <BookmarkToggleButton>()).EnableShadow(true);
                }
            }
            foreach (SectionParam sectionParam in sections)
            {
                if (sectionParam.IsDateUnlock() && stringList2.Contains(sectionParam.iname) && index2 < this.ButtonSections.Length)
                {
                    DataSource.Bind <string>(((Component)this.ButtonSections[index2]).get_gameObject(), sectionParam.iname);
                    List <QuestParam> questParamList1 = dictionary[sectionParam.iname];
                    OrderedDictionary source          = new OrderedDictionary();
                    using (List <QuestParam> .Enumerator enumerator = questParamList1.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            QuestParam        current       = enumerator.Current;
                            ItemParam         hardDropPiece = QuestDropParam.Instance.GetHardDropPiece(current.iname, GlobalVars.GetDropTableGeneratedDateTime());
                            List <QuestParam> questParamList2;
                            if (source.Contains((object)hardDropPiece.iname))
                            {
                                questParamList2 = source[(object)hardDropPiece.iname] as List <QuestParam>;
                            }
                            else
                            {
                                questParamList2 = new List <QuestParam>();
                                source[(object)hardDropPiece.iname] = (object)questParamList2;
                            }
                            questParamList2.Add(current);
                        }
                    }
                    this.mSectionToPieces[sectionParam.iname] = source.Cast <DictionaryEntry>().Select <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>((Func <DictionaryEntry, QuestBookmarkWindow.ItemAndQuests>)(kv => new QuestBookmarkWindow.ItemAndQuests()
                    {
                        itemName = kv.Key as string,
                        quests   = kv.Value as List <QuestParam>
                    })).ToList <QuestBookmarkWindow.ItemAndQuests>();
                }
            }
            foreach (SRPG_Button buttonSection in this.ButtonSections)
            {
                buttonSection.AddListener(new SRPG_Button.ButtonClickEvent(this.OnSectionSelect));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TitleText, (UnityEngine.Object)null))
            {
                this.TitleText.set_text(LocalizedText.Get(this.BookmarkTitle));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DescriptionText, (UnityEngine.Object)null))
            {
                this.DescriptionText.set_text(LocalizedText.Get(this.BookmarkDescription));
            }
            this.RefreshSection(0);
        }
Beispiel #28
0
        private void Refresh()
        {
            if (this.isRefreshed)
            {
                return;
            }
            this.isRefreshed = true;
            GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems);
            this.mItems.Clear();
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            SectionParam[] sections    = instance.Sections;
            List <string>  stringList1 = new List <string>();
            List <string>  stringList2 = new List <string>();
            long           serverTime  = Network.GetServerTime();

            foreach (QuestParam availableQuest in instance.Player.AvailableQuests)
            {
                if (!string.IsNullOrEmpty(availableQuest.ChapterID) && !availableQuest.IsMulti && (availableQuest.IsReplayDateUnlock(serverTime) && !stringList1.Contains(availableQuest.ChapterID)) && ((!string.IsNullOrEmpty(availableQuest.event_start) || !string.IsNullOrEmpty(availableQuest.event_clear)) && (availableQuest.state == QuestStates.Challenged || availableQuest.state == QuestStates.Cleared)))
                {
                    stringList1.Add(availableQuest.ChapterID);
                }
            }
            for (int index = 0; index < stringList1.Count; ++index)
            {
                ChapterParam area = instance.FindArea(stringList1[index]);
                if (area != null && !stringList2.Contains(area.section) && (area.section != "WD_DAILY" && area.section != "WD_CHARA"))
                {
                    stringList2.Add(area.section);
                }
            }
            for (int index = 0; index < sections.Length; ++index)
            {
                SectionParam sectionParam = sections[index];
                if (stringList2.Contains(sections[index].iname))
                {
                    ListItemEvents listItemEvents1 = (ListItemEvents)null;
                    if (!string.IsNullOrEmpty(sectionParam.prefabPath))
                    {
                        StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                        stringBuilder.Append("QuestSections/");
                        stringBuilder.Append(sectionParam.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 <UIQuestSectionData>(((Component)listItemEvents2).get_gameObject(), new UIQuestSectionData(sections[index]));
                    ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                    ((Component)listItemEvents2).get_gameObject().SetActive(true);
                    listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
                    this.mItems.Add(listItemEvents2);
                }
            }
            if (Object.op_Inequality((Object)this.ScrollRect, (Object)null))
            {
                this.ScrollRect.set_normalizedPosition(Vector2.get_one());
            }
            if (this.mItems.Count > 0)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 10);
            }
            else
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 11);
            }
        }
Beispiel #29
0
        private void Refresh()
        {
            GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems);
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            ChapterParam[]      chapters         = instance.Chapters;
            List <ChapterParam> chapterParamList = new List <ChapterParam>((IEnumerable <ChapterParam>)chapters);

            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            ChapterParam chapterParam    = (ChapterParam)null;

            for (int index = chapterParamList.Count - 1; index >= 0; --index)
            {
                if ((string)GlobalVars.SelectedSection != chapterParamList[index].section)
                {
                    chapterParamList.RemoveAt(index);
                }
            }
            if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
            {
                chapterParam = instance.FindArea((string)GlobalVars.SelectedChapter);
                for (int index = chapterParamList.Count - 1; index >= 0; --index)
                {
                    if (chapterParamList[index].parent == null || chapterParamList[index].parent.iname != (string)GlobalVars.SelectedChapter)
                    {
                        chapterParamList.RemoveAt(index);
                    }
                }
            }
            else
            {
                for (int index = chapterParamList.Count - 1; index >= 0; --index)
                {
                    if (chapterParamList[index].parent != null)
                    {
                        chapterParamList.RemoveAt(index);
                    }
                }
            }
            for (int index = chapterParamList.Count - 1; index >= 0; --index)
            {
                if (!this.ChapterContainsPlayableQuest(chapterParamList[index], chapters, availableQuests, serverTime))
                {
                    chapterParamList.RemoveAt(index);
                }
            }
            List <TowerParam> towerParamList = new List <TowerParam>();

            foreach (TowerParam tower in instance.Towers)
            {
                bool flag = false;
                for (int index = 0; index < availableQuests.Length; ++index)
                {
                    if (availableQuests[index].type == QuestTypes.Tower && availableQuests[index].IsDateUnlock(serverTime))
                    {
                        flag = true;
                        break;
                    }
                }
                if (flag && (string.IsNullOrEmpty((string)GlobalVars.SelectedSection) || "WD_DAILY" == (string)GlobalVars.SelectedSection))
                {
                    towerParamList.Add(tower);
                }
            }
            if (this.Descending)
            {
                chapterParamList.Reverse();
            }
            for (int index = 0; index < towerParamList.Count; ++index)
            {
                TowerParam     data            = towerParamList[index];
                ListItemEvents listItemEvents1 = (ListItemEvents)null;
                if (!string.IsNullOrEmpty(data.prefabPath))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("QuestChapters/");
                    stringBuilder.Append(data.prefabPath);
                    listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString());
                }
                if (Object.op_Equality((Object)listItemEvents1, (Object)null))
                {
                    listItemEvents1 = this.ItemTemplate;
                }
                QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(data.iname);

                ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                DataSource.Bind <TowerParam>(((Component)listItemEvents2).get_gameObject(), data);
                DataSource.Bind <QuestParam>(((Component)listItemEvents2).get_gameObject(), quest);
                ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                ((Component)listItemEvents2).get_gameObject().SetActive(true);
                listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnTowerSelect);
                this.mItems.Add(listItemEvents2);
            }
            for (int index = 0; index < chapterParamList.Count; ++index)
            {
                ChapterParam   data            = chapterParamList[index];
                ListItemEvents listItemEvents1 = (ListItemEvents)null;
                if (!string.IsNullOrEmpty(data.prefabPath))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("QuestChapters/");
                    stringBuilder.Append(data.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(), data);
                ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                ((Component)listItemEvents2).get_gameObject().SetActive(true);
                listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnNodeSelect);
                this.mItems.Add(listItemEvents2);
            }
            if (Object.op_Inequality((Object)this.BackButton, (Object)null))
            {
                if (chapterParam != null)
                {
                    this.BackButton.SetActive(true);
                }
                else if (!string.IsNullOrEmpty((string)GlobalVars.SelectedSection))
                {
                    this.BackButton.SetActive(!this.IsSectionHidden((string)GlobalVars.SelectedSection));
                }
            }
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 50);
        }
Beispiel #30
0
        private List <ChapterParam> GetAvailableChapters(ChapterParam[] allChapters, QuestParam[] questsAvailable, long currentTime, out ChapterParam currentChapter)
        {
            List <ChapterParam> chapterParamList = new List <ChapterParam>();

            currentChapter = (ChapterParam)null;
            foreach (ChapterParam allChapter in allChapters)
            {
                if (allChapter.IsOrdealQuest())
                {
                    chapterParamList.Add(allChapter);
                    if (allChapter.quests[0].state != QuestStates.Cleared)
                    {
                        currentChapter = allChapter;
                    }
                }
            }
            if (currentChapter == null && chapterParamList.Count > 0)
            {
                currentChapter = chapterParamList[0];
            }
            for (int index = chapterParamList.Count - 1; index >= 0; --index)
            {
                if (!this.ChapterContainsPlayableQuest(chapterParamList[index], allChapters, questsAvailable, currentTime))
                {
                    chapterParamList.RemoveAt(index);
                }
            }
            return(chapterParamList);
        }