private void UpdateActivateRemove(Muhon data) { if (null == data) { return; } bool isActive = (data.AdditionAttrCount != 0) ? true : false; if (null != m_label_ActiveRemoveName) { m_label_ActiveRemoveName.text = data.Name; } //刷新圣魂升级信息 if (null != m_activeRemoveGrow) { m_activeRemoveGrow.SetGridData(data.QWThisID); } if (null != m_grid_ActivePropertyRoot && m_grid_ActivePropertyRoot.gameObject.activeSelf != isActive) { m_grid_ActivePropertyRoot.gameObject.SetActive(isActive); } if (isActive) { CheckActiveRemovePropertySelect(); List <GameCmd.PairNumber> attrPairs = data.GetAdditiveAttr(); GameCmd.PairNumber pair = null; UIMuhonPropertySelectGrid tempGrid = null; int gridCount = mlstMuhonPropertySelects.Count; for (int i = 0; i < gridCount; i++) { tempGrid = mlstMuhonPropertySelects[i]; if (null != attrPairs && attrPairs.Count > i) { if (!tempGrid.Visible) { tempGrid.SetVisible(true); } pair = attrPairs[i]; tempGrid.SetGridView(pair.id, emgr.GetAttrDes(pair), emgr.GetAttrGrade(pair), mlstSelectRemoveAttrs.Contains(pair.id)); } else if (tempGrid.Visible) { tempGrid.SetVisible(false); } } } //设置辅助 SetActivateRemoveAssist(); UpdateActiveRemoveState(data, isActive); }
private void UpdateUI() { Muhon itemData = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Muhon>(blendMuhonId); if (null == itemData) { Engine.Utility.Log.Error("MuhonBlendCompletePanel UpdateUI faield get itemData null"); return; } EquipManager emgr = DataManager.Manager <EquipManager>(); if (null != m_showGrid) { m_showGrid.SetGridData(blendMuhonId); } if (null != m_label_EquipName) { m_label_EquipName.text = itemData.Name; } //更新属性信息 List <GameCmd.PairNumber> attrPairs = itemData.GetAdditiveAttr(); GameCmd.PairNumber pair = null; UIProperyGradeGrid tempGrid = null; int gridCount = mlstGrids.Count; for (int i = 0; i < gridCount; i++) { tempGrid = mlstGrids[i]; if (null != attrPairs && attrPairs.Count > i) { if (!tempGrid.Visible) { tempGrid.SetVisible(true); } pair = attrPairs[i]; tempGrid.SetGridView(emgr.GetAttrDes(pair), emgr.GetAttrGrade(pair), emgr.IsAttrGradeMax(pair)); } else if (tempGrid.Visible) { tempGrid.SetVisible(false); } } }
private void UpdateUI() { EquipManager emgr = DataManager.Manager <EquipManager>(); Muhon curMuhon = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Muhon>(evolveMuhonId); if (null == curMuhon || null == curMuhon.Pre) { TipsManager.Instance.ShowTips("进化完成数据错误!"); return; } if (null != mShowGrid) { mShowGrid.SetGridData(evolveMuhonId); } if (null != m_label_MuhonName) { m_label_MuhonName.text = curMuhon.Name; } if (null != m_label_MuhonLv) { m_label_MuhonLv.text = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.Local_TXT_Soul_ColorLv , "", "", curMuhon.Level, curMuhon.MaxLv); } if (null != m_label_AttrNumPre) { m_label_AttrNumPre.text = DataManager.Manager <TextManager>() .GetLocalFormatText(LocalTextType.Local_TXT_Soul_Num, curMuhon.Pre.MuhonAttrUpLimit); } if (null != m_label_AttrNumCur) { m_label_AttrNumCur.text = DataManager.Manager <TextManager>() .GetLocalFormatText(LocalTextType.Local_TXT_Soul_Num, curMuhon.MuhonAttrUpLimit); } List <EquipDefine.EquipBasePropertyData> curBaseProperyList = emgr.GetWeaponSoulBasePropertyData(curMuhon.BaseId, 1); List <EquipDefine.EquipBasePropertyData> preBaseProperyList = emgr.GetWeaponSoulBasePropertyData(curMuhon.Pre.BaseId, (int)curMuhon.Pre.MaxLv); EquipDefine.EquipBasePropertyData temp = null; Transform tempTrans = null; Vector3 baseLastPos = gapWidget; if (null != m_lstBaseAttr) { for (int i = 0, max = m_lstBaseAttr.Count; i < max; i++) { tempTrans = m_lstBaseAttr[i]; if (null == tempTrans) { continue; } if (null != curBaseProperyList && curBaseProperyList.Count > i && null != preBaseProperyList && preBaseProperyList.Count > i) { if (!tempTrans.gameObject.activeSelf) { tempTrans.gameObject.SetActive(true); } tempTrans.Find("Content/Name").GetComponent <UILabel>().text = curBaseProperyList[i].Name; tempTrans.Find("Content/CurV").GetComponent <UILabel>().text = preBaseProperyList[i].ToString(); tempTrans.Find("Content/NextV").GetComponent <UILabel>().text = curBaseProperyList[i].ToString(); } else { if (tempTrans.gameObject.activeSelf) { tempTrans.gameObject.SetActive(false); } if (i == (max - 1)) { Vector3 tempV = tempTrans.position; tempV = tempTrans.TransformPoint(tempV); tempV = m_scrollview_AttrContent.transform.InverseTransformPoint(tempV); baseLastPos.y = tempV.y; } } } } List <GameCmd.PairNumber> addtive = curMuhon.GetAdditiveAttr(); if (null != m_lstAddtiveAttr) { for (int i = 0, max = m_lstAddtiveAttr.Count; i < max; i++) { tempTrans = m_lstAddtiveAttr[i]; if (null == tempTrans) { continue; } if (null != addtive && addtive.Count > i) { if (!tempTrans.gameObject.activeSelf) { tempTrans.gameObject.SetActive(true); } tempTrans.Find("Grade").GetComponent <UILabel>().text = emgr.GetAttrGrade(addtive[i]).ToString(); tempTrans.Find("Des").GetComponent <UILabel>().text = emgr.GetAttrDes(addtive[i]); } else if (tempTrans.gameObject.activeSelf) { tempTrans.gameObject.SetActive(false); } } } bool additiveVisible = (null != addtive && addtive.Count != 0); if (null != m_trans_AddtiveAttrContent) { if (m_trans_AddtiveAttrContent.gameObject.activeSelf != additiveVisible) { m_trans_AddtiveAttrContent.gameObject.SetActive(additiveVisible); } if (additiveVisible) { m_trans_AddtiveAttrContent.transform.localPosition = gapWidget; } } if (null != m_scrollview_AttrContent) { m_scrollview_AttrContent.ResetPosition(); } }
private void UpdateBlend(Muhon data) { if (null == data) { return; } Muhon blendData = (blendSelectMuhonId != 0) ? imgr.GetBaseItemByQwThisId <Muhon>(blendSelectMuhonId) : null; //刷新圣魂升级信息 if (null != m_blendCurGrow) { m_blendCurGrow.SetGridData(data.QWThisID); } if (null != m_blendNextGrow) { m_blendNextGrow.SetGridData((null != blendData) ? blendData.QWThisID : 0); } bool choose = (blendSelectMuhonId != 0 && imgr.ExistItem(blendSelectMuhonId)) ? true : false; int attrOpenNum = (data.StartLevel == 0) ? 1 : (int)data.StartLevel; //<id,是否为原属性> Dictionary <uint, bool> retainAdditiveAttrDic = new Dictionary <uint, bool>(); //Cur Additive Attr Dictionary <uint, GameCmd.PairNumber> curAddtiveAttrsDic = new Dictionary <uint, GameCmd.PairNumber>(); foreach (GameCmd.PairNumber pair in data.GetAdditiveAttr()) { curAddtiveAttrsDic.Add(pair.id, pair); } //Blend Additive Attr Dictionary <uint, GameCmd.PairNumber> blendAddtiveAttrsDic = new Dictionary <uint, GameCmd.PairNumber>(); if (null != blendData) { foreach (GameCmd.PairNumber pair in blendData.GetAdditiveAttr()) { blendAddtiveAttrsDic.Add(pair.id, pair); } } if (null != m_btn_BlendUnload && m_btn_BlendUnload.gameObject.activeSelf != choose) { m_btn_BlendUnload.gameObject.SetActive(choose); } if (choose) { bool inCur = true; foreach (GameCmd.PairNumber pairCur in curAddtiveAttrsDic.Values) { if (retainAdditiveAttrDic.Count >= attrOpenNum) { continue; } inCur = true; if (blendAddtiveAttrsDic.ContainsKey(pairCur.id) && blendAddtiveAttrsDic[pairCur.id].value > pairCur.value) { inCur = false; } retainAdditiveAttrDic.Add(pairCur.id, inCur); } foreach (GameCmd.PairNumber pairBlend in blendAddtiveAttrsDic.Values) { if (retainAdditiveAttrDic.Count >= attrOpenNum) { continue; } if (!retainAdditiveAttrDic.ContainsKey(pairBlend.id)) { retainAdditiveAttrDic.Add(pairBlend.id, false); } } } List <GameCmd.PairNumber> curTempAttrList = new List <GameCmd.PairNumber>(curAddtiveAttrsDic.Values); List <GameCmd.PairNumber> blendTempAttrList = new List <GameCmd.PairNumber>(blendAddtiveAttrsDic.Values); string attrDes; bool chooseAttr = false; uint attrGrade = 0; UIMuhonPropertyGrid muhonGrid = null; GameCmd.PairNumber pairNum = null; int index = 0; for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.First; i <= EquipDefine.AttrIndex.Fifth; i++) { index = (int)i - 1; //填充当前圣魂属性 if (m_dic_currentAttrs.TryGetValue(i, out muhonGrid)) { if ((index + 1) <= attrOpenNum) { if (curTempAttrList.Count > index) { pairNum = curTempAttrList[index]; attrDes = emgr.GetAttrDes(pairNum); chooseAttr = (retainAdditiveAttrDic.ContainsKey(pairNum.id) && retainAdditiveAttrDic[pairNum.id]) ? true : false; attrGrade = emgr.GetAttrGrade(pairNum); muhonGrid.SetGridView(true, false, txt: attrDes, needMask: choose, grade: attrGrade, check: chooseAttr); } else { muhonGrid.SetGridView(true); } } else { muhonGrid.SetGridView(false, lockDes: tmgr.GetMuhonAttrLockDes(i)); } } //填充融合圣魂属性 if (m_dic_blendAtrs.TryGetValue(i, out muhonGrid)) { if ((index + 1) <= attrOpenNum) { if (blendTempAttrList.Count > index) { pairNum = blendTempAttrList[index]; attrDes = emgr.GetAttrDes(pairNum); chooseAttr = (retainAdditiveAttrDic.ContainsKey(pairNum.id) && !retainAdditiveAttrDic[pairNum.id]) ? true : false; attrGrade = emgr.GetAttrGrade(pairNum); muhonGrid.SetGridView(true, false, txt: attrDes, needMask: choose, grade: attrGrade, check: chooseAttr); } else { muhonGrid.SetGridView(true); } } else { muhonGrid.SetGridView(false, lockDes: tmgr.GetMuhonAttrLockDes(i)); } } } //显示Tips if (null != m_trans_BlendTips && m_trans_BlendTips.gameObject.activeSelf != choose) { m_trans_BlendTips.gameObject.SetActive(choose); } //辅助 SetBlendAssist(); }