| | |
| | | {
|
| | | string res = LocalSave.GetString(key);
|
| | | if (res == null)
|
| | | {
|
| | | DefaultMultiSelectCheck();
|
| | | return;
|
| | |
|
| | | }
|
| | | Dictionary<int, int> tempDict = new Dictionary<int, int>();
|
| | |
|
| | | var jsonData = JsonMapper.ToObject(res);
|
| | |
| | | tempDict.Add(int.Parse(keyList[i]), int.Parse(jsonData[keyList[i]].ToJson()));
|
| | | }
|
| | | if (tempDict.IsNullOrEmpty())
|
| | | {
|
| | | DefaultMultiSelectCheck();
|
| | | return;
|
| | | }
|
| | | bool isCheckLocalOk = CheckLocal(tempDict);
|
| | | if (isCheckLocalOk)
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | LocalSave.DeleteKey(key);
|
| | | DefaultMultiSelectCheck();
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | //如果没有配置,就勾上所有可勾选项,等级按默认配置
|
| | | void DefaultMultiSelectCheck()
|
| | | {
|
| | | if (nowChooseDict.Count == 0)
|
| | | {
|
| | | var itemIDToItemLVListDict = MineAreaItemConfig.GetItemIDToItemLVListDict();
|
| | | var itemIDToItemLVList = itemIDToItemLVListDict.Keys.ToList();
|
| | |
|
| | | for (int i = 0; i < itemIDToItemLVList.Count; i++)
|
| | | {
|
| | | int itemId = itemIDToItemLVList[i];
|
| | | if (!itemIDToItemLVListDict.TryGetValue(itemId, out var list) || list.IsNullOrEmpty())
|
| | | continue;
|
| | | int itemLv = list[0];
|
| | | //福地物品表没这项
|
| | | if (!MineAreaItemConfig.TryGetMineID(itemId, itemLv, out int mineId))
|
| | | continue;
|
| | | //这项现在是未解锁的
|
| | | MineAreaItemConfig mineAreaItemConfig = MineAreaItemConfig.Get(mineId);
|
| | | int limitLV = mineAreaItemConfig.LimitLV;
|
| | | int lv = PlayerDatas.Instance.baseData.LV;
|
| | | bool isLock = lv < limitLV;
|
| | | if (isLock)
|
| | | continue;
|
| | | nowChooseDict[itemId] = itemLv; |
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public void SaveLocal(bool isChoose, int itemId, int itemLV)
|