Exemple #1
0
        public void ShowHighLadderInfo(HighLadderArray ladderArray)
        {
            ListLadder.OnSelect.RemoveListener(onSelectLadder);
            ListLadder.onRightClick.RemoveListener(onSelectLadder);
            ListLadder.DataSource.Clear();
            UIWidgets.ObservableList <UListItemLadder> dataSource = new UIWidgets.ObservableList <UListItemLadder>();

            for (int i = 0; i < ladderArray.nLadderCount; i++)
            {
                UListItemLadder item = new UListItemLadder();
                item.OrderID      = ladderArray.allLadderInfo[i].OrderID;
                item.nPDBID       = ladderArray.allLadderInfo[i].nPDBID;
                item.PlayerName   = ladderArray.allLadderInfo[i].PlayerName;
                item.RankGrade    = ladderArray.allLadderInfo[i].RankGrade;
                item.RankScore    = ladderArray.allLadderInfo[i].RankScore;
                item.RankGradeDes = ladderArray.allLadderInfo[i].RankGradeDes;
                PopupAction       = new UPopupAction();
                PopupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(item.nPDBID));
                item.PopupAction = PopupAction;

                dataSource.Add(item);
            }

            ListLadder.DataSource = dataSource;
            ListLadder.OnSelect.AddListener(onSelectLadder);
            ListLadder.onRightClick.AddListener(onSelectLadder);
        }
Exemple #2
0
        public void OnRecvHighLadder(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper    helper      = new IntPtrVaArgParseHelper(ptr, nLen);
            cmd_Entity_Rank_Info_head nCountdata  = helper.get <cmd_Entity_Rank_Info_head>();
            HighLadderArray           ladderArray = new HighLadderArray(nCountdata.nCount);

            ladderArray.nLadderCount = nCountdata.nCount;
            for (int i = 0; i < nCountdata.nCount; i++)
            {
                cmd_Entity_HighLadder_Rank_Info data = helper.get <cmd_Entity_HighLadder_Rank_Info>();
                HighLadderInfo ladderInfo            = new HighLadderInfo();
                ladderInfo.OrderID           = data.nOrderID;
                ladderInfo.nPDBID            = (int)data.idActor;
                ladderInfo.PlayerName        = data.szPlayerName;
                ladderInfo.RankGrade         = data.nRankGrade;
                ladderInfo.RankScore         = data.nRankScore;
                ladderInfo.RankGradeDes      = data.szGradeName;
                ladderArray.allLadderInfo[i] = ladderInfo;
            }
            if (view != null)
            {
                view.ShowHighLadderInfo(ladderArray);
            }
        }