public void OnClickUpgrade() { string[] args = templateNow.ItemCost.Split(','); if (args.Length >= 2) { int curCount = GameItemUtil.GetInventoryItemNum(args[0]); int.TryParse(args[1], out var needCount); if (curCount >= needCount) { LTPartnerDataManager.Instance.UpgradeArtifact(data.HeroId, data.ArtifactLevel + 1, (b) => { if (b) { DetailBehaviour.OnDisable(); DetailBehaviour.PlayAnim(); SetMenuData(null); // Messenger.Raise(EventName.ArtifactRefresh); ArtifactEquipmentTemplate artifactEquipmentTemplate = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel, true); if (!string.IsNullOrEmpty(artifactEquipmentTemplate.desc)) { GlobalMenuManager.Instance.Open("LTArtifactLevelUpUIHud", infoId); } } }); } else { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_ERROR_INSUFFICIENT_ITEMS")); } } }
void InitSpecialEventData() { mGetRewardsByGiveItem = LTBountyTaskHudController.GetRewardDatas(); Hashtable giveItemData; DataLookupsCache.Instance.SearchDataByID <Hashtable>(string.Format("tasks.{0}.event_count.give_item", LTBountyTaskHudController.TaskID()), out giveItemData); int itemId = EB.Dot.Integer("item_id", giveItemData, 0); int needNum = EB.Dot.Integer("target_num", giveItemData, 0); int haveItemNum = GameItemUtil.GetInventoryItemNum(itemId); EconemyItemTemplate itemTpl = EconemyTemplateManager.Instance.GetItem(itemId); ContentLabel.Text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTBountyTaskConversationController_2609"), needNum, itemTpl.Name); ContentLabel.mDMono.transform.GetComponent <UIWidget>().width = ContentWidth - GiveItem.Frame.width; GiveItem.LTItemData = new LTShowItemData(itemId.ToString(), needNum, LTShowItemType.TYPE_GAMINVENTORY, false); mItemEnough = haveItemNum >= needNum; GiveItem.Count.text = string.Format("[{0}]{1}[-]/{2}", mItemEnough ? LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal, haveItemNum, needNum); LTPartnerDataManager.Instance.itemNeedCount = needNum; if (mItemEnough) { SpecialEventFuncNode.transform.GetChild(0).gameObject.CustomSetActive(true); SpecialEventFuncNode.transform.GetChild(1).gameObject.CustomSetActive(false); SpecialEventFuncNode.GetComponent <UIGrid>().Reposition(); } else { SpecialEventFuncNode.transform.GetChild(0).gameObject.CustomSetActive(false); SpecialEventFuncNode.transform.GetChild(1).gameObject.CustomSetActive(true); SpecialEventFuncNode.GetComponent <UIGrid>().Reposition(); } }
public void RefreshUIInfo() { PartnerData = LTPartnerDataManager.Instance.GetPartnerByStatId(PartnerData.StatId); if (PartnerData.HeroInfo.role_grade == (int)PartnerGrade.UR) { SourceItemID = 1427; } else { switch (PartnerData.HeroInfo.char_type) { case Hotfix_LT.Data.eRoleAttr.Feng: SourceItemID = 1422; break; case Hotfix_LT.Data.eRoleAttr.Huo: SourceItemID = 1421; break; case Hotfix_LT.Data.eRoleAttr.Shui: SourceItemID = 1423; break; } } sourceNum = GameItemUtil.GetInventoryItemNum(SourceItemID); desNum = PartnerData.ShardNum; SourceItem.LTItemData = new LTShowItemData(SourceItemID.ToString(), sourceNum, LTShowItemType.TYPE_GAMINVENTORY, false); DesItem.LTItemData = new LTShowItemData(DesItemID.ToString(), desNum, LTShowItemType.TYPE_GAMINVENTORY, false); LTUIUtil.SetText(SourceItem.Count, sourceNum.ToString()); LTUIUtil.SetText(DesItem.Count, desNum.ToString()); LTUIUtil.SetText(UseNum, Mathf.Min(sourceNum, BalanceResourceUtil.MaxNum).ToString()); CheckPlusSubBtn(); SourceItem.Count.gameObject.CustomSetActive(true); DesItem.Count.gameObject.CustomSetActive(true); }
public void SetRedPointStatus() { bool hasFreeTraining = HasUnfinishedAttr() && IsTrainingFree(1); bool canPromoted = false; var info = GetPromotion(); if (info != null && !string.IsNullOrEmpty(info.taskIds)) { var taskIds = info.taskIds.Split(','); var IsTasksFinished = true; if (taskIds != null) { for (var i = 0; i < taskIds.Length; i++) { if (!TaskUtility.IsTaskFinished(int.Parse(taskIds[i]))) { IsTasksFinished = false; break; } } var count = GameItemUtil.GetInventoryItemNum(info.itemId); canPromoted = IsTasksFinished && count >= info.cost; } } LTRedPointSystem.Instance.SetRedPointNodeNum(RedPointConst.promotion, (hasFreeTraining || canPromoted) ? 1 : 0); }
public void Refresh() { //原物品信息 Hotfix_LT.Data.GeneralItemTemplate SourceItemDate = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGeneral(itemID); sourceNum = GameItemUtil.GetInventoryItemNum(itemID); SourceItem.LTItemData = new LTShowItemData((itemID).ToString(), sourceNum, LTShowItemType.TYPE_GAMINVENTORY); //LTUIUtil.SetText(SourceItem.Count, sourceNum.ToString()); SourceItemLabel.text = sourceNum.ToString(); int DesItemID = 0; int.TryParse(SourceItemDate.CompoundItem, out DesItemID); if (CheckCanCompound(DesItemID)) { int desNum = GameItemUtil.GetInventoryItemNum(DesItemID); DesItem.LTItemData = new LTShowItemData(DesItemID.ToString(), desNum, LTShowItemType.TYPE_GAMINVENTORY); //LTUIUtil.SetText(DesItem.Count, desNum.ToString()); DesItemLabel.text = desNum.ToString(); transNum = SourceItemDate.NeedNum; LTUIUtil.SetText(TransNumLabel, Mathf.Min(sourceNum / transNum, 1).ToString()); LTUIUtil.SetText(TipLabel, string.Format("{0}{1}1", transNum, EB.Localizer.GetString("ID_AWAKENDUNGEON_TRANS"))); CheckPlusSubBtn(); } }
public void OnBreakThrouthBtnClick() { //判断上限,材料//ID_HANDBOOK_HAS_MAX_LEVEL int curLevel = LTPartnerHandbookManager.Instance.GetHandBookLevel(); var curHandBookInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualScoreTemplateById(curLevel); if (BreakLevel >= curHandBookInfo.levelLimit) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_HANDBOOK_HAS_MAX_LEVEL")); return; } var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(Type); Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1); int curCount = GameItemUtil.GetInventoryItemNum(breakThrough.material_1); int nextCount = breakThrough.quantity_1; if (curCount < nextCount) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_HANDBOOK_BTN_TIP2")); return;//材料不足 } LTPartnerHandbookManager.Instance.BreakThrough((int)Type, delegate { UpLevelFx.CustomSetActive(false); UpLevelFx.CustomSetActive(true); curAddATKLabel.GetComponent <TweenScale>().ResetToBeginning(); curAddATKLabel.GetComponent <TweenScale>().PlayForward(); curAddDefLabel.GetComponent <TweenScale>().ResetToBeginning(); curAddDefLabel.GetComponent <TweenScale>().PlayForward(); curAddMAXHPLabel.GetComponent <TweenScale>().ResetToBeginning(); curAddMAXHPLabel.GetComponent <TweenScale>().PlayForward(); }); }
private void SetLabelShow(int index, string id, int NeedCount = 0) { bool isRes = false; if (id.Equals(LTResID.HcName) || id.Equals(LTResID.GoldName)) { isRes = true; itemCount = BalanceResourceUtil.GetResValue(id); } else { isRes = false; itemCount = GameItemUtil.GetInventoryItemNum(id); } if (NeedCount > 0) { NeedCountStr = string.Format("/{0}", ApplyNumFormat(NeedCount, isRes)); colorstr = itemCount >= NeedCount ? "[42fe79]" : "[ff6699]"; } else { NeedCountStr = ""; colorstr = "[ffffff]"; } if (NumLabelArray[index].transform.childCount > 0) { NumLabelArray[index].text = NumLabelArray[index].transform.GetChild(0).GetComponent <UILabel>().text = string.Format("{0}{1}[-]{2}", colorstr, ApplyNumFormat(itemCount, isRes), NeedCountStr); } else { NumLabelArray[index].text = string.Format("{0}{1}[-]{2}", colorstr, ApplyNumFormat(itemCount, isRes), NeedCountStr); } }
public static void TurnToVigorGotView() { List <RecoverVigorItemData> recoverVigorItemsData; string dataStr = Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("RecoverVigorItems"); string[] dataArray = dataStr.Split(';'); recoverVigorItemsData = new List <RecoverVigorItemData>(); for (int i = 0; i < dataArray.Length; i++) { var items = dataArray[i].Split(','); if (items.Length >= 2 && int.TryParse(items[1], out int num)) { int count = GameItemUtil.GetInventoryItemNum(items[0]); recoverVigorItemsData.Add(new RecoverVigorItemData(items[0], num, count)); } } recoverVigorItemsData.Sort((x, y) => { return(y.num - x.num); }); if (recoverVigorItemsData.Count > 0 && recoverVigorItemsData[0] != null && recoverVigorItemsData[0].num > 0) { GlobalMenuManager.Instance.Open("RecoverVigorView", recoverVigorItemsData); return; } MessageTemplateManager.ShowMessage(902085, null, delegate(int result) { if (result == 0) { InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f); GlobalMenuManager.Instance.Open("LTResourceShopUI"); } }); }
public override void Fill(RecoverVigorItemData itemData) { if (itemData != null) { curData = itemData; int count = GameItemUtil.GetInventoryItemNum(curData.itemdataId, out inventoryid); lTShowItem.LTItemData = new LTShowItemData(curData.itemdataId, count, LTShowItemType.TYPE_GAMINVENTORY); addvigor.text = string.Format("+{0}", itemData.vigor); showdata.count = itemData.vigor; LTUIUtil.SetGreyButtonEnable(useitemBtn, count > 0); mask.CustomSetActive(count <= 0); } }
public void SetUseNumMax() { int sourceNum = GameItemUtil.GetInventoryItemNum(SourceItemID); LTUIUtil.SetText(UseNum, Mathf.Min(sourceNum, BalanceResourceUtil.MaxNum).ToString()); PlusBtn.color = new Color(255 / 255f, 0, 255 / 255f, 1); int useNum = int.Parse(UseNum.text); if (useNum > 0) { SubBtn.color = Color.white; UseButton.color = Color.white; UseButton.GetComponent <BoxCollider>().enabled = true; } }
private void RefreshPromotionCost() { var info = LTPromotionManager.Instance.GetPromotion(); if (info == null) { EB.Debug.LogError("LTPromotionTaskViewController.RefreshPromotionCost -> info is null"); return; } var count = GameItemUtil.GetInventoryItemNum(info.itemId); _labCost.text = LT.Hotfix.Utility.ColorUtility.FormatLeftSideColor(count, info.cost); _canPromoted = count >= info.cost; }
public void SetShowItem(ArtifactEquipmentTemplate temp) { string[] args = temp.ItemCost.Split(','); if (args.Length >= 2) { int curCount = GameItemUtil.GetInventoryItemNum(args[0]); int.TryParse(args[1], out var needCount); ShowItem.LTItemData = new LTShowItemData(args[0], needCount, LTShowItemType.TYPE_GAMINVENTORY); string color = curCount < needCount ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; ShowItemCount.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color, curCount, needCount); } }
private void SetTransferDartResidueRefreshCount() { if (AlliancesManager.Instance.TransferDartInfo.Members.Count <= 0) { EB.Debug.LogError("TransferDartInfo not init"); return; } int residueFreeRefreshNum = AllianceEscortUtil.GetResidueTransferRefreshNum(); if (residueFreeRefreshNum < 0) { EB.Debug.LogError("residueFreeRefreshNum < 0 num={0}", residueFreeRefreshNum); residueFreeRefreshNum = 0; } //int totalFreeRefreshNum = VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.EscortRefreshTimes); if (residueFreeRefreshNum > 0) { LTUIUtil.SetText(controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"], residueFreeRefreshNum.ToString()); } else { mTicketNum = GameItemUtil.GetInventoryItemNum(Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("escortRefreshItem").ToString()); if (mTicketNum > 0) { LTUIUtil.SetText(controller.UiLabels["TransferDartRefreshTicketNumLabel"], mTicketNum.ToString()); controller.UiLabels["TransferDartRefreshTicketNumLabel"].transform.parent.gameObject.SetActive(true); controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"].transform.parent.gameObject.CustomSetActive(false); controller.UiLabels["TransferDartRefreshCostHCLabel"].transform.parent.gameObject.CustomSetActive(false); } else { controller.UiLabels["TransferDartRefreshTicketNumLabel"].transform.parent.gameObject.SetActive(false); controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"].transform.parent.gameObject.CustomSetActive(false); controller.UiLabels["TransferDartRefreshCostHCLabel"].transform.parent.gameObject.CustomSetActive(true); if (BalanceResourceUtil.GetUserDiamond() >= refreshCostHC) { controller.UiLabels["TransferDartRefreshCostHCLabel"].color = LT.Hotfix.Utility.ColorUtility.GreenColor; } else { controller.UiLabels["TransferDartRefreshCostHCLabel"].color = LT.Hotfix.Utility.ColorUtility.RedColor; } } } }
public void Fill(int materialId, int NeedNum, bool isExtremityTrialDouble, bool isSceneDouble) { curId = materialId; curNeednum = NeedNum; this.isExtremityTrialDouble = isExtremityTrialDouble; this.isSceneDouble = isSceneDouble; Item.LTItemData = new LTShowItemData(materialId.ToString(), 1, LTShowItemType.TYPE_GAMINVENTORY); if (ItemBtn.clickEvent != null) { ItemBtn.clickEvent.Clear(); } ItemBtn.clickEvent.Add(new EventDelegate(OnClickItem)); materialNum = GameItemUtil.GetInventoryItemNum(materialId); SetGoldMaterialSelect(materialId, materialNum, NeedNum); ToGetButton.GetComponent <UISprite>().spriteName = "Ty_Button_1"; //进度条显示 SetSliderState(materialNum, NeedNum); dropData = EconemyTemplateManager.Instance.GetItem(materialId).DropDatas[0]; //下面处理右边按钮的显示状态 if (materialNum >= NeedNum) { CenterShowLabel.gameObject.CustomSetActive(true); CenterShowLabel.text = CenterShowLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_9"); ToGetButton.GetComponent <UISprite>().color = new Color(1, 0, 1); ToGetButton.GetComponent <BoxCollider>().enabled = false; QuicklyGet.CustomSetActive(false); LockObj.CustomSetActive(false); } else { ToGetButton.GetComponent <UISprite>().color = new Color(1, 1, 1); ToGetButton.GetComponent <BoxCollider>().enabled = true; if (dropData == null) { return; } if (dropData.Type == DropType.ExtremityTrial)//途径为极限试炼 { SetExtremityTrialGet(materialId, NeedNum, isExtremityTrialDouble); } else if (dropData.Type == DropType.Scene)//途径为主线副本 { SetSceneGet(materialId, NeedNum, isSceneDouble); } } }
/// <summary> /// 生成星级宝箱奖励数据 /// </summary> /// <param name="data"></param> /// <returns></returns> public static List <LTShowItemData> ParseStarBoxData(Hashtable data) { List <LTShowItemData> itemList = new List <LTShowItemData>(); if (data != null) { foreach (DictionaryEntry item in data) { string id = EB.Dot.String("economy_id", item.Value, string.Empty); int curNum = EB.Dot.Integer("num", item.Value, 0); int pastNum = GameItemUtil.GetInventoryItemNum(id); //string type = EB.Dot.String("system", item.Value, string.Empty); LTShowItemData itemData = new LTShowItemData(id, curNum - pastNum, LTShowItemType.TYPE_GAMINVENTORY); itemList.Add(itemData); } } return(itemList); }
private void CheckBreakItem() { var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(Type); Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1); if (breakThrough != null) { int curCount = GameItemUtil.GetInventoryItemNum(breakThrough.material_1); int nextCount = breakThrough.quantity_1; string color = curCount < nextCount ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; BreakItemLabel.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color, curCount, nextCount); RedPoint.CustomSetActive(curCount >= nextCount); } else { RedPoint.CustomSetActive(false); } }
public void InitWithPartnerData(LTPartnerData partnerData) { PartnerData = partnerData; DesItemID = partnerData.StatId; if (partnerData.HeroInfo.role_grade == (int)PartnerGrade.UR) { SourceItemID = 1427; } else { switch (partnerData.HeroInfo.char_type) { case Hotfix_LT.Data.eRoleAttr.Feng: SourceItemID = 1422; break; case Hotfix_LT.Data.eRoleAttr.Huo: SourceItemID = 1421; break; case Hotfix_LT.Data.eRoleAttr.Shui: SourceItemID = 1423; break; } } sourceNum = GameItemUtil.GetInventoryItemNum(SourceItemID); desNum = partnerData.ShardNum; SubBtn.GetComponent <UIButton>().tweenTarget = null; UseButton.GetComponent <UIButton>().tweenTarget = null; PlusBtn.GetComponent <UIButton>().tweenTarget = null; SourceItem.LTItemData = new LTShowItemData(SourceItemID.ToString(), sourceNum, LTShowItemType.TYPE_GAMINVENTORY, false); DesItem.LTItemData = new LTShowItemData(DesItemID.ToString(), sourceNum, LTShowItemType.TYPE_HEROSHARD, false); LTUIUtil.SetText(SourceItem.Count, sourceNum.ToString()); LTUIUtil.SetText(DesItem.Count, desNum.ToString()); SourceItem.Count.gameObject.CustomSetActive(true); DesItem.Count.gameObject.CustomSetActive(true); LTUIUtil.SetText(UseNum, Mathf.Min(sourceNum, BalanceResourceUtil.MaxNum).ToString()); CheckPlusSubBtn(); }
//自选金子界面显示 private void SetGoldMaterialSelect(int itemId, int Itemamount, int Needamount) { if (selectBoxes == null) { selectBoxes = EconemyTemplateManager.Instance.GetSelectBoxListById(QuicklyGetUpgradeMaterialController.GoldBoxId); } if (Needamount > Itemamount) { var tempselectBox = selectBoxes.Find(m => m.ri1.Equals(itemId.ToString())); if (tempselectBox != null) { int boxamount = GameItemUtil.GetInventoryItemNum(QuicklyGetUpgradeMaterialController.GoldBoxId, out BoxinventoryId); if (boxamount > 0) { LTShowItemData data = tempselectBox == null ? null : new LTShowItemData(QuicklyGetUpgradeMaterialController.GoldBoxId, boxamount, LTShowItemType.TYPE_GAMINVENTORY); setSelectBoxState(true, data, tempselectBox.index); return; } } } setSelectBoxState(false, null, 0); }
public bool IsHandBookCanBreakUp(Hotfix_LT.Data.eRoleAttr attr = Hotfix_LT.Data.eRoleAttr.None) { if (GetHandBookLevel() < UnLockLevel) { return(false); } if (TheHandbookList != null && TheHandbookList.Handbooks != null) { for (var i = 0; i < TheHandbookList.Handbooks.Count; i++) { HandbookData handbook = TheHandbookList.Handbooks[i]; if (attr != Hotfix_LT.Data.eRoleAttr.None && attr != handbook.HandbookId) { continue; } int curLevel = LTPartnerHandbookManager.Instance.GetHandBookLevel(); var curHandBookInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualScoreTemplateById(curLevel); if (curHandBookInfo == null || handbook.BreakLevel >= curHandBookInfo.levelLimit) { continue; } var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(handbook.HandbookId); Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1); if (breakThrough != null) { int curCount = GameItemUtil.GetInventoryItemNum(breakThrough.material_1); int nextCount = breakThrough.quantity_1; if (curCount < nextCount) { continue; } return(true); } } } return(false); }
public void SetShowItem(ArtifactEquipmentTemplate temp) { if (temp == null) { ShowItem.mDMono.gameObject.CustomSetActive(false); redPoint.gameObject.SetActive(false); return; } ShowItem.mDMono.gameObject.CustomSetActive(true); string[] args = temp.ItemCost.Split(','); if (args.Length >= 2) { int curCount = GameItemUtil.GetInventoryItemNum(args[0]); int.TryParse(args[1], out var needCount); ShowItem.LTItemData = new LTShowItemData(args[0], needCount, LTShowItemType.TYPE_GAMINVENTORY); string color = curCount < needCount ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; ShowItemCount.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color, curCount, needCount); redPoint.gameObject.SetActive(curCount >= needCount); } }
private IEnumerator InitRequestItem() { //RequestItemObj.CustomSetActive(true); RequestItemObj.transform.SetParent(DynamicScroll.mDMono.transform); LTShowItemData data = new LTShowItemData(TargetItemId, 0, "gaminventory", false); for (int i = 0; i < DataList.Count; i++) { for (int j = 0; j < DataList[i].ItemList.Count; j++) { if (DataList[i].ItemList[j].id == TargetItemId) { if (data.type == string.Empty) { data.type = DataList[i].ItemList[j].type; } data.count += DataList[i].ItemList[j].count; break; } } } RequestItem.LTItemData = data; NameLabel.color = LT.Hotfix.Utility.ColorUtility.BrownColor; Countlab.text = string.Format("*{0}", data.count); int curCount = GameItemUtil.GetInventoryItemNum(TargetItemId); int needCount = LTPartnerDataManager.Instance.itemNeedCount; RequestNumLab.text = LT.Hotfix.Utility.ColorUtility.FormatEnoughStr(curCount, needCount); yield return(null); RequestItemObj.transform.SetAsLastSibling();//不等一帧的话这个操作不会成功 DynamicScroll.mDMono.GetComponent <UIGrid>().Reposition(); }
void ShowInfo(string type, string id) { if (type == LTShowItemType.TYPE_RES || type == LTShowItemType.TYPE_HEROMEDAL || type == LTShowItemType.TYPE_ACTICKET || type == LTShowItemType.TYPE_VIPPOINT) { int resNum = BalanceResourceUtil.GetResValue(id); ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_RES, true); HaveNumLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), resNum); int resIdInEconemy = BalanceResourceUtil.GetResID(id); Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(resIdInEconemy); if (itemInfo != null) { DescTextLabel.text = itemInfo.Desc; } else { DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC"); } } else if (type == LTShowItemType.TYPE_HEROSHARD) { int num = GameItemUtil.GetInventoryItemNum(id); ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_HEROSHARD, true); HaveNumLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), num); Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); if (itemInfo != null) { DescTextLabel.text = itemInfo.Desc; } else { DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC"); } } else if (type == LTShowItemType.TYPE_HEADFRAME) { ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_HEADFRAME); HaveNumLabel.text = string.Format(string.Empty); var data = EconemyTemplateManager.Instance.GetHeadFrame(id, 1); DescTextLabel.text = data.desc; } else if (type == LTShowItemType.TYPE_SCROLL) { ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_SCROLL); HaveNumLabel.text = string.Empty; Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(id)); DescTextLabel.text = skillTpl.Description; } else { int num = GameItemUtil.GetInventoryItemNum(id); //运营活动的脚印数量不存背包,数量要特殊获取 if (type == LTShowItemType.TYPE_ACTIVITY) { if (id.Equals("2005")) { id = "2012"; } DataLookupsCache.Instance.SearchDataByID("tl_acs." + id + ".current", out num); } ShowItem.LTItemData = new LTShowItemData(id, 1, type, true); HaveNumLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), num); Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); if (itemInfo != null) { DescTextLabel.text = itemInfo.Desc; } else { DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC"); } } }
private void UpdateInfo() { var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(Type); if (data == null) { EB.Debug.LogError("LTPartnerHandbookDetailCtrl.UpdateInfo data == null"); return; } Hotfix_LT.Data.MannualBreakTemplate curThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel); if (curThrough == null) { EB.Debug.LogError("LTPartnerHandbookDetailCtrl.UpdateInfo curThrough == null"); return; } BreakLevel = data.BreakLevel; CurLevelLabel.text = data.BreakLevel.ToString(); curAddATKLabel.text = string.Format("{0}%", Mathf.FloorToInt(curThrough.IncATK * 100)); curAddDefLabel.text = string.Format("{0}%", Mathf.FloorToInt(curThrough.IncDEF * 100)); curAddMAXHPLabel.text = string.Format("{0}%", Mathf.FloorToInt((curThrough.IncMaxHp * 100))); Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1); if (breakThrough != null)//可升级 { NextLevelLabe.gameObject.CustomSetActive(true); NextLevelLabe.text = (data.BreakLevel + 1).ToString(); nextAddATKLabel.text = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncATK - curThrough.IncATK) * 100)); nextAddDefLabel.text = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncDEF - curThrough.IncDEF) * 100)); nextAddMaxHPLabel.text = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncMaxHp - curThrough.IncMaxHp) * 100)); BreakItem.LTItemData = new LTShowItemData(breakThrough.material_1, breakThrough.quantity_1, LTShowItemType.TYPE_GAMINVENTORY, false); BreakItem.mDMono.gameObject.CustomSetActive(true); int curCount = GameItemUtil.GetInventoryItemNum(breakThrough.material_1); int nextCount = breakThrough.quantity_1; string color = curCount < nextCount ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; BreakItemLabel.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color, curCount, nextCount); RedPoint.CustomSetActive(curCount >= nextCount); BreakBtnBox.enabled = true; BreakBtnLabel.text = EB.Localizer.GetString("ID_HANDBOOK_LEVEL_UP1"); } else//不可升级 { NextLevelLabe.gameObject.CustomSetActive(false); nextAddATKLabel.text = string.Empty; nextAddDefLabel.text = string.Empty; nextAddMaxHPLabel.text = string.Empty; BreakItem.mDMono.gameObject.CustomSetActive(false); RedPoint.CustomSetActive(false); BreakBtnBox.enabled = false; BreakBtnLabel.text = EB.Localizer.GetString("ID_HAS_MAX_LEVEL"); } cardData = data.CardsInfo; SetShowHandBookData(); SetTurnPageText(); if (isFristRegister) { isFristRegister = false; return; } LTPartnerDataManager.Instance.OnDestineTypePowerChanged(Type, (prm) => { LTFormationDataManager.OnRefreshMainTeamPower(prm); }, true); }
public void Show() { string economyId = ""; string unhave; int num; if (!DataLookupsCache.Instance.SearchDataByID <string>("tooltip.unhave", out unhave, null)) { if (!DataLookupsCache.Instance.SearchDataByID <string>("{" + m_TipTargetStr + "}.economy_id", out economyId, null)) { EB.Debug.LogError("SearchDataByID {0}.economy_id is null", m_TipTargetStr); return; } m_InventoryId = InventoryId; if (!DataLookupsCache.Instance.SearchIntByID(m_InventoryId + ".num", out num, null)) { EB.Debug.LogError("SearchDataByID inventory_id==null"); } } else { if (!DataLookupsCache.Instance.SearchDataByID <string>(m_TipTargetStr, out economyId, null)) { EB.Debug.LogError("SearchDataByID {0} is null", m_TipTargetStr); return; } num = GameItemUtil.GetInventoryItemNum(economyId); } LTIconNameQuality inl = LTItemInfoTool.GetInfo(economyId, LTShowItemType.TYPE_GAMINVENTORY); m_Icon.spriteName = inl.icon; m_Frame.spriteName = UIItemLvlDataLookup.LvlToStr(inl.quality); m_FrameBG.spriteName = UIItemLvlDataLookup.GetItemFrameBGSprite(inl.quality); m_FrameBG.color = UIItemLvlDataLookup.GetItemFrameBGColor(inl.quality); m_QualityLevel = int.Parse(inl.quality); LTUIUtil.SetText(m_GoodsName, inl.name); var itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGeneral(economyId); if (itemInfo != null) { m_ClipFlag.CustomSetActive(itemInfo.System == "HeroShard"); } else { m_ClipFlag.CustomSetActive(false); } string equipSuitIconStr = Hotfix_LT.Data.EconemyTemplateManager.GetEquipSuitIcon(economyId); if (string.IsNullOrEmpty(equipSuitIconStr)) { m_EquipSuitIcon.gameObject.CustomSetActive(false); string suitIcon = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipSuit(economyId); if (!string.IsNullOrEmpty(suitIcon)) { m_EquipSuitIcon.gameObject.CustomSetActive(true); m_EquipSuitIcon.spriteName = suitIcon; } } else { m_EquipSuitIcon.gameObject.CustomSetActive(true); m_EquipSuitIcon.spriteName = equipSuitIconStr; } int grade = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGoodsGradeNum(economyId); m_boxGradeNumLab.gameObject.CustomSetActive(grade != 0); if (grade != 0) { m_boxGradeNumLab.text = string.Format("+{0}", grade); } var item = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(economyId); if (item.DropDatas.Count <= 0) { DropItemsRoot.gameObject.CustomSetActive(true); UpdateDrop(item); } else { DropItemsRoot.gameObject.CustomSetActive(true); UpdateDrop(item); } ItemInfo.InventoryId = m_InventoryId; ItemInfo.EconomyId = economyId; ItemInfo.Num = num; LTUIUtil.SetText(m_NumLabel, EB.Localizer.GetString("ID_LABEL_NAME_HADE") + num); //从伙伴进阶界面打开跳转界面需要做刷新伙伴进阶界面操作 if (!string.IsNullOrEmpty(LTPartnerDataManager.Instance.itemID)) { Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerUIRefresh, CultivateType.UpGrade); } IconParent.CustomSetActive(true); }