From bd5250bad6e53291bd520e56942fa141d4a79c2b Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期五, 31 八月 2018 11:59:32 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Compose/New/ComposeWinModel.cs |   81 ++++++++++++++++++----------------------
 1 files changed, 36 insertions(+), 45 deletions(-)

diff --git a/System/Compose/New/ComposeWinModel.cs b/System/Compose/New/ComposeWinModel.cs
index 2993978..70f69fd 100644
--- a/System/Compose/New/ComposeWinModel.cs
+++ b/System/Compose/New/ComposeWinModel.cs
@@ -11,7 +11,6 @@
     private Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> firstTypeDict = null;
     private Dictionary<int, List<ItemCompoundConfig>> secondTypeDict = null;
     private Dictionary<int, List<int>> composeJobLimitDict = new Dictionary<int, List<int>>();
-    public ComposeFuncType funcType = ComposeFuncType.Wings;
     private FuncConfigConfig addonsFormulaModel;
     public event Action ResetModelEvent;
     SelectEquipModel _selectModel;
@@ -796,57 +795,50 @@
 
     #region 澶勭悊璺宠浆鐣岄潰鏁版嵁
 
-    public bool CheckComposeItemById(int itemId)
+    public bool CheckComposeItemById(int itemId,out int jumpId)
     {
+        jumpId = 0;
         ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
         if (itemConfig == null) return false;
 
-        switch(itemConfig.Type)
+        ItemCompoundConfig itemCompound = Config.Instance.Get<ItemCompoundConfig>(itemConfig.ComposeID);
+        if(itemCompound.levelNeed <= PlayerDatas.Instance.baseData.LV)
         {
-            case 25:
-            case 35:
-                funcType = ComposeFuncType.Item;
-                break;
-            case 39:
-                funcType = ComposeFuncType.Wings;
-                break;
-            case 44:
-                funcType = ComposeFuncType.Ticket;
-                break;
-        }
-
-        firstTypeDict = ItemCompoundConfig.GetAllFirstComposeTypeDict((int)funcType);
-        if (firstTypeDict != null)
-        {
-            foreach (var secondType in firstTypeDict.Keys)
+            switch (itemCompound.firstType)
             {
-                Dictionary<int, List<ItemCompoundConfig>> secondTypeDict = firstTypeDict[secondType];
-                foreach(var thirdType in secondTypeDict.Keys)
-                {
-                    for(int i = 0; i < secondTypeDict[thirdType].Count; i++)
-                    {
-                        ItemCompoundConfig compoundConfig = secondTypeDict[thirdType][i];
-                        int[] fixedIds = ConfigParse.GetMultipleStr<int>(compoundConfig.itemID);
-                        if(fixedIds.Contains(itemId))
-                        {
-                            if(compoundConfig.levelNeed <= PlayerDatas.Instance.baseData.LV)
-                            {
-                                this.secondType = secondType;
-                                this.thirdType = thirdType;
-                                return true;
-                            }
-                            else
-                            {
-                                SysNotifyMgr.Instance.ShowTip("TicketComposeUnlock",compoundConfig.levelNeed,compoundConfig.secondTypeName);
-                                return false;
-                            }
-                        }
-                    }
-                }
+                case 1:
+                    jumpId = (int)JumpUIType.ComposeFunc1;
+                    break;
+                case 2:
+                    jumpId = (int)JumpUIType.ComposeFunc2;
+                    break;
+                case 3:
+                    jumpId = (int)JumpUIType.ComposeFunc3;
+                    break;
+                case 4:
+                    jumpId = (int)JumpUIType.ComposeFunc4;
+                    break;
+                case 5:
+                    jumpId = (int)JumpUIType.ComposeFunc5;
+                    break;
             }
-        }
+            this.secondType = itemCompound.secondType;
 
-        return false;
+            if(itemConfig.ComposeID == 223)
+            {
+                this.thirdType = PlayerDatas.Instance.baseData.Job;
+            }
+            else
+            {
+                this.thirdType = itemCompound.thirdType;
+            }
+            return true;
+        }
+        else
+        {
+            SysNotifyMgr.Instance.ShowTip("TicketComposeUnlock", itemCompound.levelNeed, itemCompound.secondTypeName);
+            return false;
+        }
     }
 
     public int secondType { get; private set; }
@@ -855,7 +847,6 @@
     {
         this.secondType = secondType;
         this.thirdType = thirdType;
-        funcType = type;
         GetFirstTypeModel((int)type);
         Dictionary<int, List<ItemCompoundConfig>> dict = GetSecondTypeModel((int)type,secondType);
         if(dict == null)

--
Gitblit v1.8.0