少年修仙传客户端代码仓库
QD-PangDeRong
2018-08-10 ae45b4e392a542eaa040b0b1c5c92c2a14376dd1
【2058】装备合成优化
1个文件已修改
56 ■■■■■ 已修改文件
System/Compose/New/ComposeEquipWin.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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, "%"));
        }