예제 #1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="panel"></param>
    /// <param name="nTabIndex">索引</param>
    /// <param name="nTabType">第几类页签</param>
    public void OnCilckTogglePanel(ref UIPanelBase panel, int nTabType, int nTabIndex)
    {
        if (null == panel)
        {
            return;
        }
        UIPanelManager.PanelTabData.PanelTabUnit unit = null;
        if (null == panel.PanelInfo || !panel.PanelInfo.PanelTaData.TryGetTabUnit(nTabIndex, out unit))
        {
            Engine.Utility.Log.Error("Panel LocalInfo Error id:{0}!", panel.PanelId);
            return;
        }
        int openLv = 0;

        if (!DataManager.Manager <GuideManager>().IsTabFuncOpen(unit.FuncID, out openLv))
        {
            TipsManager.Instance.ShowLocalFormatTips(LocalTextType.Trailer_Commond_xitongyeqiankaiqi, unit.EnumName, openLv);
            return;
        }
        bool reset = panel.OnTogglePanel(nTabType, nTabIndex);

        if (reset)
        {
            panel.dicActiveTabGrid[nTabType] = nTabIndex;
            Dictionary <int, UITabGrid> dicTabs = null;
            if (panel.dicUITabGrid.TryGetValue(nTabType, out dicTabs))
            {
                foreach (var item in dicTabs)
                {
                    item.Value.SetHightLight(item.Value.TabID == nTabIndex);
                }
            }
        }
    }