少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-29 7dcbca7f53bcfa8df7811fd51097598469aaab9c
System/Compose/New/ComposeWingsWin.cs
@@ -114,8 +114,7 @@
            UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
            UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
            composeWinModel.funcType = ComposeFuncType.Wings;
            firstTypeDict = composeWinModel.GetFirstTypeModel();
            firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Wings);
            bool isJumpTo = false;
            SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
            if (successConfig != null && successConfig.Type == 69)
@@ -123,7 +122,7 @@
                isJumpTo = true;
                curSecondType = composeWinModel.secondType;
                curThirdType = composeWinModel.thirdType;
                secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
                secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings,composeWinModel.secondType);
                ClickSecondTypeUICtrl();
                composeWinModel.ResetJumpToModel();
            }
@@ -134,7 +133,7 @@
                    isJumpTo = true;
                    curSecondType = composeWinModel.secondType;
                    curThirdType = composeWinModel.thirdType;
                    secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
                    secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, composeWinModel.secondType);
                    ClickSecondTypeUICtrl();
                    composeWinModel.ResetJumpToModel();
                }
@@ -155,7 +154,7 @@
                {
                    isJumpTo = false;
                    bool isCanCompose = true;
                    if(!composeWinModel.IsEnoughFixedMat() || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
                    if(!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
                    {
                        MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
                        isCanCompose = false;
@@ -260,7 +259,7 @@
                        {
                            icon.SetSprite("ComposeFirstClassChoosebtn");
                            arrowIcon.transform.localRotation = Quaternion.Euler(0,0,-90);
                            secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
                            secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, curSecondType);
                            //ClickSecondTypeUICtrl();
                        }
                        else
@@ -278,7 +277,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
@@ -293,7 +292,7 @@
        private void OnClickSecondType(int secondType)
        {
            curSecondType = secondType;
            secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
            secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, curSecondType);
            foreach(var thirdType in secondTypeDict.Keys)
            {
                if(thirdType != 0)
@@ -376,10 +375,11 @@
            #region 合成物品UI
            for (i = 0; i < previewItemlist.Count; i++)
            {
                int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.MakeIds);
                GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
                if (i < composeWinModel.makeIDs.Length)
                if (i < makeIds.Length)
                {
                    RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
                    RefreshGridCellUI(gridCell, false, makeIds[i],NeedMatType.MakeItem);
                }
                else
                {
@@ -389,8 +389,12 @@
            #endregion
            #region 固定道具和不固定道具UI
            for(i = 0;i < sourceItemlist.Count; 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 < sourceItemlist.Count; i++)
            {
                GameObject gridCell = sourceItemlist[i].transform.Find("GridCell").gameObject;
                Text putInText = sourceItemlist[i].transform.Find("PutInText").GetComponent<Text>();
@@ -400,23 +404,23 @@
                RefreshGridCellUI(gridCell,true);
            }
            for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
            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);
                }
            }
            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>();
@@ -545,22 +549,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;
                        }
@@ -628,7 +634,7 @@
        private bool ChangeFixedMatUI()
        {
            SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
            if (singlePack == null) return false;
            if (singlePack == null || compoundModel == null) return false;
            bool isBind = false;
            Dictionary<int,ItemModel> unfixedMatDict = selectModel.GetHaveUnfixedSelectItem();
@@ -640,13 +646,16 @@
                    break;
                }
            }
            for (int i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
            int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
            int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
            int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
            for (int 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];
                    ItemCell itemCell = matPos.transform.Find("GridCell/ItemCell").GetComponent<ItemCell>();
                    int fixedId = composeWinModel.costfixedItemIDs[i];
                    int fixedId = fixedIds[i];
                    itemCell.bindIcon.gameObject.SetActive(false);
                    if (isBind)
                    {
@@ -743,7 +752,7 @@
        {
            fixedItemIndexDict.Clear();
            SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
            if (singlePack == null) return;
            if (singlePack == null || compoundModel == null) return;
            int isBind = 0;
            if(IsComposeBind)
@@ -754,13 +763,14 @@
            {
                isBind = 0;
            }
            for(int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
            int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
            int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
            for (int i = 0; i < fixedIds.Length; i++)
            {
                List<int> itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i],isBind);
                List<int> itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i], fixedCounts[i],isBind);
                if (itemIndexlist != null)
                {
                    fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
                    fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
                }
            }
@@ -768,7 +778,10 @@
        private UIEffect GetPlayMatEffect()
        {
            int matTypeCnt = compoundModel.unfixedItemCount + composeWinModel.costfixedItemIDs.Length;
            if(compoundModel == null) return null;
            int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.FixedIds);
            int matTypeCnt = compoundModel.unfixedItemCount + fixedIds.Length;
            switch (matTypeCnt)
            {
                case 1:
@@ -789,12 +802,13 @@
            if (answer.Result == 1)
            {
                successEffect.Play();
                int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.MakeIds);
                for (int i = 0; i < previewItemlist.Count; i++)
                {
                    UIEffect targetEffect = previewItemlist[i].transform.Find("GridCell/TargetEffect").GetComponent<UIEffect>();
                    if (i < composeWinModel.makeIDs.Length)
                    if (i < makeIds.Length)
                    {
                        if(composeWinModel.makeIDs[i] == answer.MakeItemID)
                        if(makeIds[i] == answer.MakeItemID)
                        {
                            targetEffect.Play();
                            break;