void ShowStrengthConsume(int _lev) { MountStrenConsumeRef mountStrenConsume = ConfigMng.Instance.GetMountStrenConsumeRef(_lev); if (mountStrenConsume != null) { StringBuilder builder = new StringBuilder(); for (int i = 0, max = mountStrenConsume.item.Count; i < max; i++) { ItemValue item = mountStrenConsume.item[i]; if (item.eid == 5 || item.eid == 6) { builder.Append(GameHelper.GetStringWithBagNumber(item, out enoughCoin)); } else { builder.Append(GameHelper.GetStringWithBagNumber(item, out enoughStrength, out lackStrengthItem)); } if (i < max - 1) { builder.Append("\n"); } } if (strengthConsume != null) { strengthConsume.text = builder.ToString(); } } if (quickStrengthCost != null) { List <EquipmentInfo> items = new List <EquipmentInfo>(); if (lackStrengthItem != null) { items.Add(lackStrengthItem); } int cost = GameCenter.inventoryMng.QuickBuyConsume(items); quickStrengthCost.text = GameCenter.inventoryMng.QuickBuyConsume(items).ToString() + "/" + 1; bool redColor = (ulong)cost > GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount; System.Text.StringBuilder builder = new StringBuilder(); quickStrengthCost.text = builder.Append(cost).Append((redColor ? "/[ff0000]" : "/[00ff00]")).Append(GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount).Append("[-]").ToString(); } }
string PreviewOne(Dictionary <int, EquipmentInfo> equipDic) { System.Text.StringBuilder builder = new System.Text.StringBuilder(); Dictionary <int, ItemValue> itemList = new Dictionary <int, ItemValue>(); int coinNum = 0; bool haveHighQualityEquip = false; using (var e = equipDic.GetEnumerator()) { while (e.MoveNext()) { EquipmentInfo temp = e.Current.Value; if (temp == null) { continue; } coinNum += temp.Price; //if(temp.Quality <= 3)continue;//蓝色及以下只有铜币 if (temp.IsEquip) { haveHighQualityEquip = true;//有稀有物品 StrengthenRef strengthenRef = ConfigMng.Instance.GetStrengthenRefByLv(temp.UpgradeLv); if (strengthenRef != null) { for (int j = 0, maxJ = strengthenRef.decoItems.Count; j < maxJ; j++) { ItemValue item = strengthenRef.decoItems[j]; if (item.eid == 5)// 分解强化的装备也给钱 { coinNum += item.count; } else { AddOne(itemList, item); } } } List <ItemValue> luckyItems = ConfigMng.Instance.GetEquipmentListByLuckyLv(temp.LuckyLv); for (int i = 0, max = luckyItems.Count; i < max; i++) { ItemValue item = luckyItems[i]; AddOne(itemList, item); } List <ItemValue> qualityList = ConfigMng.Instance.GetResolveItemListByLv(temp.UseReqLevel, temp.Quality, (int)temp.Slot); for (int h = 0, maxh = qualityList.Count; h < maxh; h++) { ItemValue item = qualityList[h]; AddOne(itemList, item); } } else if (temp.Family == EquipmentFamily.MOUNTEQUIP) { MountStrenConsumeRef mouuntStren = ConfigMng.Instance.GetMountStrenConsumeRef(temp.UpgradeLv); if (mouuntStren != null) { if (mouuntStren.deco_cons != null && mouuntStren.deco_cons.eid != 0) { AddOne(itemList, mouuntStren.deco_cons); } } MountEquQuailtRef quality = ConfigMng.Instance.GetMountEquipQualityRef(temp.Quality, temp.Slot); if (quality != null) { if (quality.deco_cons != null && quality.deco_cons.eid != 0) { AddOne(itemList, quality.deco_cons); } } } } } if (labPrefabResult != null) //预制描述 { labPrefabResult.enabled = (equipDic.Count == 0); } if (labWillResult != null) //描述 { labWillResult.enabled = (equipDic.Count != 0); } builder.Append(ConfigMng.Instance.GetUItext(270)); if (coinNum > 0) { builder.Append(ConfigMng.Instance.GetUItext(271)).Append(coinNum); } using (var e = itemList.GetEnumerator()) { while (e.MoveNext()) { ItemValue itemVal = e.Current.Value; builder.Append(" "); EquipmentInfo info = new EquipmentInfo(itemVal, EquipmentBelongTo.NONE); if (info != null) { builder.Append(info.ItemName).Append("*").Append(itemVal.count); } } } if (haveHighQualityEquip) { builder.Append(ConfigMng.Instance.GetUItext(272)); } return(builder.ToString()); }