public int Compare(KeyValuePair <int, JamGarrisonFollower> follower1, KeyValuePair <int, JamGarrisonFollower> follower2)
        {
            JamGarrisonFollower value           = follower1.Value;
            JamGarrisonFollower value2          = follower2.Value;
            FollowerStatus      followerStatus  = GeneralHelpers.GetFollowerStatus(value);
            FollowerStatus      followerStatus2 = GeneralHelpers.GetFollowerStatus(value2);
            bool flag  = (value.Flags & 8) != 0;
            bool flag2 = (value2.Flags & 8) != 0;
            bool flag3 = !flag && followerStatus != FollowerStatus.inactive;
            bool flag4 = !flag2 && followerStatus2 != FollowerStatus.inactive;

            if (flag3 != flag4)
            {
                return((!flag3) ? 1 : -1);
            }
            if (followerStatus != followerStatus2)
            {
                return(followerStatus - followerStatus2);
            }
            int num  = (value.ItemLevelArmor + value.ItemLevelWeapon) / 2;
            int num2 = (value2.ItemLevelArmor + value2.ItemLevelWeapon) / 2;

            if (num2 != num)
            {
                return(num2 - num);
            }
            if (value.Quality != value2.Quality)
            {
                return(value2.Quality - value.Quality);
            }
            return(0);
        }
        private FollowerListItem InsertFollowerIntoListView(WrapperGarrisonFollower follower)
        {
            GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID);

            if (record == null)
            {
                return(null);
            }
            if (record.GarrFollowerTypeID != (uint)GarrisonStatus.GarrisonFollowerType)
            {
                return(null);
            }
            if (this.m_isCombatAllyList)
            {
                bool           flags          = (follower.Flags & 8) != 0;
                FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(follower);
                if (flags || follower.ZoneSupportSpellID <= 0 || followerStatus == FollowerStatus.inactive || followerStatus == FollowerStatus.fatigued || followerStatus == FollowerStatus.inBuilding)
                {
                    return(null);
                }
            }
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.m_followerListItemPrefab);

            gameObject.transform.SetParent(this.m_followerListViewContents.transform, false);
            FollowerListItem component = gameObject.GetComponent <FollowerListItem>();

            component.SetFollower(follower);
            return(component);
        }
Пример #3
0
    private void MobileClientChangeFollowerActiveResultHandler(MobileClientChangeFollowerActiveResult msg)
    {
        GARRISON_RESULT result = (GARRISON_RESULT)msg.Result;

        if (result == GARRISON_RESULT.SUCCESS)
        {
            PersistentFollowerData.AddOrUpdateFollower(msg.Follower);
            FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(msg.Follower);
            if (followerStatus == FollowerStatus.inactive)
            {
                Debug.Log("Follower is now inactive. " + msg.ActivationsRemaining + " activations remain for the day.");
            }
            else
            {
                Debug.Log("Follower is now active. " + msg.ActivationsRemaining + " activations remain for the day.");
            }
            if (this.FollowerDataChangedAction != null)
            {
                this.FollowerDataChangedAction.Invoke();
            }
            MobilePlayerFollowerActivationDataRequest mobilePlayerFollowerActivationDataRequest = new MobilePlayerFollowerActivationDataRequest();
            mobilePlayerFollowerActivationDataRequest.GarrTypeID = 3;
            Login.instance.SendToMobileServer(mobilePlayerFollowerActivationDataRequest);
        }
        else
        {
            Debug.Log("Follower activation/deactivation failed for reason " + result.ToString());
        }
    }
    private FollowerListItem InsertFollowerIntoListView(JamGarrisonFollower follower)
    {
        GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID);

        if (record == null)
        {
            return(null);
        }
        if (record.GarrFollowerTypeID != 4u)
        {
            return(null);
        }
        if (this.m_isCombatAllyList)
        {
            bool           flag           = (follower.Flags & 8) != 0;
            FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(follower);
            if (flag || follower.ZoneSupportSpellID <= 0 || followerStatus == FollowerStatus.inactive || followerStatus == FollowerStatus.fatigued || followerStatus == FollowerStatus.inBuilding)
            {
                return(null);
            }
        }
        GameObject gameObject = Object.Instantiate <GameObject>(this.m_followerListItemPrefab);

        gameObject.get_transform().SetParent(this.m_followerListViewContents.get_transform());
        gameObject.get_transform().set_localScale(Vector3.get_one());
        gameObject.get_transform().set_localPosition(Vector3.get_zero());
        FollowerListItem component = gameObject.GetComponent <FollowerListItem>();

        component.SetFollower(follower);
        AutoHide autoHide = gameObject.AddComponent <AutoHide>();

        autoHide.m_clipRT = base.get_gameObject().GetComponent <RectTransform>();
        return(component);
    }
            public int Compare(KeyValuePair <int, WrapperGarrisonFollower> follower1, KeyValuePair <int, WrapperGarrisonFollower> follower2)
            {
                WrapperGarrisonFollower value = follower1.Value;
                WrapperGarrisonFollower wrapperGarrisonFollower = follower2.Value;
                FollowerStatus          followerStatus          = GeneralHelpers.GetFollowerStatus(value);
                FollowerStatus          followerStatu           = GeneralHelpers.GetFollowerStatus(wrapperGarrisonFollower);
                bool flags = (value.Flags & 8) != 0;
                bool flag  = (wrapperGarrisonFollower.Flags & 8) != 0;
                bool flag1 = (flags ? false : followerStatus != FollowerStatus.inactive);

                if (flag1 != (flag ? false : followerStatu != FollowerStatus.inactive))
                {
                    return(!flag1 ? 1 : -1);
                }
                if (followerStatus != followerStatu)
                {
                    return((int)followerStatus - (int)followerStatu);
                }
                int itemLevelArmor = (value.ItemLevelArmor + value.ItemLevelWeapon) / 2;
                int num            = (wrapperGarrisonFollower.ItemLevelArmor + wrapperGarrisonFollower.ItemLevelWeapon) / 2;

                if (num != itemLevelArmor)
                {
                    return(num - itemLevelArmor);
                }
                if (value.Quality == wrapperGarrisonFollower.Quality)
                {
                    return(0);
                }
                return(wrapperGarrisonFollower.Quality - value.Quality);
            }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the UserCompactView class.
 /// </summary>
 public UserCompactView(string userHandle, string firstName, string lastName, Visibility visibility, FollowerStatus followerStatus, string photoHandle = default(string), string photoUrl = default(string))
 {
     UserHandle     = userHandle;
     FirstName      = firstName;
     LastName       = lastName;
     PhotoHandle    = photoHandle;
     PhotoUrl       = photoUrl;
     Visibility     = visibility;
     FollowerStatus = followerStatus;
 }
        private void InsertFollowerIntoListView(WrapperGarrisonFollower follower, FollowerCategory followerCategory)
        {
            GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID);

            if (record == null)
            {
                return;
            }
            if (record.GarrFollowerTypeID != (uint)GarrisonStatus.GarrisonFollowerType)
            {
                return;
            }
            bool           flags          = (follower.Flags & 8) != 0;
            bool           flag           = !flags;
            FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(follower);

            switch (followerCategory)
            {
            case FollowerCategory.ActiveChampion:
            {
                if (!flag || followerStatus == FollowerStatus.inactive)
                {
                    return;
                }
                break;
            }

            case FollowerCategory.InactiveChampion:
            {
                if (!flag || followerStatus != FollowerStatus.inactive)
                {
                    return;
                }
                break;
            }

            case FollowerCategory.Troop:
            {
                if (!flags || follower.Durability <= 0)
                {
                    return;
                }
                break;
            }

            default:
            {
                return;
            }
            }
            FollowerListItem followerListItem = UnityEngine.Object.Instantiate <FollowerListItem>(this.m_followerDetailListItemPrefab);

            followerListItem.transform.SetParent(this.m_followerDetailListContent.transform, false);
            followerListItem.SetFollower(follower);
        }
Пример #8
0
 public ItemList(
     string title,
     string description,
     string imageUrl,
     FollowerStatus status)
 {
     Title       = title;
     Description = description;
     ImageUrl    = imageUrl;
     Status      = status;
 }
    private void InsertFollowerIntoListView(JamGarrisonFollower follower, FollowerCategory followerCategory)
    {
        GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID);

        if (record == null)
        {
            return;
        }
        if (record.GarrFollowerTypeID != 4u)
        {
            return;
        }
        bool           flag           = (follower.Flags & 8) != 0;
        bool           flag2          = !flag;
        FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(follower);

        switch (followerCategory)
        {
        case FollowerCategory.ActiveChampion:
            if (!flag2 || followerStatus == FollowerStatus.inactive)
            {
                return;
            }
            break;

        case FollowerCategory.InactiveChampion:
            if (!flag2 || followerStatus != FollowerStatus.inactive)
            {
                return;
            }
            break;

        case FollowerCategory.Troop:
            if (!flag || follower.Durability <= 0)
            {
                return;
            }
            break;

        default:
            return;
        }
        FollowerListItem followerListItem = Object.Instantiate <FollowerListItem>(this.m_followerDetailListItemPrefab);

        followerListItem.get_transform().SetParent(this.m_followerDetailListContent.get_transform(), false);
        followerListItem.SetFollower(follower);
        AutoHide autoHide = followerListItem.m_followerDetailView.get_gameObject().AddComponent <AutoHide>();

        autoHide.m_clipRT = this.m_panelViewRT;
        AutoHide autoHide2 = followerListItem.m_listItemArea.get_gameObject().AddComponent <AutoHide>();

        autoHide2.m_clipRT = this.m_panelViewRT;
    }
Пример #10
0
 private void CreateCombatAllyItems(int combatAllyMissionID, int combatAllyMissionCost)
 {
     foreach (JamGarrisonFollower jamGarrisonFollower in PersistentFollowerData.followerDictionary.Values)
     {
         FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(jamGarrisonFollower);
         if (jamGarrisonFollower.ZoneSupportSpellID > 0 && (followerStatus == FollowerStatus.available || followerStatus == FollowerStatus.onMission))
         {
             FollowerInventoryListItem followerInventoryListItem = Object.Instantiate <FollowerInventoryListItem>(this.m_combatAllyChampionListItemPrefab);
             followerInventoryListItem.transform.SetParent(this.m_combatAllyListContent.transform, false);
             followerInventoryListItem.SetCombatAllyChampion(jamGarrisonFollower, combatAllyMissionID, combatAllyMissionCost);
         }
     }
 }
Пример #11
0
 private void CreateCombatAllyItems(int combatAllyMissionID, int combatAllyMissionCost)
 {
     foreach (WrapperGarrisonFollower value in PersistentFollowerData.followerDictionary.Values)
     {
         FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(value);
         if (value.ZoneSupportSpellID <= 0 || followerStatus != FollowerStatus.available && followerStatus != FollowerStatus.onMission)
         {
             continue;
         }
         FollowerInventoryListItem followerInventoryListItem = UnityEngine.Object.Instantiate <FollowerInventoryListItem>(this.m_combatAllyChampionListItemPrefab);
         followerInventoryListItem.transform.SetParent(this.m_combatAllyListContent.transform, false);
         followerInventoryListItem.SetCombatAllyChampion(value, combatAllyMissionID, combatAllyMissionCost);
     }
 }
 /// <summary>
 /// Initializes a new instance of the UserProfileView class.
 /// </summary>
 public UserProfileView(string userHandle, string firstName, string lastName, string bio, string photoHandle, string photoUrl, Visibility visibility, long totalTopics, long totalFollowers, long totalFollowing, FollowerStatus followerStatus, FollowingStatus followingStatus, ProfileStatus profileStatus)
 {
     UserHandle      = userHandle;
     FirstName       = firstName;
     LastName        = lastName;
     Bio             = bio;
     PhotoHandle     = photoHandle;
     PhotoUrl        = photoUrl;
     Visibility      = visibility;
     TotalTopics     = totalTopics;
     TotalFollowers  = totalFollowers;
     TotalFollowing  = totalFollowing;
     FollowerStatus  = followerStatus;
     FollowingStatus = followingStatus;
     ProfileStatus   = profileStatus;
 }
Пример #13
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);
             }
         }
     }
 }
Пример #14
0
 private void ChangeFollowerActiveResultHandler(LegionCompanionWrapper.ChangeFollowerActiveResultEvent eventArgs)
 {
     if (eventArgs.Result == 0)
     {
         PersistentFollowerData.AddOrUpdateFollower(eventArgs.Follower);
         FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(eventArgs.Follower);
         if (followerStatus == FollowerStatus.inactive)
         {
             Debug.Log("Follower is now inactive. " + eventArgs.ActivationsRemaining + " activations remain for the day.");
         }
         else
         {
             Debug.Log("Follower is now active. " + eventArgs.ActivationsRemaining + " activations remain for the day.");
         }
         if (this.FollowerDataChangedAction != null)
         {
             this.FollowerDataChangedAction();
         }
         LegionCompanionWrapper.RequestFollowerActivationData((int)GarrisonStatus.GarrisonType);
     }
 }
        public int Compare(KeyValuePair <int, JamGarrisonFollower> follower1, KeyValuePair <int, JamGarrisonFollower> follower2)
        {
            JamGarrisonFollower value           = follower1.get_Value();
            JamGarrisonFollower value2          = follower2.get_Value();
            FollowerStatus      followerStatus  = GeneralHelpers.GetFollowerStatus(value);
            FollowerStatus      followerStatus2 = GeneralHelpers.GetFollowerStatus(value2);

            if (followerStatus != followerStatus2)
            {
                return(followerStatus - followerStatus2);
            }
            bool flag  = this.HasUsefulAbility(value);
            bool flag2 = this.HasUsefulAbility(value2);

            if (flag != flag2)
            {
                return((!flag) ? 1 : -1);
            }
            int num  = (value.ItemLevelArmor + value.ItemLevelWeapon) / 2;
            int num2 = (value2.ItemLevelArmor + value2.ItemLevelWeapon) / 2;

            if (num2 != num)
            {
                return(num2 - num);
            }
            if (value.Quality != value2.Quality)
            {
                return(value2.Quality - value.Quality);
            }
            bool flag3 = (value.Flags & 8) != 0;
            bool flag4 = (value2.Flags & 8) != 0;

            if (flag3 != flag4)
            {
                return((!flag4) ? 1 : -1);
            }
            return(0);
        }
            public int Compare(KeyValuePair <int, WrapperGarrisonFollower> follower1, KeyValuePair <int, WrapperGarrisonFollower> follower2)
            {
                WrapperGarrisonFollower value = follower1.Value;
                WrapperGarrisonFollower wrapperGarrisonFollower = follower2.Value;
                FollowerStatus          followerStatus          = GeneralHelpers.GetFollowerStatus(value);
                FollowerStatus          followerStatu           = GeneralHelpers.GetFollowerStatus(wrapperGarrisonFollower);

                if (followerStatus != followerStatu)
                {
                    return((int)followerStatus - (int)followerStatu);
                }
                bool flag = this.HasUsefulAbility(value);

                if (flag != this.HasUsefulAbility(wrapperGarrisonFollower))
                {
                    return(!flag ? 1 : -1);
                }
                int itemLevelArmor = (value.ItemLevelArmor + value.ItemLevelWeapon) / 2;
                int num            = (wrapperGarrisonFollower.ItemLevelArmor + wrapperGarrisonFollower.ItemLevelWeapon) / 2;

                if (num != itemLevelArmor)
                {
                    return(num - itemLevelArmor);
                }
                if (value.Quality != wrapperGarrisonFollower.Quality)
                {
                    return(wrapperGarrisonFollower.Quality - value.Quality);
                }
                bool flags  = (value.Flags & 8) != 0;
                bool flags1 = (wrapperGarrisonFollower.Flags & 8) != 0;

                if (flags == flags1)
                {
                    return(0);
                }
                return(!flags1 ? 1 : -1);
            }