| | |
| | | {
|
| | | List<int> legendIdlist = new List<int>();
|
| | | List<int> legendValuelist = new List<int>();
|
| | | if (itemTipsModel.legendAttrIDPreviewDict.ContainsKey(itemConfig.EquipPlace))
|
| | | switch (itemConfig.EquipPlace)
|
| | | {
|
| | | foreach (var attrType in itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace].Keys)
|
| | | {
|
| | | switch (attrType)
|
| | | {
|
| | | case LegendAttrType.Pursuit:
|
| | | legendIdlist.AddRange(itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
|
| | | break;
|
| | | case LegendAttrType.Fixed:
|
| | | legendIdlist.AddRange(itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | int i = 0;
|
| | | for (i = 0; i < legendIdlist.Count; i++)
|
| | | {
|
| | | if (itemTipsModel.legendAttrColorValuePreviewDict.ContainsKey(legendIdlist[i]))
|
| | | {
|
| | | if (itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.ItemColor))
|
| | | {
|
| | | legendValuelist.Add(itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]][itemConfig.ItemColor]);
|
| | | }
|
| | | }
|
| | | else if (itemTipsModel.legendAttrLvValuePreviewDict.ContainsKey(legendIdlist[i]))
|
| | | {
|
| | | if (itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.LV))
|
| | | {
|
| | | legendValuelist.Add(itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]][itemConfig.LV]);
|
| | | }
|
| | | }
|
| | | case 11:
|
| | | CalculateWingsLegendAttr(itemConfig,out legendIdlist, out legendValuelist);
|
| | | break;
|
| | | case 1:
|
| | | case 2:
|
| | | case 3:
|
| | | case 4:
|
| | | case 5:
|
| | | case 6:
|
| | | case 7:
|
| | | case 8:
|
| | | case 9:
|
| | | case 10:
|
| | | case 12:
|
| | | CalculateEquipLegendAttr(itemConfig,out legendIdlist,out legendValuelist);
|
| | | break;
|
| | | }
|
| | |
|
| | | if (legendIdlist.Count == legendValuelist.Count)
|
| | |
| | |
|
| | | }
|
| | |
|
| | | private void CalculateEquipLegendAttr(ItemConfig itemConfig,out List<int> legendIdlist, out List<int> legendValuelist)
|
| | | {
|
| | | legendIdlist = new List<int>();
|
| | | legendValuelist = new List<int>();
|
| | | string attrCntKey = StringUtility.Contact(itemConfig.ItemColor, itemConfig.StarLevel);
|
| | | var attrIDDict = itemTipsModel.legendAttrIDPreviewDict;
|
| | | var attrCntDict = itemTipsModel.legendAttrCntPreviewDict;
|
| | | if (attrIDDict.ContainsKey(itemConfig.EquipPlace))
|
| | | {
|
| | | var attrTypeDict = itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace];
|
| | |
|
| | | foreach (var attrType in attrTypeDict.Keys)
|
| | | {
|
| | | var attrIds = attrTypeDict[attrType];
|
| | | int attrCnt = 0;
|
| | | if (attrCntDict.ContainsKey(attrCntKey))
|
| | | {
|
| | | attrCnt = attrCntDict[attrCntKey][attrType];
|
| | | }
|
| | | for(int i = 0; i < attrIds.Count; i++)
|
| | | {
|
| | | if(attrCnt > i)
|
| | | {
|
| | | legendIdlist.Add(attrIds[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < legendIdlist.Count; i++)
|
| | | {
|
| | | if (itemTipsModel.legendAttrColorValuePreviewDict.ContainsKey(legendIdlist[i]))
|
| | | {
|
| | | if (itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.ItemColor))
|
| | | {
|
| | | legendValuelist.Add(itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]][itemConfig.ItemColor]);
|
| | | }
|
| | | }
|
| | | else if (itemTipsModel.legendAttrLvValuePreviewDict.ContainsKey(legendIdlist[i]))
|
| | | {
|
| | | if (itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.LV))
|
| | | {
|
| | | legendValuelist.Add(itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]][itemConfig.LV]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void CalculateWingsLegendAttr(ItemConfig itemConfig,out List<int> legendIdlist, out List<int> legendValuelist)
|
| | | {
|
| | | legendIdlist = new List<int>();
|
| | | legendValuelist = new List<int>();
|
| | | var attrCntDict = itemTipsModel.wingsLegendAttrCntPreviewDict;
|
| | | var attrValueDict = itemTipsModel.wingsLegendAttrValuePreviewDict;
|
| | | int attrCnt = 0;
|
| | | if (attrCntDict.ContainsKey(itemConfig.LV))
|
| | | {
|
| | | attrCnt = attrCntDict[itemConfig.LV];
|
| | | }
|
| | | if (attrValueDict.ContainsKey(itemConfig.LV))
|
| | | {
|
| | | var attrIdDict = attrValueDict[itemConfig.LV];
|
| | | foreach (var attrId in attrIdDict.Keys)
|
| | | {
|
| | | if(legendIdlist.Count < attrCnt)
|
| | | {
|
| | | legendIdlist.Add(attrId);
|
| | | legendValuelist.Add(attrIdDict[attrId][0]);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | #region 预览定制属性逻辑处理
|
| | | public bool CheckIsCustomItem(ItemConfig itemConfig)
|
| | | {
|