From 7dcbca7f53bcfa8df7811fd51097598469aaab9c Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期三, 29 八月 2018 15:28:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Compose/New/ComposeDogzEquipWin.cs |   61 ++++++++++++++++++------------
 1 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/System/Compose/New/ComposeDogzEquipWin.cs b/System/Compose/New/ComposeDogzEquipWin.cs
index 1aee84e..d9201be 100644
--- a/System/Compose/New/ComposeDogzEquipWin.cs
+++ b/System/Compose/New/ComposeDogzEquipWin.cs
@@ -104,8 +104,7 @@
             UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
             UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
             successRate = 0;
-            composeWinModel.funcType = ComposeFuncType.MountDogz;
-            firstTypeDict = composeWinModel.GetFirstTypeModel();
+            firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.MountDogz);
             CreateCell();
             if(curSecondType == 0)
             {
@@ -208,7 +207,7 @@
                         {
                             arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
                             icon.SetSprite("ComposeFirstClassChoosebtn");
-                            secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+                            secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.MountDogz, curSecondType);
                         }
                         else
                         {
@@ -225,7 +224,7 @@
                     if (curThirdType == cell.index)
                     {
                         icon.SetSprite("ChildListBtn_Select");
-                        thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
+                        thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType,cell.index);
                         RefreshUI(compoundModel);
                     }
                     else
@@ -240,7 +239,7 @@
         private void OnClickSecondType(int secondType)
         {
             curSecondType = secondType;
-            secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+            secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.MountDogz, curSecondType);
 
             foreach (var thirdType in secondTypeDict.Keys)
             {
@@ -334,14 +333,19 @@
             for (i = 0; i < previewItemlist.Count; i++)
             {
                 GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
-                if (i < composeWinModel.makeIDs.Length)
+                int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.MakeIds);
+                if(makeIds != null)
                 {
-                    RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
+                    if (i < makeIds.Length)
+                    {
+                        RefreshGridCellUI(gridCell, false, makeIds[i], NeedMatType.MakeItem);
+                    }
+                    else
+                    {
+                        RefreshGridCellUI(gridCell, true);
+                    }
                 }
-                else
-                {
-                    RefreshGridCellUI(gridCell,true);
-                }
+               
             }
             #endregion
 
@@ -357,34 +361,39 @@
                 posBtn.RemoveAllListeners();
             }
             fixedItemIndexDict.Clear();
-            for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
+            int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
+            int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+            int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+            int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedIds);
+            int[] unfixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedDisplay);
+            for (i = 0; i < fixedDisplay.Length; i++)
             {
-                if (composeWinModel.fixedItemDisplay[i] != 0)
+                if (fixedDisplay[i] != 0)
                 {
-                    GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
+                    GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
                     GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
                     Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
                     putInText.gameObject.SetActive(false);
-                    RefreshGridCellUI(gridCell,false,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
+                    RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
                    
                     List<int> itemIndexlist = null;
                     SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
                     if (singlePack != null)
                     {
-                        itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
+                        itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
                     }
                     if (itemIndexlist != null)
                     {
-                        fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+                        fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
                     }
                 }
             }
 
-            for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
+            for (i = 0; i < unfixedDisplay.Length; i++)
             {
-                if (composeWinModel.unfixedItemDisplay[i] != 0)
+                if (unfixedDisplay[i] != 0)
                 {
-                    GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
+                    GameObject matPos = sourceItemlist[unfixedDisplay[i] - 1];
                     GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
                     Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
                     Button posBtn = matPos.GetComponent<Button>();
@@ -484,22 +493,24 @@
 
                 if (matType == NeedMatType.fixedItem)
                 {
+                    int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.FixedIds);
+                    int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
                     itemCell.countText.gameObject.SetActive(true);
                     int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
                     int i = 0;
-                    for(i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+                    for(i = 0; i < fixedIds.Length; i++)
                     {
-                        if(composeWinModel.costfixedItemIDs[i] == itemId)
+                        if(fixedIds[i] == itemId)
                         {
-                            if (haveCount >= composeWinModel.costfixedItemCounts[i])
+                            if (haveCount >= fixedCounts[i])
                             {
                                 itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
-                                    "/",composeWinModel.costfixedItemCounts[i].ToString());
+                                    "/", fixedCounts[i].ToString());
                             }
                             else
                             {
                                 itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
-                                    "/", composeWinModel.costfixedItemCounts[i].ToString());
+                                    "/", fixedCounts[i].ToString());
                             }
                             break;
                         }

--
Gitblit v1.8.0