示例#1
0
 private void OnRankGridDataUpdate(UIGridBase data, int index)
 {
     if (data is UIRankGrid)
     {
         UIRankGrid rg = data as UIRankGrid;
         rg.SetRankIndex((uint)index);
         if (index < rankList.Count)
         {
             rg.SetGridData(rankList[index]);
             rg.SetSelect(false);
         }
     }
     else if (data is UICtrTypeGrid)
     {
         if (index < mlstFirstTabIds.Count)
         {
             UICtrTypeGrid grid = data as UICtrTypeGrid;
             grid.SetRedPointStatus(false);
             if (rankDic.ContainsKey((uint)(index + 1)))
             {
                 List <RankTypeDataBase> d = rankDic[(uint)(index + 1)];
                 if (index < mlstFirstTabIds.Count && d.Count > 0)
                 {
                     grid.SetData(mlstFirstTabIds[index], d[0].mainName, d.Count);
                 }
             }
         }
     }
 }
示例#2
0
    private void OnRankGridUIEvent(UIEventType eventType, object data, object param)
    {
        switch (eventType)
        {
        case UIEventType.Click:
            if (data is UISecondTypeGrid)
            {
                if (previous != null)
                {
                    previous.SetSelect(false);
                }
                UISecondTypeGrid sec = data as UISecondTypeGrid;
                SetSelectSecondType(sec.Data);
            }
            else if (data is UIRankGrid)
            {
                UIRankGrid grid = data as UIRankGrid;
                grid.SetSelect(true);

                if (previous == null)
                {
                    previous = grid;
                }
                else
                {
                    if (selectIndex != (int)grid.RankIndex)
                    {
                        previous.SetSelect(false);
                        previous    = grid;
                        selectIndex = (int)grid.RankIndex;
                    }
                }
                DataManager.Instance.Sender.RequestPlayerInfoForOprate(grid.PlayID, PlayerOpreatePanel.ViewType.Normal);
            }
            if (data is UICtrTypeGrid)
            {
                if (previous != null)
                {
                    previous.SetSelect(false);
                }
                UICtrTypeGrid tabGrid = data as UICtrTypeGrid;
                SetSelectFirstType((uint)tabGrid.ID);
            }
            break;
        }
    }