/// <summary> /// 隐藏组件 /// </summary> private void DisableProccessGrid() { for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One ; i < ForgingProccessPropertyIndex.Max; i++) { if (m_dic_propCurGrids.ContainsKey(i) && m_dic_propCurGrids[i].Visible) { m_dic_propCurGrids[i].SetVisible(false); } if (m_dic_propNextGrids.ContainsKey(i) && m_dic_propNextGrids[i].Visible) { m_dic_propNextGrids[i].SetVisible(false); } if (m_dic_propCBs.ContainsKey(i) && m_dic_propCBs[i].gameObject.activeSelf) { m_dic_propCBs[i].gameObject.SetActive(false); m_dic_propCBs[i].value = false; } } if (null != m_trans_ArrowPromote && m_trans_ArrowPromote.gameObject.activeSelf) { m_trans_ArrowPromote.gameObject.SetActive(false); } if (null != m_label_ProccessTips && m_label_ProccessTips.gameObject.activeSelf) { m_label_ProccessTips.gameObject.SetActive(false); } }
/// <summary> /// /// </summary> /// <param name="clearIndex"></param> /// <param name="clearSelectRsId"></param> private void ResetProccess(bool clearIndex = true, bool clearSelectRsId = true) { if (clearIndex) { m_em_selectEquipAttrIndex = ForgingProccessPropertyIndex.None; if (null != m_dic_propCBs) { UIToggle toggle = null; for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One ; i < ForgingProccessPropertyIndex.Max; i++) { if (m_dic_propCBs.TryGetValue(i, out toggle) && null != toggle && toggle.value) { toggle.Set(false); } } } } if (clearSelectRsId) { m_uint_selectRSBaseId = 0; } }
/// <summary> /// 更新消除 /// </summary> internal void UpdateRemove() { bool isSelectRS = (m_uint_selectRSBaseId != 0); RuneStone rs = DataManager.Manager <ItemManager>() .GetTempBaseItemByBaseID <RuneStone>(m_uint_selectRSBaseId, ItemDefine.ItemDataType.RuneStone); uint num = (isSelectRS) ? (uint)imgr.GetItemNumByBaseId(m_uint_selectRSBaseId) : 0; if (null != m_processRsGrowShow) { m_processRsGrowShow.SetGridData(m_uint_selectRSBaseId, needUnload: true); } int attrCount = GetEquipAttrCount(false); if (attrCount > 0) { EquipDefine.LocalAttrData attr = null; GameCmd.PairNumber attrPair = null; ColorType cType = ColorType.JZRY_Txt_Black; bool choose = false; for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One; i < (ForgingProccessPropertyIndex)attrCount; i++) { choose = IsSelectEquipAttr() && (m_em_selectEquipAttrIndex == i); cType = (choose) ? ColorType.JZRY_Txt_Red : ColorType.JZRY_Txt_Black; attrPair = GetEquipAttrByIndex((int)i, true); if (m_dic_propCurGrids.ContainsKey(i) && !m_dic_propCurGrids[i].Visible) { m_dic_propCurGrids[i].SetVisible(true); attr = EquipDefine.LocalAttrData.Create(attrPair); m_dic_propCurGrids[i].SetGridView(ColorManager.GetColorString(cType, attr.AttrDes), attr.IsMaxGrade, true , attr.Grade); } if (m_dic_propCBs.ContainsKey(i) && !m_dic_propCBs[i].gameObject.activeSelf) { m_dic_propCBs[i].gameObject.SetActive(true); m_dic_propCBs[i].Set(choose); } bool showTips = emgr.IsItemHaveAdditiveAttrOrGemHole(selectEquipId); if (null != m_label_ProccessTips && m_label_ProccessTips.gameObject.activeSelf != showTips) { m_label_ProccessTips.gameObject.SetActive(showTips); if (showTips) { m_label_ProccessTips.text = "勾选属性消除后消失"; } } } } }
/// <summary> /// 设置选中装备属性索引(toggle切换) /// </summary> /// <param name="index"></param> private void SetSetlectEquipAttrIndex(ForgingProccessPropertyIndex index) { m_em_selectEquipAttrIndex = (index != m_em_selectEquipAttrIndex) ? index : ForgingProccessPropertyIndex.None; //重置选着符石id m_uint_selectRSBaseId = 0; //if (IsProccessMode(ForgingProccessMode.Remove) // && m_em_selectEquipAttrIndex != ForgingProccessPropertyIndex.None) //{ // GameCmd.PairNumber attr = GetEquipAttrByIndex((int)m_em_selectEquipAttrIndex, true); // if (null != attr) // { // //重新计算满足条件的符石id // m_uint_selectRSBaseId = emgr.GetMatchRunStoneByAttr(GetEquipAttrByIndex((int)m_em_selectEquipAttrIndex)); // } //} UpdateProccess(Data); }
/// <summary> /// 更新提取 /// </summary> internal void UpdateFetch() { RuneStone rs = DataManager.Manager <ItemManager>() .GetTempBaseItemByBaseID <RuneStone>(emgr.InactiveRuneStoneBaseId, ItemDefine.ItemDataType.RuneStone); uint num = (uint)imgr.GetItemNumByBaseId(emgr.InactiveRuneStoneBaseId); if (null != m_processRsGrowShow) { m_processRsGrowShow.SetGridData(rs.BaseId); } int attrCount = GetEquipAttrCount(true); if (attrCount > 0) { EquipDefine.LocalAttrData attr = null; GameCmd.PairNumber attrPair = null; for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One ; i < (ForgingProccessPropertyIndex)attrCount; i++) { attrPair = GetEquipAttrByIndex((int)i, true); if (m_dic_propCurGrids.ContainsKey(i) && !m_dic_propCurGrids[i].Visible) { m_dic_propCurGrids[i].SetVisible(true); attr = EquipDefine.LocalAttrData.Create(attrPair); m_dic_propCurGrids[i].SetGridView(ColorManager.GetColorString(ColorType.JZRY_Txt_Black, attr.AttrDes), attr.IsMaxGrade, true , attr.Grade); } } bool showTips = emgr.IsItemHaveAdditiveAttrOrGemHole(selectEquipId); if (null != m_label_ProccessTips && m_label_ProccessTips.gameObject.activeSelf != showTips) { m_label_ProccessTips.gameObject.SetActive(showTips); if (showTips) { m_label_ProccessTips.text = "提取后此装备消失"; } } } }
/// <summary> /// 更新提升 /// </summary> internal void UpdatePromote() { bool isSelectRS = (m_uint_selectRSBaseId != 0); RuneStone rs = DataManager.Manager <ItemManager>() .GetTempBaseItemByBaseID <RuneStone>(m_uint_selectRSBaseId, ItemDefine.ItemDataType.RuneStone); uint num = (isSelectRS) ? (uint)imgr.GetItemNumByBaseId(m_uint_selectRSBaseId) : 0; if (null != m_processRsGrowShow) { m_processRsGrowShow.SetGridData(m_uint_selectRSBaseId, needUnload: true); } int attrCount = GetEquipAttrCount(); if (attrCount > 0) { EquipDefine.LocalAttrData attr = null; EquipDefine.LocalAttrData nextAttr = null; GameCmd.PairNumber attrPair = null; ColorType cType = ColorType.JZRY_Txt_Black; bool choose = false; Vector3 tempPos = Vector3.zero; for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One; i < (ForgingProccessPropertyIndex)attrCount; i++) { cType = ColorType.JZRY_Txt_Black; choose = IsSelectEquipAttr() && (m_em_selectEquipAttrIndex == i); attrPair = GetEquipAttrByIndex((int)i); attr = EquipDefine.LocalAttrData.Create(attrPair); if (m_dic_propCurGrids.ContainsKey(i)) { m_dic_propCurGrids[i].SetVisible(true); m_dic_propCurGrids[i].SetGridView(ColorManager.GetColorString(cType, attr.AttrDes), attr.IsMaxGrade, true , attr.Grade); } if (m_dic_propNextGrids.ContainsKey(i)) { cType = (choose) ? ColorType.JZRY_Green : ColorType.JZRY_Txt_Black; m_dic_propNextGrids[i].SetVisible(true); if (attr.IsMaxGrade) { m_dic_propNextGrids[i].SetGridView("", false, false); m_dic_propNextGrids[i].SetProperty("已提升至最大等级"); } else { nextAttr = EquipDefine.LocalAttrData.Create((null != attr) ? attr.NextEffectId : 0); if (null != nextAttr) { m_dic_propNextGrids[i].SetGridView( ColorManager.GetColorString(cType, nextAttr.AttrDes), nextAttr.IsMaxGrade, true, nextAttr.Grade); } else { Engine.Utility.Log.Error("Forgingpanel_proccess UpdatePromote nextAttr null"); } } if (null != m_trans_ArrowPromote && choose && isSelectRS) { if (!m_trans_ArrowPromote.gameObject.activeSelf) { m_trans_ArrowPromote.gameObject.SetActive(true); } tempPos = m_trans_ArrowPromote.position; tempPos.y = m_dic_propCurGrids[i].CacheTransform.position.y; m_trans_ArrowPromote.transform.position = tempPos; if (null != m_label_ArrowPromoteTxt) { uint differ = (null != attr && null != rs) ? (rs.Grade - attr.Grade) : 0; m_label_ArrowPromoteTxt.text = string.Format("成功率{0}%", emgr.GetPropertyPromoteProp(differ)); } } } if (m_dic_propCBs.ContainsKey(i) && !m_dic_propCBs[i].gameObject.activeSelf) { m_dic_propCBs[i].gameObject.SetActive(true); m_dic_propCBs[i].Set(choose); } } } }
private void InitProccessWidgets() { if (IsInitStatus(ForgingPanelMode.Proccess)) { return; } SetInitStatus(ForgingPanelMode.Proccess, true); //装备 GameObject preObj = UIManager.GetResGameObj(GridID.Uiitemgrowshowgrid) as GameObject; if (null != preObj) { GameObject cloneObj = null; if (null != m_trans_ProcessInfoRoot && null == m_processGrowShow) { cloneObj = NGUITools.AddChild(m_trans_ProcessInfoRoot.gameObject, preObj); if (null != cloneObj) { m_processGrowShow = cloneObj.GetComponent <UIItemGrowShowGrid>(); if (null == m_processGrowShow) { m_processGrowShow = cloneObj.AddComponent <UIItemGrowShowGrid>(); } m_processGrowShow.RegisterUIEventDelegate(OnUIEventCallback); } } preObj = UIManager.GetResGameObj(GridID.Uiproccessgrid) as GameObject; if (null != m_trans_ProcessCostRoot && null == m_processRsGrowShow) { cloneObj = NGUITools.AddChild(m_trans_ProcessCostRoot.gameObject, preObj); if (null != cloneObj) { m_processRsGrowShow = cloneObj.GetComponent <UIProccessGrid>(); if (null == m_processRsGrowShow) { m_processRsGrowShow = cloneObj.AddComponent <UIProccessGrid>(); } m_processRsGrowShow.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { if (data is UIItemInfoGrid) { UIItemInfoGrid infoGrid = data as UIItemInfoGrid; if (null != infoGrid && infoGrid.NotEnough && null != param && param is uint) { ShowItemGet((uint)param); } } else if (data is UIProccessGrid) { if (IsPanelMode(ForgingPanelMode.Proccess)) { if (!IsProccessMode(ForgingProccessMode.Fetch)) { if (null != param) { m_uint_selectRSBaseId = 0; m_processRsGrowShow.SetGridData(m_uint_selectRSBaseId, needUnload: true); } else { OnSelectProcessRuneStone(); } } } } } }); } } } if (null == m_dic_fpTabs) { m_dic_fpTabs = new Dictionary <ForgingProccessMode, UITabGrid>(); } m_dic_fpTabs.Clear(); Transform ts = null; if (null != m_trans_ProcessTabs) { UITabGrid tGrid = null; for (ForgingProccessMode i = ForgingProccessMode.Promote; i < ForgingProccessMode.Max; i++) { ts = m_trans_ProcessTabs.Find(i.ToString() + "Tab"); if (null == ts) { continue; } tGrid = ts.GetComponent <UITabGrid>(); if (null == tGrid) { tGrid = ts.gameObject.AddComponent <UITabGrid>(); } tGrid.SetGridData(i); tGrid.RegisterUIEventDelegate(OnUIEventCallback); tGrid.SetHightLight(false); m_dic_fpTabs.Add(i, tGrid); } } if (null == m_dic_propCurGrids) { m_dic_propCurGrids = new Dictionary <ForgingProccessPropertyIndex, UIEquipPropertyGrid>(); } m_dic_propCurGrids.Clear(); if (null == m_dic_propNextGrids) { m_dic_propNextGrids = new Dictionary <ForgingProccessPropertyIndex, UIEquipPropertyGrid>(); } m_dic_propNextGrids.Clear(); if (null == m_dic_propCBs) { m_dic_propCBs = new Dictionary <ForgingProccessPropertyIndex, UIToggle>(); } m_dic_propCBs.Clear(); UIEquipPropertyGrid uPGrid = null; UIToggle toggle = null; //属性格子 for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One ; i < ForgingProccessPropertyIndex.Max; i++) { if (null != m_trans_ProccessPropertyContentRoot) { //Cur ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "CPP"); if (null != ts) { uPGrid = ts.GetComponent <UIEquipPropertyGrid>(); if (null == uPGrid) { uPGrid = ts.gameObject.AddComponent <UIEquipPropertyGrid>(); } m_dic_propCurGrids.Add(i, uPGrid); } //Nex ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "NPP"); if (null != ts) { uPGrid = ts.GetComponent <UIEquipPropertyGrid>(); if (null == uPGrid) { uPGrid = ts.gameObject.AddComponent <UIEquipPropertyGrid>(); } m_dic_propNextGrids.Add(i, uPGrid); } //CheckBox ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "CB"); if (null != ts) { toggle = ts.GetComponent <UIToggle>(); if (null == uPGrid) { toggle = ts.gameObject.AddComponent <UIToggle>(); } m_dic_propCBs.Add(i, toggle); } } } SetProccessMode(ForgingProccessMode.Promote, true); //InitPromote(); //InitRemove(); //InitFetch(); }