Esempio n. 1
0
 private void OnUpdateGridBase(UIGridBase grid, int index)
 {
     if (grid is UIClanDecareWaRivalryGrid)
     {
         if (null == m_lst_datas || m_lst_datas.Count <= index)
         {
             return;
         }
         UIClanDecareWaRivalryGrid dwGrid = grid as UIClanDecareWaRivalryGrid;
         GameCmd.stWarClanInfo     info   = null;
         if (m_em_cur == ClanDeclareMode.History)
         {
             info = DataManager.Manager <ClanManger>().GetClanRivalryHistoryInfo(m_lst_datas[index]);
         }
         else if (m_em_cur == ClanDeclareMode.Search)
         {
             info = DataManager.Manager <ClanManger>().GetClanDeclareWarSerchInfo(m_lst_datas[index]);
         }
         dwGrid.SetGridData(info);
     }
 }
Esempio n. 2
0
    /// <summary>
    /// 格子刷新回调
    /// </summary>
    /// <param name="grid"></param>
    /// <param name="index"></param>
    private void OnUpdateUIGrid(UIGridBase grid, int index)
    {
        if (grid is UIClanTaskGrid)
        {
            if (null != m_list_taskInfos && m_list_taskInfos.Count > index)
            {
                uint           id           = m_list_taskInfos[index];
                UIClanTaskGrid clanTaskGrid = grid as UIClanTaskGrid;
                clanTaskGrid.SetGridData(m_mgr.GetClanQuestInfo(id));
            }
            else
            {
                Engine.Utility.Log.Error("ClanTask OnUpdateUIGrid error");
            }
        }
        else if (grid is UIClanApplyGrid)
        {
            UIClanApplyGrid caGrid = grid as UIClanApplyGrid;
            if (null != caGrid && null != m_list_applyUserIds && m_list_applyUserIds.Count > index)
            {
                caGrid.SetGridData(m_mgr.GetClanApplyUserInfo(m_list_applyUserIds[index]));
            }
        }
        else if (grid is UIClanDonateGrid)
        {
            UIClanDonateGrid cdGrid = grid as UIClanDonateGrid;
            if (null != cdGrid && null != m_list_donateDatas && m_list_donateDatas.Count > index)
            {
                ClanDefine.LocalClanDonateDB cdDB
                    = m_mgr.GetLocalDonateDB(m_list_donateDatas[index]);
                cdGrid.RegisterDonateAction(DoDonate);
                if (null != cdDB)
                {
                    cdGrid.SetGridData(cdDB);
                }
            }
        }
        else if (grid is UIClanMemberGrid)
        {
            UIClanMemberGrid cmGrid = grid as UIClanMemberGrid;
            //ClanDefine.LocalClanInfo clanInfo = ClanInfo;
            if (null != cmGrid && index < m_list_memberdatas.Count)
            {
                cmGrid.SetGridData(m_list_memberdatas[index]);
                cmGrid.SetHightLight((m_uint_selectmemberid == m_list_memberdatas[index]) ? true : false);
                cmGrid.SetBackGround(index);
            }
        }
        else if (grid is UIClanSkillGrid)
        {
            UIClanSkillGrid csGrid = grid as UIClanSkillGrid;
            if (null != csGrid && null != m_list_clanSkillIds && m_list_clanSkillIds.Count > index)
            {
                uint skillId = m_list_clanSkillIds[index];
                csGrid.SetGridData(m_list_clanSkillIds[index]);
                table.SkillDatabase skillDB = GameTableManager.Instance.GetTableItem <table.SkillDatabase>(skillId, 1);
                if (null != skillDB)
                {
                    bool select = (m_uint_SelectSkillId == skillId) ? true : false;

                    uint lv1    = 0;
                    uint lv2    = 0;
                    bool isLock = false;
                    if (IsSkillMode(ClanSkillMode.Learn))
                    {
                        lv1    = m_mgr.GetClanSkillLearnLv(skillId);
                        lv2    = m_mgr.GetClanSkillDevLv(skillId);
                        isLock = (lv1 >= lv2);
                    }
                    else if (IsSkillMode(ClanSkillMode.Dev))
                    {
                        lv1 = m_mgr.GetClanSkillDevLv(skillId);
                        lv2 = skillDB.dwMaxLevel;
                    }

                    csGrid.SetInfo(skillDB.strName
                                   , string.Format("{0}/{1}", lv1, lv2)
                                   , skillDB.iconPath
                                   , select, isLock);
                }
            }
        }
        else if (grid is UIClanHonorGrid)
        {
            UIClanHonorGrid cdGrid = grid as UIClanHonorGrid;
            if (null != cdGrid && null != m_list_honorInfos && m_list_honorInfos.Count > index)
            {
                cdGrid.SetGridData(m_list_honorInfos[index]);
            }
        }
        else if (grid is UIClanDecareWaRivalryGrid)
        {
            UIClanDecareWaRivalryGrid dwg = grid as UIClanDecareWaRivalryGrid;
            if (null != m_lst_Rivalry && m_lst_Rivalry.Count > index)
            {
                dwg.SetGridData(m_mgr.GetClanRivalryInfo(m_lst_Rivalry[index]));
            }
        }
        else if (grid is UIClanDeclareWarGrid)
        {
            UIClanDeclareWarGrid dwg = grid as UIClanDeclareWarGrid;
            if (null != m_lst_Rivalry && m_lst_Rivalry.Count > index)
            {
                dwg.SetGridData(m_mgr.GetClanRivalryInfo(m_lst_Rivalry[index]));
                dwg.SetIndex(index);
            }
        }
        else if (grid is UIClanTabGrid)
        {
            UIClanTabGrid tab = grid as UIClanTabGrid;
            tab.SetGridData(index);
            tab.SetName(m_list_tabContents[index]);
            if (index == 0 && previous == null)
            {
                previous = tab;
                tab.SetHightLight(true);
            }
        }
    }