Beispiel #1
0
 private void OnUpdateGridData(UIGridBase grid, int index)
 {
     if (grid is UICtrTypeGrid)
     {
         UICtrTypeGrid tabGrid = grid as UICtrTypeGrid;
         if (tabGrid != null)
         {
             if (index == 0)
             {
                 int haveNum  = 0;
                 int totalNum = 0;
                 achievementManager.GetGainAchieveNum(out haveNum, out totalNum);
                 string titleTips = "综合";
                 tabGrid.SetRedPointStatus(achievementManager.HaveCanReceiveAchieveByType((uint)index));
                 if (index < mlstFirstTabIds.Count)
                 {
                     tabGrid.SetData(mlstFirstTabIds[index], titleTips, 0);
                 }
             }
             else
             {
                 AchievementDataBase achievementData = achievementManager.GetParentAchievementData(index);
                 if (achievementData != null)
                 {
                     int haveNum  = 0;
                     int totalNum = 0;
                     int count    = 0;
                     if (achieveDic.ContainsKey((uint)index))
                     {
                         count = achieveDic[(uint)(index)].Count;
                     }
                     achievementManager.GetGainAchieveByType(achievementData.type, out haveNum, out totalNum);
                     string titleTips = string.Format("{0}({1}/{2})", achievementData.typeName, haveNum, totalNum);
                     tabGrid.SetRedPointStatus(achievementManager.HaveCanReceiveAchieveByType((uint)index));
                     if (index < mlstFirstTabIds.Count)
                     {
                         tabGrid.SetData(mlstFirstTabIds[index], titleTips, count);
                     }
                 }
             }
         }
     }
     else if (grid is UIAchievemenGrid)
     {
         UIAchievemenGrid achieveGrid = grid as UIAchievemenGrid;
         if (null != achieveGrid)
         {
             AchieveData achieveData = dailyAchieveDataList.Count > index ? dailyAchieveDataList[index] : null;
             achieveGrid.UpdateItemInfo(achieveData);
             achieveGrid.SetGridData(index);
             achieveGrid.SetSelect(false);
         }
     }
 }
Beispiel #2
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);
                 }
             }
         }
     }
 }
Beispiel #3
0
    /// <summary>
    /// 跟新一级页签数据
    /// </summary>
    /// <param name="gridBase"></param>
    /// <param name="index"></param>
    private void OnUpdateTitileCtrTypeGrid(UIGridBase gridBase, int index)
    {
        if (m_titleDic != null && m_titleDic.Keys.Count > index)
        {
            UICtrTypeGrid grid = gridBase as UICtrTypeGrid;
            if (grid == null)
            {
                return;
            }

            Dictionary <uint, List <uint> > .KeyCollection kc = m_titleDic.Keys;
            List <uint> keyIdList = kc.ToList <uint>();
            uint        keyId     = keyIdList[index];

            List <uint> secondIdList;
            if (m_titleDic.TryGetValue(keyId, out secondIdList))
            {
                if (secondIdList.Count == 0)
                {
                    return;
                }
                TitleDataBase tdb = m_lstTableTitle.Find((d) => { return(d.dwID == secondIdList[0]); });

                //数据
                grid.SetData(keyId, tdb != null ? tdb.secondTypeName : "", secondIdList.Count);

                //红点
                bool haveNewTitle = HaveNewTilteInList(secondIdList);
                grid.SetRedPointStatus(haveNewTitle);
            }
        }
    }
Beispiel #4
0
    /// <summary>
    /// 镶嵌格子数据刷新回调
    /// </summary>
    /// <param name="grid"></param>
    /// <param name="index"></param>
    private void OnUpdateInlayGrid(UIGridBase grid, int index)
    {
        if (grid is UICtrTypeGrid)
        {
            UICtrTypeGrid ctg = grid as UICtrTypeGrid;
            if (mlstCanInlayGemType.Count > index)
            {
                GameCmd.GemType gemType = mlstCanInlayGemType[index];

                GemInlayUpdateData updateData = GetGemInlayUpdateData(gemType);
                int num = (null != updateData) ? updateData.Count : 0;
                ctg.SetData(gemType, DataManager.Manager <TextManager>().GetGemNameByType(gemType), num);
                ctg.SetRedPointStatus(DataManager.Manager <ForgingManager>().HaveGemCanImprove(m_emSelectInlayPos, gemType));
            }
        }
        else if (grid is UIEquipPosStatusGrid)
        {
            UIEquipPosStatusGrid posGrid = grid as UIEquipPosStatusGrid;
            GameCmd.EquipPos     pos     = GetEquipPosByIndex(index);
            bool isInlay = IsPanelMode(ForgingPanelMode.Inlay);
            posGrid.SetGridViewData(pos, isInlay);
            posGrid.SetHightLight(pos == m_emSelectInlayPos);
            if (isInlay)
            {
                Gem    gem              = null;
                uint   inLayGemBaseId   = 0;
                string inlayGemIconName = "";
                bool   inlay            = false;
                bool   unlock           = false;
                for (EquipManager.EquipGridIndexType i = EquipManager.EquipGridIndexType.First; i < EquipManager.EquipGridIndexType.Max; i++)
                {
                    inlayGemIconName = "";
                    inlay            = false;
                    unlock           = false;
                    if (i < 0)
                    {
                        continue;
                    }

                    if (emgr.TryGetEquipGridInlayGem(pos, i, out inLayGemBaseId))
                    {
                        gem = DataManager.Manager <ItemManager>()
                              .GetTempBaseItemByBaseID <Gem>(inLayGemBaseId, ItemDefine.ItemDataType.Gem);
                        inlayGemIconName = gem.Icon;
                        unlock           = true;
                        inlay            = true;
                    }
                    else if (emgr.IsUnlockEquipGridIndex(i))
                    {
                        unlock = true;
                    }
                    posGrid.SetInlayIcon(i, unlock, inlay, inlayGemIconName);
                }
            }
        }
    }
Beispiel #5
0
    void UpdataTypeGrid(int index)
    {
        List <RankTypeDataBase> d       = rankDic[(uint)(index + 1)];
        UICtrTypeGrid           tabGrid = mSecondTabCreator.GetGrid <UICtrTypeGrid>(index);

        if (tabGrid != null)
        {
            tabGrid.SetGridData((uint)index);
            tabGrid.SetName(d[0].mainName);
            tabGrid.SetRedPointStatus(false);
        }
    }
Beispiel #6
0
    /// <summary>
    /// 可合成装备红点提示
    /// </summary>
    private void UpdateCanComposeRedPoint()
    {
        UITypeGrid tGrid = null;

        if (null != mSecondTabCreator)
        {
            UICtrTypeGrid ctg = mSecondTabCreator.GetGrid <UICtrTypeGrid>(0);
            if (null != ctg)
            {
                List <uint> datas = m_mgr.GetCanComposeItemIds();
                ctg.SetRedPointStatus((null != datas && datas.Count != 0));
            }
        }
    }
Beispiel #7
0
    /// <summary>
    /// 跟新一级页签数据
    /// </summary>
    /// <param name="gridBase"></param>
    /// <param name="index"></param>
    private void OnUpdateMissionCtrTypeGrid(UIGridBase gridBase, int index)
    {
        if (taskTypeList != null && taskTypeList.Count > index)
        {
            UICtrTypeGrid grid = gridBase as UICtrTypeGrid;
            if (grid == null)
            {
                return;
            }

            List <QuestTraceInfo> taskList = GetQuestListByType(taskTypeList[index]);

            //数据
            grid.SetData(taskTypeList[index], taskTypeList[index].GetEnumDescription(), taskList != null ? taskList.Count : 0);
            grid.SetRedPointStatus(false);
        }
    }
Beispiel #8
0
    /// <summary>
    /// 取消红点提示
    /// </summary>
    /// <param name="titleId"></param>
    public void CancelNewTitleRedPoint(uint firstKeyId, uint titleId)
    {
        //1、 清数据
        if (TManager.IsNewTitle(titleId))
        {
            TManager.NewTitleIdList.Remove(titleId);

            //检查主界面红点提示
            stShowMainPanelRedPoint st = new stShowMainPanelRedPoint()
            {
                modelID   = (int)WarningEnum.TITLE_NEWTITLE,
                direction = (int)WarningDirection.Left,
                bShowRed  = TManager.HaveNewTitle(),
            };
            EventEngine.Instance().DispatchEvent((int)GameEventID.MAINPANEL_SHOWREDWARING, st);
        }

        //2、 下面的一级页签
        if (m_secondsTabCreator != null)
        {
            List <uint> titleIdList;
            if (m_titleDic.TryGetValue(firstKeyId, out titleIdList))
            {
                bool haveNewTitle = HaveNewTilteInList(titleIdList);

                List <uint>   firstKeyIdList = m_titleDic.Keys.ToList <uint>();
                UICtrTypeGrid ctrTypeGrid    = m_secondsTabCreator.GetGrid <UICtrTypeGrid>(firstKeyIdList.IndexOf(firstKeyId));
                if (ctrTypeGrid != null)
                {
                    ctrTypeGrid.SetRedPointStatus(haveNewTitle);
                }
            }
        }

        //3、最上面的grid
        SetTopCategoryGridNewMark(HaveNewTilteInList(m_lstTitleData));
    }
Beispiel #9
0
 /// <summary>
 /// 格子更新
 /// </summary>
 /// <param name="gridBase"></param>
 /// <param name="index"></param>
 private void OnGridUpdate(UIGridBase gridBase, int index)
 {
     if (gridBase is UIComposeGrid)
     {
         UIComposeGrid cGrid = gridBase as UIComposeGrid;
         if (m_list_composeDatas.Count > index)
         {
             cGrid.SetGridData(m_list_composeDatas[index]);
             cGrid.SetHightLight(m_uint_composeId == m_list_composeDatas[index]);
         }
     }
     else if (gridBase is UICtrTypeGrid)
     {
         if (index < mlstFirstTabIds.Count)
         {
             UICtrTypeGrid    ctg  = gridBase as UICtrTypeGrid;
             CategoryTypeData fctd = null;
             if (index == 0)
             {
                 fctd = new CategoryTypeData(0, "可合成");
                 ctg.EnableArrow(false);
             }
             else
             {
                 ctg.SetRedPointStatus(false);
                 fctd = m_mgr.GetCategoryTypeDataByType(CategoryTypeData.CategoryType.First
                                                        , mlstFirstTabIds[index]);
             }
             if (null != fctd)
             {
                 ctg.SetData(fctd.m_uint_categoryId
                             , fctd.m_str_categoryName
                             , fctd.Count);
             }
         }
     }
 }