private void InitMissionSites()
 {
     if (this.OnInitMissionSites != null)
     {
         this.OnInitMissionSites();
     }
     AdventureMapMissionSite[] componentsInChildren = this.m_mapViewContentsRT.GetComponentsInChildren <AdventureMapMissionSite>(true);
     for (int i = 0; i < (int)componentsInChildren.Length; i++)
     {
         AdventureMapMissionSite adventureMapMissionSite = componentsInChildren[i];
         if (adventureMapMissionSite != null)
         {
             StackableMapIcon component  = adventureMapMissionSite.GetComponent <StackableMapIcon>();
             GameObject       gameObject = adventureMapMissionSite.gameObject;
             if (component != null)
             {
                 component.RemoveFromContainer();
             }
             if (gameObject != null)
             {
                 UnityEngine.Object.Destroy(adventureMapMissionSite.gameObject);
             }
         }
     }
     foreach (WrapperGarrisonMission value in PersistentMissionData.missionDictionary.Values)
     {
         this.CreateMissionSite(value.MissionRecID);
     }
 }
 private static void ClearWorldQuestArea(GameObject questArea)
 {
     AdventureMapWorldQuest[] componentsInChildren = questArea.GetComponentsInChildren <AdventureMapWorldQuest>(true);
     foreach (AdventureMapWorldQuest adventureMapWorldQuest in componentsInChildren)
     {
         StackableMapIcon component  = adventureMapWorldQuest.GetComponent <StackableMapIcon>();
         GameObject       gameObject = adventureMapWorldQuest.gameObject;
         if (component != null)
         {
             component.RemoveFromContainer();
         }
         if (gameObject != null)
         {
             Object.Destroy(adventureMapWorldQuest.gameObject);
         }
     }
 }
Example #3
0
 private void InitMissionSites()
 {
     if (this.OnInitMissionSites != null)
     {
         this.OnInitMissionSites();
     }
     AdventureMapMissionSite[] componentsInChildren = this.m_mapViewContentsRT.GetComponentsInChildren <AdventureMapMissionSite>(true);
     foreach (AdventureMapMissionSite adventureMapMissionSite in componentsInChildren)
     {
         if (adventureMapMissionSite != null)
         {
             StackableMapIcon component  = adventureMapMissionSite.GetComponent <StackableMapIcon>();
             GameObject       gameObject = adventureMapMissionSite.gameObject;
             if (component != null)
             {
                 component.RemoveFromContainer();
             }
             if (gameObject != null)
             {
                 Object.Destroy(adventureMapMissionSite.gameObject);
             }
         }
     }
     componentsInChildren = this.m_missionAndWorldQuestArea_Argus.transform.GetComponentsInChildren <AdventureMapMissionSite>(true);
     foreach (AdventureMapMissionSite adventureMapMissionSite2 in componentsInChildren)
     {
         if (adventureMapMissionSite2 != null)
         {
             StackableMapIcon component2  = adventureMapMissionSite2.GetComponent <StackableMapIcon>();
             GameObject       gameObject2 = adventureMapMissionSite2.gameObject;
             if (component2 != null)
             {
                 component2.RemoveFromContainer();
             }
             if (gameObject2 != null)
             {
                 Object.Destroy(adventureMapMissionSite2.gameObject);
             }
         }
     }
     foreach (WrapperGarrisonMission wrapperGarrisonMission in PersistentMissionData.missionDictionary.Values)
     {
         this.CreateMissionSite(wrapperGarrisonMission.MissionRecID);
     }
 }
 private static void ClearWorldQuestArea(GameObject questArea)
 {
     AdventureMapWorldQuest[] componentsInChildren = questArea.GetComponentsInChildren <AdventureMapWorldQuest>(true);
     for (int i = 0; i < (int)componentsInChildren.Length; i++)
     {
         AdventureMapWorldQuest adventureMapWorldQuest = componentsInChildren[i];
         StackableMapIcon       component  = adventureMapWorldQuest.GetComponent <StackableMapIcon>();
         GameObject             gameObject = adventureMapWorldQuest.gameObject;
         if (component != null)
         {
             component.RemoveFromContainer();
         }
         if (gameObject != null)
         {
             UnityEngine.Object.Destroy(adventureMapWorldQuest.gameObject);
         }
     }
 }
        private void ShowMissionSuccess(bool awardOvermax)
        {
            if (AdventureMapPanel.instance.ShowMissionResultAction != null)
            {
                AdventureMapPanel.instance.ShowMissionResultAction(this.m_garrMissionID, 2, awardOvermax);
            }
            StackableMapIcon component  = base.gameObject.GetComponent <StackableMapIcon>();
            GameObject       gameObject = base.gameObject;

            if (component != null)
            {
                component.RemoveFromContainer();
            }
            if (gameObject != null)
            {
                Object.Destroy(gameObject);
            }
        }
        private void ShowMissionFailure()
        {
            if (AdventureMapPanel.instance.ShowMissionResultAction != null)
            {
                AdventureMapPanel.instance.ShowMissionResultAction(this.m_garrMissionID, 3, false);
            }
            StackableMapIcon component  = base.gameObject.GetComponent <StackableMapIcon>();
            GameObject       gameObject = base.gameObject;

            if (component != null)
            {
                component.RemoveFromContainer();
            }
            if (gameObject != null)
            {
                UnityEngine.Object.Destroy(gameObject);
            }
        }
Example #7
0
        private void Update()
        {
            TimeSpan mEndTime = this.m_endTime - GarrisonStatus.CurrentTime();

            this.m_expiringSoon.gameObject.SetActive(mEndTime.TotalSeconds < 4500);
            if (mEndTime.TotalSeconds <= 0)
            {
                StackableMapIcon component  = base.gameObject.GetComponent <StackableMapIcon>();
                GameObject       gameObject = base.gameObject;
                if (component != null)
                {
                    component.RemoveFromContainer();
                }
                if (gameObject != null)
                {
                    UnityEngine.Object.Destroy(gameObject);
                    return;
                }
            }
        }
        public void HandleBountyInfoUpdated()
        {
            if (this.m_mapViewContentsRT != null)
            {
                BountySite[] componentsInChildren = this.m_mapViewContentsRT.GetComponentsInChildren <BountySite>(true);
                if (componentsInChildren != null)
                {
                    BountySite[] bountySiteArray = componentsInChildren;
                    for (int i = 0; i < (int)bountySiteArray.Length; i++)
                    {
                        BountySite       bountySite = bountySiteArray[i];
                        StackableMapIcon component  = bountySite.GetComponent <StackableMapIcon>();
                        GameObject       gameObject = bountySite.gameObject;
                        if (component != null)
                        {
                            component.RemoveFromContainer();
                        }
                        if (gameObject != null)
                        {
                            UnityEngine.Object.Destroy(gameObject);
                        }
                    }
                }
            }
            if (PersistentBountyData.bountyDictionary == null || this.m_emissaryCollection == null)
            {
                return;
            }
            this.m_emissaryCollection.ClearCollection();
            foreach (WrapperWorldQuestBounty value in PersistentBountyData.bountyDictionary.Values)
            {
                QuestV2Rec record = StaticDB.questDB.GetRecord(value.QuestID);
                int        num    = (record == null ? 0 : record.QuestSortID);
                if (record == null)
                {
                    Debug.LogWarning(string.Concat("HandleBountyInfoUpdated Warning: Failed to get Bounty quest with ID ", value.QuestID.ToString()));
                }
                else if (num != 7502 && num != 7503)
                {
                    switch (num)
                    {
                    case 7541:
                    case 7543:
                    {
                        break;
                    }

                    default:
                    {
                        if (num == 7334 || num == 7558 || num == 7637 || num == 8147 || num == 8574 || num == 8701)
                        {
                            break;
                        }
                        GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.m_bountySitePrefab);
                        if (gameObject1 != null)
                        {
                            BountySite component1 = gameObject1.GetComponent <BountySite>();
                            if (component1 != null)
                            {
                                component1.SetBounty(value);
                                gameObject1.name = string.Concat("BountySite ", value.QuestID);
                                RectTransform vector2 = gameObject1.GetComponent <RectTransform>();
                                if (vector2 != null)
                                {
                                    vector2.anchorMin = new Vector2(0.5f, 0.5f);
                                    vector2.anchorMax = new Vector2(0.5f, 0.5f);
                                    this.m_emissaryCollection.AddBountyObjectToCollection(gameObject1);
                                    continue;
                                }
                                else
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    }
                }
            }
        }
        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.Destroy(gameObject);
                        }
                    }
                }
            }
            if (PersistentBountyData.bountyDictionary == null || this.m_emissaryCollection == null)
            {
                return;
            }
            this.m_emissaryCollection.ClearCollection();
            foreach (WrapperWorldQuestBounty bounty in from bt in PersistentBountyData.bountyDictionary.Values
                     orderby bt.EndTime
                     select bt)
            {
                QuestV2Rec record = StaticDB.questV2DB.GetRecord(bounty.QuestID);
                int        num    = (record == null) ? 0 : record.QuestSortID;
                if (record == null)
                {
                    Debug.LogWarning("HandleBountyInfoUpdated Warning: Failed to get Bounty quest with ID " + bounty.QuestID.ToString());
                }
                else if (num != 7502 && num != 7503)
                {
                    switch (num)
                    {
                    case 7541:
                    case 7543:
                        break;

                    default:
                        if (num != 7334 && num != 7558 && num != 7637 && num != 8147 && num != 8574 && num != 8701)
                        {
                            GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_bountySitePrefab);
                            if (!(gameObject2 == null))
                            {
                                BountySite component2 = gameObject2.GetComponent <BountySite>();
                                if (!(component2 == null))
                                {
                                    component2.SetBounty(bounty);
                                    gameObject2.name = "BountySite " + bounty.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);
                                        this.m_emissaryCollection.AddBountyObjectToCollection(gameObject2);
                                    }
                                }
                            }
                        }
                        break;
                    }
                }
            }
        }
Example #10
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.Destroy(gameObject);
                        }
                    }
                }
            }
            if (PersistentBountyData.bountyDictionary == null)
            {
                return;
            }
            foreach (WrapperWorldQuestBounty bounty in PersistentBountyData.bountyDictionary.Values)
            {
                GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_bountySitePrefab);
                if (!(gameObject2 == null))
                {
                    BountySite component2 = gameObject2.GetComponent <BountySite>();
                    if (!(component2 == null))
                    {
                        component2.SetBounty(bounty);
                        gameObject2.name = "BountySite " + bounty.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(bounty.QuestID);
                            int                 num    = (record == null) ? 0 : record.QuestSortID;
                            bool                flag   = true;
                            ZoneMissionOverview zoneMissionOverview = null;
                            int                 startLocationMapID  = 1220;
                            switch (num)
                            {
                            case 8499:
                                break;

                            case 8500:
                                break;

                            case 8501:
                                break;

                            default:
                                if (num != 7502)
                                {
                                    if (num == 7503)
                                    {
                                        zoneMissionOverview = this.m_allZoneMissionOverviews[2];
                                        break;
                                    }
                                    switch (num)
                                    {
                                    case 7541:
                                        zoneMissionOverview = this.m_allZoneMissionOverviews[3];
                                        goto IL_31F;

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

                                    case 7543:
                                        zoneMissionOverview = this.m_allZoneMissionOverviews[1];
                                        goto IL_31F;
                                    }
                                }
                                zoneMissionOverview = this.m_allZoneMissionOverviews[6];
                                break;
                            }
IL_31F:
                            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.SetActive(false);
                                }
                            }
                            else
                            {
                                gameObject2.transform.localPosition = new Vector3(0f, 0f, 0f);
                                if (component2.m_errorImage != null)
                                {
                                    component2.m_errorImage.gameObject.SetActive(true);
                                }
                            }
                            StackableMapIcon component4 = gameObject2.GetComponent <StackableMapIcon>();
                            if (component4 != null)
                            {
                                component4.RegisterWithManager(startLocationMapID);
                            }
                        }
                    }
                }
            }
        }