| | |
| | | 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();
|
| | |
| | | {
|
| | | selectModel.selectEquipEvent -= RefreshSelectItem;
|
| | | DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent -= OnComposeAnswer;
|
| | | selectModel.haveSelectItemRefresh -= RefreshComposeSuccessRate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | if (preThirdType != curThirdType)
|
| | | {
|
| | | preThirdType = curThirdType;
|
| | | curComposeEquipIndex = -1;
|
| | | }
|
| | | curComposeEquipIndex = -1;
|
| | | CreateCell();
|
| | | selectModel.ClearSelectModel();
|
| | | }
|
| | |
| | | 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)
|
| | |
| | | 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);
|
| | |
| | |
|
| | | 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, "%"));
|
| | | }
|