/// <summary> /// 点击确定按钮 /// </summary> public void OnClickConfirmBtn() { if (mCurSelectBoxNum < 1 || mCurSelectBoxNum > mBoxMaxNum) { EB.Debug.LogError("LTSelectBoxController UseItem Error, num Error"); return; } Hotfix_LT.Data.SelectBox selectBox = mCurCell.GetCurSelectBoxData(); LTPartnerData partnerData = LTPartnerDataManager.Instance.GetPartnerByStatId(int.Parse(selectBox.ri1)); bool isHasPartner = partnerData != null && partnerData.HeroId > 0; string statId = selectBox.ri1; int summonShard = partnerData == null ? 0 :partnerData.HeroInfo.summon_shard; LTPartnerDataManager.Instance.UseItem(mCurInventoryId, mCurSelectBoxNum, selectBox.index, delegate { if (selectBox.rt1.Equals("hero")) { if (!isHasPartner) { LTShowItemData itemData = new LTShowItemData(statId, 1, "hero"); GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData); } else { LTShowItemData itemData = new LTShowItemData(statId, summonShard * mCurSelectBoxNum, "heroshard"); GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData); } } else { List <LTShowItemData> showItemsList = new List <LTShowItemData>(); Hotfix_LT.Data.EconemyItemTemplate info = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(selectBox.ri1); if (info is Hotfix_LT.Data.EquipmentItemTemplate) { for (int i = 0; i < mCurSelectBoxNum; i++) { LTShowItemData showItemData = new LTShowItemData(selectBox.ri1, selectBox.rn1, selectBox.rt1); showItemsList.Add(showItemData); } } else { LTShowItemData showItemData = new LTShowItemData(selectBox.ri1, selectBox.rn1 * mCurSelectBoxNum, selectBox.rt1); showItemsList.Add(showItemData); } GlobalMenuManager.Instance.Open("LTShowRewardView", showItemsList); } if (mCurSelectBoxNum == mBoxMaxNum) { UIInventoryBagLogic.Instance.FirstItem = null; } UIInventoryBagLogic.Instance.RefeshBag(ShowBagContent.Instance.CurType); controller.Close(); }); }
/// <summary> /// 点击item /// </summary> /// <param name="cell"></param> public void OnClickSelectBoxItem(LTSelectBoxCellController cell) { if (cell == null) { EB.Debug.LogError("LTSelectBoxController OnClickSelectBoxItem is Error, cell is Null"); return; } if (cell.GetCurSelectBoxData() == null) { return; } if (mCurCell != null) { mCurCell.SetSelectSpStatus(false); } mCurCell = cell; mCurCell.SetSelectSpStatus(true); mCurSelectItemId = cell.GetCurSelectBoxData().ri1; }