public void InitRankCell(GetNewFinalTrialRankResponse mresponse)
    {
        if (mUIDragonBallRankCellList.Count != 0)
        {
            return;
        }

        GameObject obj1 = PrefabLoader.loadFromPack("LS/pbLSDragonBallRankCell") as GameObject;

        int m_Length = 0;

        if (mresponse.data.ranklist.Length >= 50)
        {
            m_Length = 50;
        }
        else
        {
            m_Length = mresponse.data.ranklist.Length;
        }

        if (obj1 != null)
        {
            for (int i = 0; i < m_Length; i++)
            {
                GameObject go = NGUITools.AddChild(mRoot, obj1);
                go.gameObject.name = (1000 + i).ToString();
                UIDragonBallRankCell mm = go.gameObject.GetComponent <UIDragonBallRankCell>();
                mUIDragonBallRankCellList.Add(mm);
                mm.gameObject.SetActive(false);
            }
//			int _MaxItemNum = mresponse.data.ranklist.Length;
        }
    }
 public void SetFinalTrialRankData(BaseHttpRequest request, BaseResponse response)
 {
     ComLoading.Close();
     if (response != null && response.status != BaseResponse.ERROR)
     {
         HttpRequest httprequest = request as HttpRequest;
         if (httprequest.Act == HttpRequestFactory.ACTION_NEW_FINALTRIAL_GETRANK)
         {
             GetNewFinalTrialRankResponse mresponse = response as GetNewFinalTrialRankResponse;
             if (mresponse != null)
             {
                 if (mresponse.data == null)
                 {
                     ConsoleEx.DebugLog("CheckFinalTrialRankResponse's data is null");
                 }
                 else
                 {
                     mUIDragonBallRank.OnShow(mresponse);
                     InitRankCell(mresponse);
                     RefreshCell(true, mresponse);
                     UIGrid mm = mRoot.GetComponent <UIGrid>();
                     mm.Reposition();
                     if (mresponse.data.ranklist.Length <= 6)
                     {
                         mUIDragonBallRank.SetDragPanel(true);
                     }
                     else
                     {
                         mUIDragonBallRank.SetDragPanel(false);
                     }
                 }
             }
         }
         else if (httprequest.Act == HttpRequestFactory.ACTION_CHECK_TEAMRANKINFO)
         {
             GetNewFinalTrialRankCheckInfoResponse mresponse = response as GetNewFinalTrialRankCheckInfoResponse;
             if (mresponse != null)
             {
                 if (mUIDragonBallRankCheckInfo != null)
                 {
                     mUIDragonBallRankCheckInfo.gameObject.SetActive(true);
                     mUIDragonBallRankCheckInfo.OnShow(mresponse);
                 }
                 else
                 {
                     m_response = mresponse;
                     SetRankCheckInfoPanel(true);
                     mUIDragonBallRankCheckInfo.OnShow(mresponse);
                 }
             }
         }
     }
 }
    public void RefreshCell(bool key, GetNewFinalTrialRankResponse mresponse)
    {
        int mindex = 0;

        if (mresponse.data.ranklist.Length > 50)
        {
            mindex = 49;
        }
        else
        {
            mindex = mresponse.data.ranklist.Length - 1;
        }
        for (; mindex >= 0; mindex--)
        {
            mUIDragonBallRankCellList[mindex].OnShow(mindex, mresponse.data.ranklist[mindex]);
            mUIDragonBallRankCellList[mindex].gameObject.SetActive(true);
        }
    }
Example #4
0
 public void OnShow(GetNewFinalTrialRankResponse mresponse)
 {
     mGrid.Reposition();
     mView.ResetPosition();
 }