public void ShowContentPage(EMRoleChartPageType 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 EMRoleChartPageType.EMROLECHART_RANK: { data.nRanking = LogicDataCenter.chartDataManager.RoleRankList.PersonalRank; } break; case EMRoleChartPageType.EMROLECHART_LEGENDARY: { data.nRanking = LogicDataCenter.chartDataManager.KillRankList.PersonalRank; } break; } UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_REFRESHCHARTRANKINGDATA, data); }
public void RefreshChartData(EMRoleChartPageType type) { if (roleChartWnd.CurrentPageType == type) { roleChartWnd.SwitchContentPage(type); } else { FillData(type, EMChartSortType.EMCHARTSORT_DISTRICT, 1, false, true); } }
//切换页面Wnd public void SwitchContentPage(EMRoleChartPageType pageType) { if (m_wndView == null) { return; } m_CurrentPageType = pageType; m_wndView.ShowContentPage(pageType); m_wndView.SetButtonSelect((int)m_CurrentPageType); }
private void FillData(EMRoleChartPageType pageType, EMChartSortType sortType, int page, bool bIsQuery, bool bRefresh = false) { switch (pageType) { case EMRoleChartPageType.EMROLECHART_RANK: { List <cmd_Entity_HighLadder_Rank_Info> dataList = new List <cmd_Entity_HighLadder_Rank_Info>(); if (bIsQuery) { dataList = LogicDataCenter.chartDataManager.RoleRankList.tmpDataList; } else { if (sortType == EMChartSortType.EMCHARTSORT_DISTRICT) { dataList = LogicDataCenter.chartDataManager.RoleRankList.AllDataList; if (roleChartWnd.CurrentPageType == EMRoleChartPageType.EMROLECHART_RANK) { if (LogicDataCenter.chartDataManager.RoleRankList.PersonalRank % ContainerList[(int)pageType].childCount == 0) { m_RankingPage = LogicDataCenter.chartDataManager.RoleRankList.PersonalRank / ContainerList[(int)pageType].childCount; m_RankingPage--; if (m_RankingPage < 0) { m_RankingPage = 0; } } else { m_RankingPage = LogicDataCenter.chartDataManager.RoleRankList.PersonalRank / ContainerList[(int)pageType].childCount; } } } else if (sortType == EMChartSortType.EMCHARTSORT_CLAN) { dataList = LogicDataCenter.chartDataManager.RoleRankList.ClanMemberDataList; } else if (sortType == EMChartSortType.EMCHARTSORT_FRIEND) { dataList = LogicDataCenter.chartDataManager.RoleRankList.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) { RoleRankItem item = trs.GetComponent <RoleRankItem>(); if (item != null) { item.Clear(); if (startIndex + i < dataList.Count) { item.SetData(dataList[startIndex + i]); } } } } } break; case EMRoleChartPageType.EMROLECHART_LEGENDARY: { List <cmd_entity_kill_order_info> dataList = new List <cmd_entity_kill_order_info>(); if (bIsQuery) { dataList = LogicDataCenter.chartDataManager.KillRankList.tmpDataList; } else { if (sortType == EMChartSortType.EMCHARTSORT_DISTRICT) { dataList = LogicDataCenter.chartDataManager.KillRankList.AllDataList; if (roleChartWnd.CurrentPageType == EMRoleChartPageType.EMROLECHART_LEGENDARY) { if (LogicDataCenter.chartDataManager.KillRankList.PersonalRank % ContainerList[(int)pageType].childCount == 0) { m_RankingPage = LogicDataCenter.chartDataManager.KillRankList.PersonalRank / ContainerList[(int)pageType].childCount; m_RankingPage--; if (m_RankingPage < 0) { m_RankingPage = 0; } } else { m_RankingPage = LogicDataCenter.chartDataManager.KillRankList.PersonalRank / ContainerList[(int)pageType].childCount; } } } else if (sortType == EMChartSortType.EMCHARTSORT_CLAN) { dataList = LogicDataCenter.chartDataManager.KillRankList.ClanMemberDataList; } else if (sortType == EMChartSortType.EMCHARTSORT_FRIEND) { dataList = LogicDataCenter.chartDataManager.KillRankList.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) { RoleKillItem item = trs.GetComponent <RoleKillItem>(); if (item != null) { item.Clear(); if (startIndex + i < dataList.Count) { item.SetData(dataList[startIndex + i]); } } } } } break; default: break; } }
public void ShowSearchData(EMRoleChartPageType type) { m_CurrentPage = 1; FillData(type, m_CurrentSortType, 1, true); CalculatePageState(); }