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); }
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; }