public void OnOfflineTogChanged(bool bSelect) { CurSelectItem = null; ListKinMember.DataSource.BeginUpdate(); ListKinMember.DataSource.Clear(); List <cmd_kin_membernode> KinMemberList = LogicDataCenter.kinDataManager.LegendKinMemberList; for (int i = 0; i < KinMemberList.Count; ++i) { cmd_kin_membernode cmdNodeData = KinMemberList[i]; UListItemKinMember item = new UListItemKinMember(); Toggle tOffLineTog = OffLineTog.GetComponent <Toggle>(); if (!tOffLineTog.isOn && cmdNodeData.bIsOnline == 0) { // 隐藏不在线玩家 continue; } item.IdentityID = cmdNodeData.nIdentity; item.PlayerID = cmdNodeData.dwPDBID; item.GradIcon += cmdNodeData.szGradeName; item.PersonIcon = cmdNodeData.nFaceID; item.PersonName += cmdNodeData.szName; item.Power = cmdNodeData.dwBattleVal; item.PowerRank += cmdNodeData.dwBVOrder; item.GameState = cmdNodeData.byGameState; item.Level += cmdNodeData.nLevel; item.isOnline = cmdNodeData.bIsOnline; item.nSex = cmdNodeData.nSex; item.nLastOrder = cmdNodeData.dwLastOrder; item.nBVOrder = cmdNodeData.dwBVOrder; PopupAction = new UPopupAction(); if (EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID) != item.PlayerID) { PopupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(item.PlayerID)); PopupAction.Add(UPopupItemDataTeamInvite.GetDescString(), new UPopupItemDataTeamInvite(item.PlayerID)); PopupAction.Add(UPopupItemDataTeamRequest.GetDescString(), new UPopupItemDataTeamRequest(item.PlayerID)); } item.PopupAction = PopupAction; ListKinMember.DataSource.Add(item); } // 排序 IEnumerable <UListItemKinMember> ListQuery = from item in ListKinMember.DataSource orderby item.isOnline descending, item.IdentityID descending, item.Power descending select item; UIWidgets.ObservableList <UListItemKinMember> dataSource = new UIWidgets.ObservableList <UListItemKinMember>(); foreach (UListItemKinMember Item in ListQuery) { dataSource.Add(Item); } ListKinMember.DataSource = dataSource; ListKinMember.DataSource.EndUpdate(); }
// 接收杯赛战队信息 public void OnRecvLegendKinInfo(IntPtr ptr, int nLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen); m_LegendkinBaseData = helper.get <cmd_kin_basedata>(); m_LegendKinMemberList.Clear(); for (int i = 0; i < m_LegendkinBaseData.nMemberCount; ++i) { cmd_kin_membernode cmdNodeData = helper.get <cmd_kin_membernode>(); // 添加到数据管理中心 m_LegendKinMemberList.Add(cmdNodeData); } UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_KININFO_RECV, null); }