예제 #1
0
    public void HandleBountyInfoUpdated()
    {
        BountySite[] componentsInChildren = this.m_missionAndWordQuestArea.get_transform().GetComponentsInChildren <BountySite>(true);
        BountySite[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            BountySite bountySite = array[i];
            Object.DestroyImmediate(bountySite.get_gameObject());
        }
        IEnumerator enumerator = PersistentBountyData.bountyDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                MobileWorldQuestBounty mobileWorldQuestBounty = (MobileWorldQuestBounty)enumerator.get_Current();
                GameObject             gameObject             = Object.Instantiate <GameObject>(this.m_bountySitePrefab);
                BountySite             component = gameObject.GetComponent <BountySite>();
                component.SetBounty(mobileWorldQuestBounty);
                gameObject.set_name("BountySite " + mobileWorldQuestBounty.QuestID);
                RectTransform component2 = gameObject.GetComponent <RectTransform>();
                gameObject.get_transform().SetParent(this.m_missionAndWordQuestArea.get_transform(), false);
                component2.set_anchorMin(new Vector2(0.5f, 0.5f));
                component2.set_anchorMax(new Vector2(0.5f, 0.5f));
                QuestV2Rec          record = StaticDB.questDB.GetRecord(mobileWorldQuestBounty.QuestID);
                bool                flag   = true;
                ZoneMissionOverview zoneMissionOverview = null;
                int questSortID = record.QuestSortID;
                if (questSortID == 7502)
                {
                    goto IL_1AA;
                }
                if (questSortID != 7503)
                {
                    if (questSortID != 7334)
                    {
                        if (questSortID != 7541)
                        {
                            if (questSortID != 7558)
                            {
                                if (questSortID != 7637)
                                {
                                    if (questSortID == 8147)
                                    {
                                        goto IL_1AA;
                                    }
                                    flag = false;
                                }
                                else
                                {
                                    zoneMissionOverview = this.m_allZoneMissionOverviews[4];
                                }
                            }
                            else
                            {
                                zoneMissionOverview = this.m_allZoneMissionOverviews[5];
                            }
                        }
                        else
                        {
                            zoneMissionOverview = this.m_allZoneMissionOverviews[3];
                        }
                    }
                    else
                    {
                        zoneMissionOverview = this.m_allZoneMissionOverviews[0];
                    }
                }
                else
                {
                    zoneMissionOverview = this.m_allZoneMissionOverviews[2];
                }
IL_1C1:
                if (flag)
                {
                    if (zoneMissionOverview.zoneNameTag.get_Length() > 0)
                    {
                        gameObject.get_transform().SetParent(zoneMissionOverview.m_bountyButtonRoot.get_transform(), false);
                    }
                    else
                    {
                        gameObject.get_transform().SetParent(zoneMissionOverview.m_anonymousBountyButtonRoot.get_transform(), false);
                    }
                    gameObject.get_transform().set_localPosition(Vector3.get_zero());
                    component.m_errorImage.get_gameObject().SetActive(false);
                }
                else
                {
                    gameObject.get_transform().set_localPosition(new Vector3(0f, 0f, 0f));
                    component.m_errorImage.get_gameObject().SetActive(true);
                }
                StackableMapIcon component3 = gameObject.GetComponent <StackableMapIcon>();
                if (component3 != null)
                {
                    component3.RegisterWithManager();
                    continue;
                }
                continue;
IL_1AA:
                zoneMissionOverview = this.m_allZoneMissionOverviews[6];
                goto IL_1C1;
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
    }
예제 #2
0
    public void HandleBountyInfoUpdated()
    {
        if (this.m_mapViewContentsRT != null)
        {
            BountySite[] componentsInChildren = this.m_mapViewContentsRT.GetComponentsInChildren <BountySite>(true);
            if (componentsInChildren != null)
            {
                foreach (BountySite bountySite in componentsInChildren)
                {
                    StackableMapIcon component  = bountySite.GetComponent <StackableMapIcon>();
                    GameObject       gameObject = bountySite.gameObject;
                    if (component != null)
                    {
                        component.RemoveFromContainer();
                    }
                    if (gameObject != null)
                    {
                        Object.DestroyImmediate(gameObject);
                    }
                }
            }
        }
        if (PersistentBountyData.bountyDictionary == null)
        {
            return;
        }
        IEnumerator enumerator = PersistentBountyData.bountyDictionary.Values.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object obj = enumerator.Current;
                MobileWorldQuestBounty mobileWorldQuestBounty = (MobileWorldQuestBounty)obj;
                GameObject             gameObject2            = Object.Instantiate <GameObject>(this.m_bountySitePrefab);
                if (!(gameObject2 == null))
                {
                    BountySite component2 = gameObject2.GetComponent <BountySite>();
                    if (!(component2 == null))
                    {
                        component2.SetBounty(mobileWorldQuestBounty);
                        gameObject2.name = "BountySite " + mobileWorldQuestBounty.QuestID;
                        RectTransform component3 = gameObject2.GetComponent <RectTransform>();
                        if (!(component3 == null))
                        {
                            component3.anchorMin = new Vector2(0.5f, 0.5f);
                            component3.anchorMax = new Vector2(0.5f, 0.5f);
                            QuestV2Rec          record = StaticDB.questDB.GetRecord(mobileWorldQuestBounty.QuestID);
                            int                 num    = (record == null) ? 0 : record.QuestSortID;
                            bool                flag   = true;
                            ZoneMissionOverview zoneMissionOverview = null;
                            int                 startLocationMapID  = 1220;
                            if (num == 7502)
                            {
                                goto IL_24B;
                            }
                            if (num != 7503)
                            {
                                switch (num)
                                {
                                case 7541:
                                    zoneMissionOverview = this.m_allZoneMissionOverviews[3];
                                    break;

                                default:
                                    if (num != 7334)
                                    {
                                        if (num != 7558)
                                        {
                                            if (num != 7637)
                                            {
                                                if (num == 8147)
                                                {
                                                    goto IL_24B;
                                                }
                                                if (num != 8574)
                                                {
                                                    if (num != 8701)
                                                    {
                                                        Debug.LogError(string.Concat(new object[]
                                                        {
                                                            "INVALID QUESTSORTID ",
                                                            num,
                                                            " for quest ID:",
                                                            mobileWorldQuestBounty.QuestID
                                                        }));
                                                        flag = false;
                                                    }
                                                    else
                                                    {
                                                        zoneMissionOverview = this.m_allZoneMissionOverviews[9];
                                                    }
                                                }
                                                else
                                                {
                                                    zoneMissionOverview = this.m_allZoneMissionOverviews[7];
                                                }
                                            }
                                            else
                                            {
                                                zoneMissionOverview = this.m_allZoneMissionOverviews[4];
                                            }
                                        }
                                        else
                                        {
                                            zoneMissionOverview = this.m_allZoneMissionOverviews[5];
                                        }
                                    }
                                    else
                                    {
                                        zoneMissionOverview = this.m_allZoneMissionOverviews[0];
                                    }
                                    break;

                                case 7543:
                                    zoneMissionOverview = this.m_allZoneMissionOverviews[1];
                                    break;
                                }
                            }
                            else
                            {
                                zoneMissionOverview = this.m_allZoneMissionOverviews[2];
                            }
IL_2C9:
                            if (flag)
                            {
                                if (zoneMissionOverview != null)
                                {
                                    if (zoneMissionOverview.zoneNameTag != null && zoneMissionOverview.zoneNameTag.Length > 0)
                                    {
                                        if (zoneMissionOverview.m_bountyButtonRoot != null)
                                        {
                                            gameObject2.transform.SetParent(zoneMissionOverview.m_bountyButtonRoot.transform, false);
                                        }
                                    }
                                    else if (zoneMissionOverview.m_anonymousBountyButtonRoot != null)
                                    {
                                        gameObject2.transform.SetParent(zoneMissionOverview.m_anonymousBountyButtonRoot.transform, false);
                                    }
                                }
                                gameObject2.transform.localPosition = Vector3.zero;
                                if (component2.m_errorImage != null && component2.m_errorImage.gameObject != null)
                                {
                                    component2.m_errorImage.gameObject.SetActive(false);
                                }
                            }
                            else
                            {
                                gameObject2.transform.localPosition = new Vector3(0f, 0f, 0f);
                                if (component2.m_errorImage != null && component2.m_errorImage.gameObject != null)
                                {
                                    component2.m_errorImage.gameObject.SetActive(true);
                                }
                            }
                            StackableMapIcon component4 = gameObject2.GetComponent <StackableMapIcon>();
                            if (component4 != null)
                            {
                                component4.RegisterWithManager(startLocationMapID);
                                continue;
                            }
                            continue;
IL_24B:
                            zoneMissionOverview = this.m_allZoneMissionOverviews[6];
                            goto IL_2C9;
                        }
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
    }