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; }
void SetSelectSecondTypeGrid(uint firstKeyId, uint secondKeyId) { UIGrowUpSecondTypeGrid grid = GetSecondTypeGrid(this.m_selectFirstKeyId, this.m_selectSecondKeyId); if (grid != null) { grid.SetSelect(false); } grid = GetSecondTypeGrid(firstKeyId, secondKeyId); if (grid != null) { grid.SetSelect(true); } this.m_selectSecondKeyId = secondKeyId; }
private void OnUpdateGrowUpSecondTypeGrid(UIGridBase gridBase, object id, int index) { UIGrowUpSecondTypeGrid grid = gridBase as UIGrowUpSecondTypeGrid; if (grid == null) { return; } Dictionary <uint, List <uint> > secondKeyDic; if (m_dicGrowUp.TryGetValue((uint)id, out secondKeyDic)) { List <uint> secondKeyIdList = secondKeyDic.Keys.ToList <uint>(); if (secondKeyIdList.Count > index) { uint secondKeyId = secondKeyIdList[index]; grid.SetData((uint)id, secondKeyId); grid.SetSelect((uint)id == m_selectFirstKeyId && secondKeyId == m_selectSecondKeyId); List <uint> idList; if (DataManager.Manager <GrowUpManager>().TryGetGrowUpIdListByKeyAndSecondkey((uint)id, secondKeyId, out idList)) { if (idList.Count > 0) { GrowUpDabaBase growUpDabaBase = GameTableManager.Instance.GetTableItem <GrowUpDabaBase>(idList[0]); if (growUpDabaBase == null) { return; } grid.SetName(growUpDabaBase.IndexTypeName); } } } } }