From 1c52e8157043f6fe67dce27306d1517be0248449 Mon Sep 17 00:00:00 2001
From: ZXW <826696702@qq.com>
Date: 星期五, 10 八月 2018 17:14:08 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Compose/New/ComposeEquipWin.cs |   56 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/System/Compose/New/ComposeEquipWin.cs b/System/Compose/New/ComposeEquipWin.cs
index a5478e0..8c7bee8 100644
--- a/System/Compose/New/ComposeEquipWin.cs
+++ b/System/Compose/New/ComposeEquipWin.cs
@@ -112,7 +112,6 @@
             DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnComposeAnswer;
             UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
             UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
-            selectModel.haveSelectItemRefresh += RefreshComposeSuccessRate;
             successRate = 0;
             composeWinModel.funcType = ComposeFuncType.Equip;
             firstTypeDict = composeWinModel.GetFirstTypeModel();
@@ -136,7 +135,6 @@
         {
             selectModel.selectEquipEvent -= RefreshSelectItem;
             DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent -= OnComposeAnswer;
-            selectModel.haveSelectItemRefresh -= RefreshComposeSuccessRate;
         }
 
         protected override void OnAfterClose()
@@ -289,8 +287,8 @@
             if (preThirdType != curThirdType)
             {
                 preThirdType = curThirdType;
-                curComposeEquipIndex = -1;
             }
+            curComposeEquipIndex = -1;
             CreateCell();
             selectModel.ClearSelectModel();
         }
@@ -300,21 +298,38 @@
             if (thirdTypelist == null)
                 return;
 
-            ChangeUIState(false, true, false);
-            equipTypeLineCellCtrl.Refresh();
-            int line = thirdTypelist.Count / 3;
-            if(thirdTypelist.Count % 3 > 0)
+            if(thirdTypelist.Count > 1)
             {
-                line += 1;
+                ChangeUIState(false, true, false);
+                equipTypeLineCellCtrl.Refresh();
+                int line = thirdTypelist.Count / 3;
+                if (thirdTypelist.Count % 3 > 0)
+                {
+                    line += 1;
+                }
+                int i = 0;
+                for (i = 0; i < line; i++)
+                {
+                    equipTypeLineCellCtrl.AddCell(ScrollerDataType.Header, i);
+                }
+
+                equipTypeLineCellCtrl.Restart();
             }
-            int i = 0;
-            for(i = 0; i < line; i++)
+            else
             {
-                equipTypeLineCellCtrl.AddCell(ScrollerDataType.Header,i);
+                if(thirdTypelist.Count > 0)
+                {
+                    ItemCompoundConfig tagItemCompound = thirdTypelist[0];
+                    ClickEquipTypeCell(tagItemCompound, 0);
+                    RefreshUI(tagItemCompound);
+                }
             }
-
-            equipTypeLineCellCtrl.Restart();
-
+            
+            if(curComposeEquipIndex != -1)
+            {
+                ItemCompoundConfig tagItemCompound = thirdTypelist[curComposeEquipIndex];
+                ClickEquipTypeCell(tagItemCompound, curComposeEquipIndex);
+            }
         }
 
         private void RefreshEquipTypeLineCell(ScrollerDataType type, CellView cell)
@@ -336,10 +351,6 @@
                     icon.SetSprite(tagChinItem.IconKey);
                     bgIcon.SetItemBackGround(tagChinItem.ItemColor);
                     nameText.text = GeneralConfig.Instance.equipPlaceNameDict[tagChinItem.EquipPlace];
-                    if (index == curComposeEquipIndex)
-                    {
-                        ClickEquipTypeCell(tagItemCompound, index);
-                    }
                     cellBtn.RemoveAllListeners();
                     cellBtn.AddListener(()=> {
                         ClickEquipTypeCell(tagItemCompound,index);
@@ -637,15 +648,10 @@
 
         public void RefreshComposeSuccessRate()
         {
-            Dictionary<int, ItemModel> unfixedSelectItemDict = selectModel.GetHaveUnfixedSelectItem();
             successRate = 0;
-            if (unfixedSelectItemDict != null && compoundModel != null)
+            if (compoundModel != null)
             {
-                if (unfixedSelectItemDict.Count >= compoundModel.unfixedItemCount)
-                {
-                    successRate = compoundModel.successRate;
-
-                }
+                successRate = compoundModel.successRate;
             }
             successRateText.text = Language.Get("HallowsWin_Success", StringUtility.Contact(successRate / 100, "%"));
         }

--
Gitblit v1.8.0