| | |
| | | [XLua.LuaCallCSharp]
|
| | | public class SelectEquipModel : Model
|
| | | {
|
| | | ComposeWinModel composeWinModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | ComposeWinModel composeWinModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | private FuncConfigConfig addonsTypeModel;
|
| | | private FuncConfigConfig addonsQualityModel;
|
| | |
|
| | | private Dictionary<int, ItemModel> _unfixedItemDict = new Dictionary<int, ItemModel>(); //key 物品在背包索引
|
| | | private Dictionary<int, ItemModel> _addonsItemDict = new Dictionary<int, ItemModel>(); //key 物品在背包索引
|
| | | private int[] _addonsTypelist = null;
|
| | | private List<int> addonsTypelist = new List<int>();
|
| | | private int[] _addonsQualitylist = null;
|
| | | private Dictionary<int, ItemModel> allBagItemInfo;
|
| | |
|
| | |
| | | {
|
| | | addonsTypeModel = FuncConfigConfig.Get("ComposeAddonsType");
|
| | | addonsQualityModel = FuncConfigConfig.Get("ComposeAddonsQuality");
|
| | | _addonsTypelist = ConfigParse.GetMultipleStr<int>(addonsTypeModel.Numerical1);
|
| | | addonsTypelist.AddRange(ConfigParse.GetMultipleStr<int>(addonsTypeModel.Numerical1));
|
| | | _addonsQualitylist = ConfigParse.GetMultipleStr<int>(addonsQualityModel.Numerical1);
|
| | | FuncConfigConfig onekeyPut = FuncConfigConfig.Get("ComposeAutoLimit");
|
| | | var onekeyPut = FuncConfigConfig.Get("ComposeAutoLimit");
|
| | | extraOneKeyPutCondis = ConfigParse.GetMultipleStr<int>(onekeyPut.Numerical1);
|
| | | noOneKeyPutCondis = ConfigParse.GetMultipleStr<int>(onekeyPut.Numerical2);
|
| | | }
|
| | |
| | | if (singlePack == null) return null;
|
| | |
|
| | | allBagItemInfo = singlePack.GetAllItems();
|
| | | List<ItemModel> modellist = allBagItemInfo.Values.ToList();
|
| | | modellist.Sort(CompareByCondition);
|
| | | var items = allBagItemInfo.Values.ToList();
|
| | | items.Sort(CompareByCondition);
|
| | | _addonsItemDict.Clear();
|
| | |
|
| | | for (int i = 0; i < modellist.Count; i++)
|
| | | for (int i = 0; i < items.Count; i++)
|
| | | {
|
| | | ItemModel itemModel = modellist[i];
|
| | | int index = itemModel.gridIndex;
|
| | | var item = items[i];
|
| | | int index = item.gridIndex;
|
| | | if (!haveAddSelectItemDic.ContainsKey(index))
|
| | | {
|
| | | switch ((RoleEquipType)itemModel.config.EquipPlace)
|
| | | if (ItemLogicUtility.Instance.IsOverdue(item.guid))
|
| | | {
|
| | | case RoleEquipType.Guard1:
|
| | | bool isOverdue = ItemLogicUtility.Instance.IsOverdue(itemModel.guid);
|
| | | if (isOverdue)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | break;
|
| | | continue;
|
| | | }
|
| | | int j = 0;
|
| | | for (j = 0; j < _addonsTypelist.Length; j++)
|
| | |
|
| | | if (addonsTypelist.Contains(item.config.Type))
|
| | | {
|
| | | if (_addonsTypelist[j] == modellist[i].config.Type)
|
| | | if (items[i].config.LV >= _addonsQualitylist[0] && items[i].config.ItemColor >= _addonsQualitylist[1])
|
| | | {
|
| | | if (modellist[i].config.LV >= _addonsQualitylist[0]
|
| | | && modellist[i].config.ItemColor >= _addonsQualitylist[1])
|
| | | {
|
| | | _addonsItemDict.Add(index, modellist[i]);
|
| | | break;
|
| | | }
|
| | | _addonsItemDict.Add(index, items[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return _addonsItemDict;
|
| | | }
|
| | |
|