public void Init(FollowerDetailView followerDetailView)
    {
        this.m_currentFollowerDetailView = followerDetailView;
        FollowerInventoryListItem[] componentsInChildren = this.m_armamentListContent.GetComponentsInChildren <FollowerInventoryListItem>(true);
        FollowerInventoryListItem[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            FollowerInventoryListItem followerInventoryListItem = array[i];
            Object.DestroyImmediate(followerInventoryListItem.get_gameObject());
        }
        bool        active     = true;
        IEnumerator enumerator = PersistentArmamentData.armamentDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                MobileFollowerArmament    item = (MobileFollowerArmament)enumerator.get_Current();
                FollowerInventoryListItem followerInventoryListItem2 = Object.Instantiate <FollowerInventoryListItem>(this.m_armamentListItemPrefab);
                followerInventoryListItem2.get_transform().SetParent(this.m_armamentListContent.get_transform(), false);
                followerInventoryListItem2.SetArmament(item, followerDetailView);
                active = false;
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        this.m_emptyMessage.get_gameObject().SetActive(active);
    }
示例#2
0
    public void SetAbility(int garrAbilityID, FollowerDetailView followerDetailView)
    {
        GarrAbilityRec record = StaticDB.garrAbilityDB.GetRecord(garrAbilityID);

        if (record == null)
        {
            Debug.LogWarning("Invalid garrAbilityID " + garrAbilityID);
            return;
        }
        this.m_abilityNameText.set_text(record.Name);
        this.m_abilityDescription.set_text(WowTextParser.parser.Parse(record.Description, 0));
        this.m_abilityDescription.set_supportRichText(WowTextParser.parser.IsRichText());
        this.m_abilityDisplay.SetAbility(garrAbilityID, true, true, null);
        FollowerInventoryListItem[] componentsInChildren = this.m_equipmentListContent.GetComponentsInChildren <FollowerInventoryListItem>(true);
        FollowerInventoryListItem[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            FollowerInventoryListItem followerInventoryListItem = array[i];
            Object.DestroyImmediate(followerInventoryListItem.get_gameObject());
        }
        bool        active     = true;
        IEnumerator enumerator = PersistentEquipmentData.equipmentDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                MobileFollowerEquipment mobileFollowerEquipment = (MobileFollowerEquipment)enumerator.get_Current();
                GarrAbilityRec          record2 = StaticDB.garrAbilityDB.GetRecord(mobileFollowerEquipment.GarrAbilityID);
                if (record2 != null)
                {
                    if ((record2.Flags & 64u) == 0u)
                    {
                        FollowerInventoryListItem followerInventoryListItem2 = Object.Instantiate <FollowerInventoryListItem>(this.m_equipmentListItemPrefab);
                        followerInventoryListItem2.get_transform().SetParent(this.m_equipmentListContent.get_transform(), false);
                        followerInventoryListItem2.SetEquipment(mobileFollowerEquipment, followerDetailView, garrAbilityID);
                        active = false;
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        this.m_noEquipmentMessage.get_gameObject().SetActive(active);
    }
示例#3
0
 private void CreateCombatAllyItems(int combatAllyMissionID, int combatAllyMissionCost)
 {
     using (Dictionary <int, JamGarrisonFollower> .ValueCollection.Enumerator enumerator = PersistentFollowerData.followerDictionary.get_Values().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             JamGarrisonFollower current        = enumerator.get_Current();
             FollowerStatus      followerStatus = GeneralHelpers.GetFollowerStatus(current);
             if (current.ZoneSupportSpellID > 0 && (followerStatus == FollowerStatus.available || followerStatus == FollowerStatus.onMission))
             {
                 FollowerInventoryListItem followerInventoryListItem = Object.Instantiate <FollowerInventoryListItem>(this.m_combatAllyChampionListItemPrefab);
                 followerInventoryListItem.get_transform().SetParent(this.m_combatAllyListContent.get_transform(), false);
                 followerInventoryListItem.SetCombatAllyChampion(current, combatAllyMissionID, combatAllyMissionCost);
             }
         }
     }
 }
示例#4
0
    private void UpdateEquipmentDisplay(int garrAbilityID, FollowerDetailView followerDetailView)
    {
        FollowerInventoryListItem[] componentsInChildren = this.m_equipmentListContent.GetComponentsInChildren <FollowerInventoryListItem>(true);
        FollowerInventoryListItem[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            FollowerInventoryListItem followerInventoryListItem = array[i];
            Object.DestroyImmediate(followerInventoryListItem.get_gameObject());
        }
        bool        active     = true;
        IEnumerator enumerator = PersistentEquipmentData.equipmentDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                MobileFollowerEquipment mobileFollowerEquipment = (MobileFollowerEquipment)enumerator.get_Current();
                GarrAbilityRec          record = StaticDB.garrAbilityDB.GetRecord(mobileFollowerEquipment.GarrAbilityID);
                if (record != null)
                {
                    if ((record.Flags & 64u) == 0u)
                    {
                        FollowerInventoryListItem followerInventoryListItem2 = Object.Instantiate <FollowerInventoryListItem>(this.m_equipmentListItemPrefab);
                        followerInventoryListItem2.get_transform().SetParent(this.m_equipmentListContent.get_transform(), false);
                        followerInventoryListItem2.SetEquipment(mobileFollowerEquipment, followerDetailView, garrAbilityID);
                        active = false;
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        this.m_noEquipmentMessage.get_gameObject().SetActive(active);
    }