public void InitMissionList()
        {
            this.m_combatAllyListItem.gameObject.SetActive(false);
            MiniMissionListItem[] componentsInChildren = this.m_availableMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            foreach (MiniMissionListItem miniMissionListItem in componentsInChildren)
            {
                bool flag = true;
                if (PersistentMissionData.missionDictionary.ContainsKey(miniMissionListItem.GetMissionID()))
                {
                    WrapperGarrisonMission mission = PersistentMissionData.missionDictionary[miniMissionListItem.GetMissionID()];
                    if (mission.MissionState == 0)
                    {
                        flag = false;
                        miniMissionListItem.UpdateMechanicPreview(false, mission);
                    }
                }
                if (flag)
                {
                    miniMissionListItem.gameObject.transform.SetParent(null);
                    Object.Destroy(miniMissionListItem.gameObject);
                }
            }
            componentsInChildren = this.m_inProgressMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            foreach (MiniMissionListItem miniMissionListItem2 in componentsInChildren)
            {
                bool flag2 = true;
                if (PersistentMissionData.missionDictionary.ContainsKey(miniMissionListItem2.GetMissionID()) && PersistentMissionData.missionDictionary[miniMissionListItem2.GetMissionID()].MissionState != 0)
                {
                    flag2 = false;
                }
                if (flag2)
                {
                    miniMissionListItem2.gameObject.transform.SetParent(null);
                    Object.Destroy(miniMissionListItem2.gameObject);
                }
            }
            MiniMissionListItem[] componentsInChildren2 = this.m_availableMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            MiniMissionListItem[] componentsInChildren3 = this.m_inProgressMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            foreach (WrapperGarrisonMission mission2 in PersistentMissionData.missionDictionary.Values)
            {
                bool flag3 = false;
                foreach (MiniMissionListItem miniMissionListItem3 in componentsInChildren2)
                {
                    if (miniMissionListItem3.GetMissionID() == mission2.MissionRecID)
                    {
                        flag3 = true;
                        break;
                    }
                }
                if (!flag3)
                {
                    foreach (MiniMissionListItem miniMissionListItem4 in componentsInChildren3)
                    {
                        if (miniMissionListItem4.GetMissionID() == mission2.MissionRecID)
                        {
                            flag3 = true;
                            break;
                        }
                    }
                }
                if (!flag3)
                {
                    GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(mission2.MissionRecID);
                    if (record == null)
                    {
                        Debug.LogWarning("Mission Not Found: ID " + mission2.MissionRecID);
                    }
                    else if ((GARR_FOLLOWER_TYPE)record.GarrFollowerTypeID == GarrisonStatus.GarrisonFollowerType)
                    {
                        if ((record.Flags & 16u) != 0u)
                        {
                            this.m_combatAllyListItem.gameObject.SetActive(true);
                            this.m_combatAllyListItem.UpdateVisuals();
                        }
                        else
                        {
                            MiniMissionListItem miniMissionListItem5 = Object.Instantiate <MiniMissionListItem>(this.m_miniMissionListItemPrefab);
                            if (mission2.MissionState == 0)
                            {
                                miniMissionListItem5.transform.SetParent(this.m_availableMission_listContents.transform, false);
                            }
                            else
                            {
                                miniMissionListItem5.transform.SetParent(this.m_inProgressMission_listContents.transform, false);
                                this.ShowMissionStartedAnim();
                            }
                            miniMissionListItem5.SetMission(mission2);
                        }
                    }
                }
            }
            int num  = 0;
            int num2 = 0;

            PersistentMissionData.GetAvailableAndProgressCounts(ref num2, ref num);
            this.m_availableMissionsTabLabel.text  = StaticDB.GetString("AVAILABLE", null) + " - " + num2;
            this.m_inProgressMissionsTabLabel.text = StaticDB.GetString("IN_PROGRESS", null) + " - " + num;
            this.m_noMissionsAvailableLabel.gameObject.SetActive(num2 == 0);
            this.m_noMissionsInProgressLabel.gameObject.SetActive(num == 0);
        }
示例#2
0
        public void InitMissionList()
        {
            this.m_combatAllyListItem.gameObject.SetActive(false);
            MiniMissionListItem[] componentsInChildren = this.m_availableMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            for (int i = 0; i < (int)componentsInChildren.Length; i++)
            {
                MiniMissionListItem miniMissionListItem = componentsInChildren[i];
                bool flag = true;
                if (PersistentMissionData.missionDictionary.ContainsKey(miniMissionListItem.GetMissionID()))
                {
                    WrapperGarrisonMission item = PersistentMissionData.missionDictionary[miniMissionListItem.GetMissionID()];
                    if (item.MissionState == 0)
                    {
                        flag = false;
                        miniMissionListItem.UpdateMechanicPreview(false, item);
                    }
                }
                if (flag)
                {
                    miniMissionListItem.gameObject.transform.SetParent(null);
                    UnityEngine.Object.Destroy(miniMissionListItem.gameObject);
                }
            }
            MiniMissionListItem[] miniMissionListItemArray = this.m_inProgressMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            for (int j = 0; j < (int)miniMissionListItemArray.Length; j++)
            {
                MiniMissionListItem miniMissionListItem1 = miniMissionListItemArray[j];
                bool flag1 = true;
                if (PersistentMissionData.missionDictionary.ContainsKey(miniMissionListItem1.GetMissionID()) && PersistentMissionData.missionDictionary[miniMissionListItem1.GetMissionID()].MissionState != 0)
                {
                    flag1 = false;
                }
                if (flag1)
                {
                    miniMissionListItem1.gameObject.transform.SetParent(null);
                    UnityEngine.Object.Destroy(miniMissionListItem1.gameObject);
                }
            }
            MiniMissionListItem[] componentsInChildren1     = this.m_availableMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            MiniMissionListItem[] miniMissionListItemArray1 = this.m_inProgressMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
            foreach (WrapperGarrisonMission value in PersistentMissionData.missionDictionary.Values)
            {
                bool flag2 = false;
                MiniMissionListItem[] miniMissionListItemArray2 = componentsInChildren1;
                int num = 0;
                while (num < (int)miniMissionListItemArray2.Length)
                {
                    if (miniMissionListItemArray2[num].GetMissionID() != value.MissionRecID)
                    {
                        num++;
                    }
                    else
                    {
                        flag2 = true;
                        break;
                    }
                }
                if (!flag2)
                {
                    MiniMissionListItem[] miniMissionListItemArray3 = miniMissionListItemArray1;
                    int num1 = 0;
                    while (num1 < (int)miniMissionListItemArray3.Length)
                    {
                        if (miniMissionListItemArray3[num1].GetMissionID() != value.MissionRecID)
                        {
                            num1++;
                        }
                        else
                        {
                            flag2 = true;
                            break;
                        }
                    }
                }
                if (!flag2)
                {
                    GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(value.MissionRecID);
                    if (record == null)
                    {
                        Debug.LogWarning(string.Concat("Mission Not Found: ID ", value.MissionRecID));
                    }
                    else if (record.GarrFollowerTypeID == (uint)GarrisonStatus.GarrisonFollowerType)
                    {
                        if ((record.Flags & 16) == 0)
                        {
                            MiniMissionListItem miniMissionListItem2 = UnityEngine.Object.Instantiate <MiniMissionListItem>(this.m_miniMissionListItemPrefab);
                            if (value.MissionState != 0)
                            {
                                miniMissionListItem2.transform.SetParent(this.m_inProgressMission_listContents.transform, false);
                                this.ShowMissionStartedAnim();
                            }
                            else
                            {
                                miniMissionListItem2.transform.SetParent(this.m_availableMission_listContents.transform, false);
                            }
                            miniMissionListItem2.SetMission(value);
                        }
                        else
                        {
                            this.m_combatAllyListItem.gameObject.SetActive(true);
                            this.m_combatAllyListItem.UpdateVisuals();
                        }
                    }
                }
            }
            int num2 = 0;
            int num3 = 0;

            PersistentMissionData.GetAvailableAndProgressCounts(ref num3, ref num2);
            this.m_availableMissionsTabLabel.text  = string.Concat(StaticDB.GetString("AVAILABLE", null), " - ", num3);
            this.m_inProgressMissionsTabLabel.text = string.Concat(StaticDB.GetString("IN_PROGRESS", null), " - ", num2);
            this.m_noMissionsAvailableLabel.gameObject.SetActive(num3 == 0);
            this.m_noMissionsInProgressLabel.gameObject.SetActive(num2 == 0);
        }