|
@@ -21,11 +21,13 @@ namespace GFGEditor
|
|
|
ItemCfg[] dataArray = ItemCfgArray.Instance.dataArray;
|
|
|
GetApproachCall[] actions = new GetApproachCall[] { GetClothingShopApproach, GetLeaguePrayApproach, GetLeagueAnswerApproach, CheckStoreApproach, GetClothingSyntheticApproach, GetSuitGuideApproach, GetSuitSyntheticApproach, GetClothingDecomposeApproach, CheckClothingFosterApproach, CheckDailyTaskApproach, GetZhaiXingApproach, GetStoryLevelApproach };
|
|
|
Dictionary<SuitCfg, List<int>> suitDic = new Dictionary<SuitCfg, List<int>>();
|
|
|
+ Dictionary<ItemCfg, List<int>> syntheticSuitDic = new Dictionary<ItemCfg, List<int>>();
|
|
|
int suitPartTotalCount = 0;
|
|
|
foreach (ItemCfg cfg in dataArray)
|
|
|
{
|
|
|
HandleItemAndSuitTable(cfg, suitDic);
|
|
|
HandleItemApproch(cfg, actions);
|
|
|
+ HandleItemSyntheticSuit(cfg, syntheticSuitDic);
|
|
|
}
|
|
|
var globalCfg = GlobalCfgArray.globalCfg;
|
|
|
SQLiteHelper.Instance.OpenConnection();
|
|
@@ -51,6 +53,14 @@ namespace GFGEditor
|
|
|
}
|
|
|
globalCfg.suitPartTotalCount = suitPartTotalCount;
|
|
|
UpdateGlobalCfg(globalCfg);
|
|
|
+
|
|
|
+ //材料对应的套装id
|
|
|
+ foreach (var a in syntheticSuitDic)
|
|
|
+ {
|
|
|
+ var names = new string[] { nameof(a.Key.syntheticSuitArr).Replace("Arr", "") };
|
|
|
+ var values = new string[] { string.Join(";", a.Value) };
|
|
|
+ SQLiteHelper.Instance.UpdateValues(nameof(ItemCfgArray), names, values, nameof(a.Key.id), a.Key.id.ToString());
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
@@ -69,6 +79,33 @@ namespace GFGEditor
|
|
|
SQLiteHelper.Instance.UpdateValues(nameof(GlobalCfgArray), names, values, nameof(globalCfg.id), globalCfg.id.ToString());
|
|
|
}
|
|
|
|
|
|
+ private static void HandleItemSyntheticSuit(ItemCfg itemCfg, Dictionary<ItemCfg, List<int>> syntheticSuitDic)
|
|
|
+ {
|
|
|
+ if (itemCfg.syntheticMateriarsArr.Length <= 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
|
+ {
|
|
|
+ ItemCfg materialItemCfg;
|
|
|
+ foreach (int[] materiars in itemCfg.syntheticMateriarsArr)
|
|
|
+ {
|
|
|
+ int materialId = materiars[0];
|
|
|
+ materialItemCfg = ItemCfgArray.Instance.GetCfg(materialId);
|
|
|
+ if (materialItemCfg != null)
|
|
|
+ {
|
|
|
+ syntheticSuitDic.TryGetValue(materialItemCfg, out var syntheticSuitList);
|
|
|
+ if (syntheticSuitList == null)
|
|
|
+ {
|
|
|
+ syntheticSuitList = new List<int>();
|
|
|
+ syntheticSuitDic[materialItemCfg] = syntheticSuitList;
|
|
|
+ }
|
|
|
+ syntheticSuitList.Add(itemCfg.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private static void HandleItemAndSuitTable(ItemCfg itemCfg, Dictionary<SuitCfg, List<int>> suitDic)
|
|
|
{
|
|
|
if (itemCfg.suitId <= 0)
|