/// <summary> /// 选中一级页签 /// </summary> /// <param name="id"></param> /// <param name="instant"></param> void SetSelectCtrTypeGrid(uint id, bool instant = false) { Dictionary <uint, List <uint> > .KeyCollection kc = m_titleDic.Keys; List <uint> keyIdList = kc.ToList <uint>(); List <uint> titleIdList; if (id == m_selectTitleTypeId) { if (m_titleDic.TryGetValue(m_selectTitleTypeId, out titleIdList) && m_secondsTabCreator.IsOpen(keyIdList.IndexOf(m_selectTitleTypeId))) //以前选中的 { m_secondsTabCreator.Close(keyIdList.IndexOf(m_selectTitleTypeId), true); return; } } if (m_titleDic.TryGetValue(m_selectTitleTypeId, out titleIdList)) //以前选中的 { m_secondsTabCreator.Close(keyIdList.IndexOf(m_selectTitleTypeId), true); } if (m_titleDic.TryGetValue(id, out titleIdList)) //现在选中的 { m_secondsTabCreator.Open(keyIdList.IndexOf(id), instant); } m_selectTitleTypeId = id; }
void SetSelectCtrTypeGrid(uint id) { List <uint> keyIdList = m_dicGrowUp.Keys.ToList <uint>(); if (id == m_selectFirstKeyId) { if (m_SecondTabCreator.IsOpen(keyIdList.IndexOf(m_selectFirstKeyId))) { m_SecondTabCreator.Close(keyIdList.IndexOf(m_selectFirstKeyId)); return; } } if (keyIdList.Contains(m_selectFirstKeyId)) { m_SecondTabCreator.Close(keyIdList.IndexOf(m_selectFirstKeyId)); } if (keyIdList.Contains(id)) { m_SecondTabCreator.Open(keyIdList.IndexOf(id)); } //把之前选中的二级页签取消掉 UIGrowUpSecondTypeGrid grid = GetSecondTypeGrid(this.m_selectFirstKeyId, this.m_selectSecondKeyId); if (grid != null) { grid.SetSelect(false); } this.m_selectFirstKeyId = id; }
/// <summary> /// 设置选中第一分页 /// </summary> /// <param name="type"></param> private void SetSelectFirstType(uint id, bool force = false) { //点到 附近grid if (id == TeamDataManager.nearbyId) { OnClickFuJin(); m_selectTypeId = id; m_selectActivityId = 0; SetMatchBtn(m_selectTypeId); return; } //全部队伍 if (id == TeamDataManager.allTeamId) { OnClickAllTeam(); m_selectTypeId = id; m_selectActivityId = 0; SetMatchBtn(m_selectTypeId); return; } List <uint> typeIdList = m_dicActivity.Keys.ToList <uint>(); List <uint> teamActivityIdList; UITeamActivityParentGrid grid; if (id == m_selectTypeId) { if (m_dicActivity.TryGetValue(m_selectTypeId, out teamActivityIdList) && m_secondsTabCreator.IsOpen(typeIdList.IndexOf(m_selectTypeId))) { m_secondsTabCreator.Close(typeIdList.IndexOf(m_selectTypeId)); return; } } if (m_dicActivity.TryGetValue(m_selectTypeId, out teamActivityIdList)) { m_secondsTabCreator.Close(typeIdList.IndexOf(m_selectTypeId)); } if (m_dicActivity.TryGetValue(id, out teamActivityIdList)) { m_secondsTabCreator.Open(typeIdList.IndexOf(id)); } m_selectTypeId = id; SetMatchBtn(m_selectTypeId); }
/// <summary> /// 设置展开的宝石类型 /// </summary> /// <param name="gType">目标宝石类型</param> /// <param name="instant">是否直接展开不需要过度</param> private void SetActiveGemType(GameCmd.GemType gType, bool instant = false) { if (gType == GameCmd.GemType.GemType_None) { return; } if (null != mSecondsTabCreator) { UICtrTypeGrid ctgGrid = mSecondsTabCreator.GetGrid <UICtrTypeGrid>(mlstCanInlayGemType.IndexOf(m_emActiveGemType)); GemInlayUpdateData gemCurUpdateData = GetGemInlayUpdateData(); GemInlayUpdateData gemNextUpdateData = GetGemInlayUpdateData(gType); if (m_emActiveGemType == gType) { if (!mSecondsTabCreator.IsOpen(mlstCanInlayGemType.IndexOf(m_emActiveGemType)) || gemCurUpdateData.Count == 0) { mSecondsTabCreator.Close(mlstCanInlayGemType.IndexOf(m_emActiveGemType), true); m_emActiveGemType = GameCmd.GemType.GemType_None; TipsManager.Instance.ShowLocalFormatTips(LocalTextType.Gemstone_Commond_2); } else { TipsManager.Instance.ShowLocalFormatTips(LocalTextType.Gemstone_Commond_1); } return; } if (null != gemCurUpdateData && (gemCurUpdateData.Count == 0 || gemNextUpdateData.Count != 0)) { mSecondsTabCreator.Close(mlstCanInlayGemType.IndexOf(m_emActiveGemType), true); } if (null != gemNextUpdateData) { if (gemNextUpdateData.Count != 0) { m_emActiveGemType = gType; mSecondsTabCreator.Open(mlstCanInlayGemType.IndexOf(m_emActiveGemType), instant); } else { TipsManager.Instance.ShowLocalFormatTips(LocalTextType.Gemstone_Commond_2); } } } }