Exemplo n.º 1
0
 public void RefreshChartData(EmCollectionChartPageType type)
 {
     if (collectionChartWnd.CurrentPageType == type)
     {
         collectionChartWnd.SwitchContentPage(type);
     }
     else
     {
         FillData(type, EMChartSortType.EMCHARTSORT_DISTRICT, 1, false, true);
     }
 }
Exemplo n.º 2
0
        //切换页面Wnd
        public void SwitchContentPage(EmCollectionChartPageType pageType)
        {
            if (m_wndView == null)
            {
                return;
            }

            m_CurrentPageType = pageType;

            m_wndView.ShowContentPage(pageType);
            m_wndView.SetButtonSelect((int)m_CurrentPageType);
        }
Exemplo n.º 3
0
        public void ShowContentPage(EmCollectionChartPageType type)
        {
            for (int i = 0; i < RankingLists.Count(); i++)
            {
                if (i == (int)type)
                {
                    RankingLists[i].SetActive(true);
                }
                else
                {
                    RankingLists[i].SetActive(false);
                }
            }
            RestData();
            FillData(type, m_CurrentSortType, m_CurrentPage, false);
            CalculatePageState();

            UChartRankingMsgData data = new UChartRankingMsgData();

            switch (type)
            {
            case EmCollectionChartPageType.EMCOLLECTIONCHART_HERO:
            {
                data.nRanking = LogicDataCenter.chartDataManager.HeroCountChartList.PersonalRank;
            }
            break;

            case EmCollectionChartPageType.EMCOLLECTIONCHART_SKIN:
            {
                data.nRanking = LogicDataCenter.chartDataManager.SkinChartList.PersonalRank;
            }
            break;

            case EmCollectionChartPageType.EMCOLLECTIONCHART_GEM:
            {
                data.nRanking = LogicDataCenter.chartDataManager.GemStoneChartList.PersonalRank;
            }
            break;
            }
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_REFRESHCHARTRANKINGDATA, data);
        }
Exemplo n.º 4
0
        private void FillData(EmCollectionChartPageType pageType, EMChartSortType sortType, int page, bool bIsQuery, bool bRefresh = false)
        {
            switch (pageType)
            {
            case EmCollectionChartPageType.EMCOLLECTIONCHART_HERO:
            {
                List <cmd_entity_herocount_order_info> dataList = new List <cmd_entity_herocount_order_info>();

                if (bIsQuery)
                {
                    dataList = LogicDataCenter.chartDataManager.HeroCountChartList.tmpDataList;
                }
                else
                {
                    if (sortType == EMChartSortType.EMCHARTSORT_DISTRICT)
                    {
                        dataList = LogicDataCenter.chartDataManager.HeroCountChartList.AllDataList;
                        if (collectionChartWnd.CurrentPageType == EmCollectionChartPageType.EMCOLLECTIONCHART_HERO)
                        {
                            if (LogicDataCenter.chartDataManager.HeroCountChartList.PersonalRank % ContainerList[(int)pageType].childCount == 0)
                            {
                                m_RankingPage = LogicDataCenter.chartDataManager.HeroCountChartList.PersonalRank / ContainerList[(int)pageType].childCount;
                                m_RankingPage--;

                                if (m_RankingPage < 0)
                                {
                                    m_RankingPage = 0;
                                }
                            }
                            else
                            {
                                m_RankingPage = LogicDataCenter.chartDataManager.HeroCountChartList.PersonalRank / ContainerList[(int)pageType].childCount;
                            }
                        }
                    }
                    else if (sortType == EMChartSortType.EMCHARTSORT_CLAN)
                    {
                        dataList = LogicDataCenter.chartDataManager.HeroCountChartList.ClanMemberDataList;
                    }
                    else if (sortType == EMChartSortType.EMCHARTSORT_FRIEND)
                    {
                        dataList = LogicDataCenter.chartDataManager.HeroCountChartList.FriendDataList;
                    }
                }

                int count      = ContainerList[(int)pageType].childCount;
                int startIndex = (page - 1) * count;

                if (!bRefresh)
                {
                    m_MaxPage = CalculateMaxPage(dataList.Count, count);
                }

                for (int i = 0; i < count; i++)
                {
                    Transform trs = ContainerList[(int)pageType].GetChild(i);
                    if (trs != null)
                    {
                        HeroNumChartItem item = trs.GetComponent <HeroNumChartItem>();
                        if (item != null)
                        {
                            item.Clear();
                            if (startIndex + i < dataList.Count)
                            {
                                item.SetData(dataList[startIndex + i]);
                            }
                        }
                    }
                }
            }
            break;

            case EmCollectionChartPageType.EMCOLLECTIONCHART_SKIN:
            {
                List <cmd_entity_skin_order_info> dataList = new List <cmd_entity_skin_order_info>();

                if (bIsQuery)
                {
                    dataList = LogicDataCenter.chartDataManager.SkinChartList.tmpDataList;
                }
                else
                {
                    if (sortType == EMChartSortType.EMCHARTSORT_DISTRICT)
                    {
                        dataList = LogicDataCenter.chartDataManager.SkinChartList.AllDataList;
                        if (collectionChartWnd.CurrentPageType == EmCollectionChartPageType.EMCOLLECTIONCHART_SKIN)
                        {
                            if (LogicDataCenter.chartDataManager.SkinChartList.PersonalRank % ContainerList[(int)pageType].childCount == 0)
                            {
                                m_RankingPage = LogicDataCenter.chartDataManager.SkinChartList.PersonalRank / ContainerList[(int)pageType].childCount;
                                m_RankingPage--;

                                if (m_RankingPage < 0)
                                {
                                    m_RankingPage = 0;
                                }
                            }
                            else
                            {
                                m_RankingPage = LogicDataCenter.chartDataManager.SkinChartList.PersonalRank / ContainerList[(int)pageType].childCount;
                            }
                        }
                    }
                    else if (sortType == EMChartSortType.EMCHARTSORT_CLAN)
                    {
                        dataList = LogicDataCenter.chartDataManager.SkinChartList.ClanMemberDataList;
                    }
                    else if (sortType == EMChartSortType.EMCHARTSORT_FRIEND)
                    {
                        dataList = LogicDataCenter.chartDataManager.SkinChartList.FriendDataList;
                    }
                }

                int count      = ContainerList[(int)pageType].childCount;
                int startIndex = (page - 1) * count;

                if (!bRefresh)
                {
                    m_MaxPage = CalculateMaxPage(dataList.Count, count);
                }

                for (int i = 0; i < count; i++)
                {
                    Transform trs = ContainerList[(int)pageType].GetChild(i);
                    if (trs != null)
                    {
                        SkinChartItem item = trs.GetComponent <SkinChartItem>();
                        if (item != null)
                        {
                            item.Clear();
                            if (startIndex + i < dataList.Count)
                            {
                                item.SetData(dataList[startIndex + i]);
                            }
                        }
                    }
                }
            }
            break;

            case EmCollectionChartPageType.EMCOLLECTIONCHART_GEM:
            {
                List <cmd_entity_gemstone_order_info> dataList = new List <cmd_entity_gemstone_order_info>();
                if (bIsQuery)
                {
                    dataList = LogicDataCenter.chartDataManager.GemStoneChartList.tmpDataList;
                }
                else
                {
                    if (sortType == EMChartSortType.EMCHARTSORT_DISTRICT)
                    {
                        dataList = LogicDataCenter.chartDataManager.GemStoneChartList.AllDataList;
                        if (collectionChartWnd.CurrentPageType == EmCollectionChartPageType.EMCOLLECTIONCHART_GEM)
                        {
                            if (LogicDataCenter.chartDataManager.GemStoneChartList.PersonalRank % ContainerList[(int)pageType].childCount == 0)
                            {
                                m_RankingPage = LogicDataCenter.chartDataManager.GemStoneChartList.PersonalRank / ContainerList[(int)pageType].childCount;
                                m_RankingPage--;

                                if (m_RankingPage < 0)
                                {
                                    m_RankingPage = 0;
                                }
                            }
                            else
                            {
                                m_RankingPage = LogicDataCenter.chartDataManager.GemStoneChartList.PersonalRank / ContainerList[(int)pageType].childCount;
                            }
                        }
                    }
                    else if (sortType == EMChartSortType.EMCHARTSORT_CLAN)
                    {
                        dataList = LogicDataCenter.chartDataManager.GemStoneChartList.ClanMemberDataList;
                    }
                    else if (sortType == EMChartSortType.EMCHARTSORT_FRIEND)
                    {
                        dataList = LogicDataCenter.chartDataManager.GemStoneChartList.FriendDataList;
                    }
                }

                int count      = ContainerList[(int)pageType].childCount;
                int startIndex = (page - 1) * count;

                if (!bRefresh)
                {
                    m_MaxPage = CalculateMaxPage(dataList.Count, count);
                }

                for (int i = 0; i < count; i++)
                {
                    Transform trs = ContainerList[(int)pageType].GetChild(i);
                    if (trs != null)
                    {
                        GemChartItem item = trs.GetComponent <GemChartItem>();
                        if (item != null)
                        {
                            item.Clear();
                            if (startIndex + i < dataList.Count)
                            {
                                item.SetData(dataList[startIndex + i]);
                            }
                        }
                    }
                }
            }
            break;

            default:
                break;
            }
        }
Exemplo n.º 5
0
 public void ShowSearchData(EmCollectionChartPageType type)
 {
     m_CurrentPage = 1;
     FillData(type, m_CurrentSortType, 1, true);
     CalculatePageState();
 }