少年修仙传客户端代码仓库
client_Wu Xijin
2019-05-23 36629fe8535c6745626100ce63a08a19a7eca9bd
6915 装备分解优化
4个文件已删除
4个文件已修改
3643 ■■■■■ 已修改文件
Lua/Gen/SnxxzUIPackModelWrap.cs 3105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/SnxxzUIPackModelWrap.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/XLuaGenAutoRegister.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/EquipDevourWin.cs 289 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/EquipLvSelect.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/EquipLvSelect.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/PackModel.cs 195 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/SystemSetting/SettingEffectMgr.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/SnxxzUIPackModelWrap.cs
File was deleted
Lua/Gen/SnxxzUIPackModelWrap.cs.meta
File was deleted
Lua/Gen/XLuaGenAutoRegister.cs
@@ -1191,9 +1191,6 @@
            translator.DelayWrapLoader(typeof(Snxxz.UI.ItemTipsModel), SnxxzUIItemTipsModelWrap.__Register);
        
        
            translator.DelayWrapLoader(typeof(Snxxz.UI.PackModel), SnxxzUIPackModelWrap.__Register);
            translator.DelayWrapLoader(typeof(Snxxz.UI.TreasureEffectModel), SnxxzUITreasureEffectModelWrap.__Register);
        
        
System/KnapSack/Logic/EquipDevourWin.cs
@@ -13,20 +13,13 @@
        [SerializeField] ScrollerController gridCtrl;
        [SerializeField] Button devourBtn;
        [SerializeField] Button equipColorSelectBtn;
        [SerializeField] Button equipLvSelectBtn;
        [SerializeField] Text equipColorText;
        [SerializeField] Text equipLvText;
        [SerializeField] GameObject colorlistObj;
        [SerializeField] GameObject lvlistObj;
        [SerializeField] ClickScreenOtherSpace colorSpaceClick;
        [SerializeField] ClickScreenOtherSpace lvSpaceClick;
        [SerializeField] UIEffect equipDevourEffect;
        [Header("颜色选择列表")]
        [SerializeField] List<EquipColorSelect> colorSelectlist = new List<EquipColorSelect>();
        [Header("阶级选择列表")]
        [SerializeField]
        List<EquipLvSelect> lvSelectlist = new List<EquipLvSelect>();
        [Header("分解装备属性")]
        [SerializeField] Text decomLvText;
@@ -53,17 +46,14 @@
        protected override void BindController()
        {
            colorlistObj.SetActive(true);
            lvlistObj.SetActive(true);
            gridCtrl.OnRefreshCell += RefreshGridCell;
        }
        protected override void AddListeners()
        {
            equipColorSelectBtn.AddListener(ClickColorSelectBtn);
            equipLvSelectBtn.AddListener(ClickLvSelectBtn);
            devourBtn.AddListener(ClickEquipDecomBtn);
            colorSpaceClick.AddListener(ClickColorSelectBtn);
            lvSpaceClick.AddListener(ClickLvSelectBtn);
        }
        protected override void OnPreOpen()
@@ -80,17 +70,13 @@
        {
            this.transform.SetAsLastSibling();
            colorlistObj.SetActive(false);
            lvlistObj.SetActive(false);
            RefreshColor(playerPack.colorType);
            RefreshLv(playerPack.lvType);
            OnRefreshColor(playerPack.colorType);
            StartCoroutine(SetJumpIndex(0));
            playerPack.RefreshColorSelectAct += RefreshColor;
            playerPack.RefreshLvSelectAct += RefreshLv;
            playerPack.RefreshStarSelectAct += RefreshStar;
            playerPack.RefreshColorSelectAct += OnRefreshColor;
            playerPack.itemCntAddEvent += RefreshAddItem;
            playerPack.itemCntReduceEvent += RefreshReduceItem;
            playerPack.refrechPackEvent += RefreshPack;
            playerPack.refrechPackEvent += OnRefreshPack;
            playerPack.RefreshDecomAttrAct += RefreshDecomAttr;
            equipDevourEffect.OnComplete += OnCompleteEvent;
            playerPack.RefreshEquipDecomNumAct += RefreshDecomPreviewAttr;
@@ -99,12 +85,10 @@
        protected override void OnPreClose()
        {
            equipDevourEffect.OnComplete -= OnCompleteEvent;
            playerPack.RefreshColorSelectAct -= RefreshColor;
            playerPack.RefreshLvSelectAct -= RefreshLv;
            playerPack.RefreshColorSelectAct -= OnRefreshColor;
            playerPack.itemCntAddEvent -= RefreshAddItem;
            playerPack.itemCntReduceEvent -= RefreshReduceItem;
            playerPack.refrechPackEvent -= RefreshPack;
            playerPack.RefreshStarSelectAct -= RefreshStar;
            playerPack.refrechPackEvent -= OnRefreshPack;
            playerPack.RefreshDecomAttrAct -= RefreshDecomAttr;
            playerPack.RefreshEquipDecomNumAct -= RefreshDecomPreviewAttr;
        }
@@ -122,12 +106,12 @@
            RefreshDecomposeAttr();
            RefreshDecomPreviewAttr();
            ItemConfig getMatConfig = ItemConfig.Get(2125);
            if(getMatConfig != null)
            if (getMatConfig != null)
            {
                getMatBgImg.SetItemBackGround(getMatConfig.ItemColor);
                getMatIcon.SetSprite(getMatConfig.IconKey);
                getMatBtn.RemoveAllListeners();
                getMatBtn.AddListener(()=>
                getMatBtn.AddListener(() =>
                {
                    ItemTipUtility.Show(getMatConfig.ID);
                });
@@ -144,7 +128,7 @@
        private void RefreshGeMatProgress()
        {
            getMatProgressText.text = Language.Get("EquipDevour_Text5",StringUtility.Contact(playerPack.decomposeProgress,"/",getMatCycle));
            getMatProgressText.text = Language.Get("EquipDevour_Text5", StringUtility.Contact(playerPack.decomposeProgress, "/", getMatCycle));
        }
        private void RefreshAddItem(PackType type, int index, int id)
@@ -153,7 +137,7 @@
            if (type != PackType.Item || (type == PackType.Item && itemConfig.Type != 29 && itemConfig.EquipPlace <= 0)) return;
            devourModellist = playerPack.GetDevourModellist();
            ItemModel itemModel = playerPack.GetItemByIndex(type,index);
            ItemModel itemModel = playerPack.GetItemByIndex(type, index);
            playerPack.RefreshGetNewItem(itemModel);
            gridCtrl.m_Scorller.RefreshActiveCellViews();
        }
@@ -164,12 +148,12 @@
            if (type != PackType.Item || (type == PackType.Item && itemConfig.Type != 29 && itemConfig.EquipPlace <= 0)) return;
            devourModellist = playerPack.GetDevourModellist();
            ItemModel itemModel = playerPack.GetItemByIndex(type,index);
            if(itemModel == null)
            ItemModel itemModel = playerPack.GetItemByIndex(type, index);
            if (itemModel == null)
            {
                for(int i = 0; i < playerPack.selectDevourlist.Count; i++)
                for (int i = 0; i < playerPack.selectDevourlist.Count; i++)
                {
                    if(playerPack.selectDevourlist[i].gridIndex == index)
                    if (playerPack.selectDevourlist[i].gridIndex == index)
                    {
                        playerPack.selectDevourlist.RemoveAt(i);
                        break;
@@ -180,8 +164,7 @@
            gridCtrl.m_Scorller.RefreshActiveCellViews();
        }
        private void RefreshPack(PackType type)
        private void OnRefreshPack(PackType type)
        {
            if (type != PackType.Item) return;
            playerPack.selectDevourlist.Clear();
@@ -190,26 +173,7 @@
            gridCtrl.m_Scorller.RefreshActiveCellViews();
        }
        private void RefreshLv(PackModel.EquipLvType type)
        {
            for (int i = 0; i < lvSelectlist.Count; i++)
            {
                if (lvSelectlist[i].lvType == type)
                {
                    equipLvText.text = lvSelectlist[i].lvText.text;
                    equipLvText.color = lvSelectlist[i].lvText.color;
                    break;
                }
            }
            if (!isOpen)
            {
                lvlistObj.SetActive(false);
                playerPack.GetSelectDevourList();
                gridCtrl.m_Scorller.RefreshActiveCellViews();
            }
        }
        private void RefreshColor(PackModel.EquipColorType type)
        private void OnRefreshColor(PackModel.EquipColorType type)
        {
            for (int i = 0; i < colorSelectlist.Count; i++)
            {
@@ -228,22 +192,13 @@
            }
        }
        private void RefreshStar(PackModel.EquipStarType type)
        {
            if (!isOpen)
            {
                playerPack.GetSelectDevourList();
                gridCtrl.m_Scorller.RefreshActiveCellViews();
            }
        }
        private void CreateCell()
        {
            gridCtrl.Refresh();
            int line = sumGridNum / singleLineNum;
            for(int i = 0; i < line; i++)
            for (int i = 0; i < line; i++)
            {
                gridCtrl.AddCell(ScrollerDataType.Header,i);
                gridCtrl.AddCell(ScrollerDataType.Header, i);
            }
            gridCtrl.Restart();
        }
@@ -251,7 +206,7 @@
        private void RefreshGridCell(ScrollerDataType type, CellView cell)
        {
            int childLength = cell.transform.childCount;
            for(int i = 0; i < childLength; i++)
            for (int i = 0; i < childLength; i++)
            {
                int cellCnt = cell.index * singleLineNum + (i + 1);
                DevourGridCell gridCell = cell.transform.GetChild(i).GetComponent<DevourGridCell>();
@@ -274,21 +229,9 @@
            }
        }
        private void ClickLvSelectBtn()
        {
            if (lvlistObj.activeInHierarchy)
            {
                lvlistObj.SetActive(false);
            }
            else
            {
                lvlistObj.SetActive(true);
            }
        }
        private void ClickColorSelectBtn()
        {
            if(colorlistObj.activeInHierarchy)
            if (colorlistObj.activeInHierarchy)
            {
                colorlistObj.SetActive(false);
            }
@@ -313,14 +256,13 @@
                WindowCenter.Instance.Open<DecomposeGetItemWin>();
            }
        }
        public void RefreshDecomposeAttr(bool isRefresh = false)
        void RefreshDecomposeAttr(bool isRefresh = false)
        {
            //decomPreviewLvText.gameObject.SetActive(false);
            decomLvText.text = playerPack.decomposeLv.ToString();
            EquipDeComposeConfig deComposeConfig = EquipDeComposeConfig.Get(playerPack.decomposeLv);
            expNumText.text = StringUtility.Contact(playerPack.decomposeExp,"/",deComposeConfig.UpNeedExp);
            if(!isRefresh)
            expNumText.text = StringUtility.Contact(playerPack.decomposeExp, "/", deComposeConfig.UpNeedExp);
            if (!isRefresh)
            {
                expSlider.delay = 0;
                expSlider.ResetStage();
@@ -328,28 +270,28 @@
            else
            {
                expSlider.delay = 0.1f;
            }
            expSlider.stage = playerPack.decomposeLv;
            expSlider.value = (float)Math.Round((double)playerPack.decomposeExp / deComposeConfig.UpNeedExp, 2, MidpointRounding.AwayFromZero);//经验条的初始化和刷新
            Dictionary<int, int> attrDict = playerPack.GetDecomAttrDictByLv(playerPack.decomposeLv);
            var attrDict = playerPack.GetDecomAttrDictByLv(playerPack.decomposeLv);
            List<int> attrIdlist = null;
            List<int> attrValuelist = null;
            if(attrDict != null)
            if (attrDict != null)
            {
                attrIdlist = attrDict.Keys.ToList();
                attrValuelist = attrDict.Values.ToList();
            }
            for(int i = 0; i < decomAttrlist.Count; i++)
            for (int i = 0; i < decomAttrlist.Count; i++)
            {
                if (attrIdlist != null)
                {
                    if(i < attrIdlist.Count)
                    if (i < attrIdlist.Count)
                    {
                        decomAttrlist[i].SetActive(true);
                        decomAttrPreviewlist[i].gameObject.SetActive(false);
                        PlayerPropertyConfig propertyConfig = PlayerPropertyConfig.Get(attrIdlist[i]);
                        decomAttrNamelist[i].text = StringUtility.Contact(propertyConfig.Name,":");
                        decomAttrNamelist[i].text = StringUtility.Contact(propertyConfig.Name, ":");
                        decomAttrValuelist[i].text = attrValuelist[i].ToString();
                    }
@@ -366,19 +308,16 @@
        }
        int equipAddExpPreview = 0;
        public void RefreshDecomPreviewAttr()
        void RefreshDecomPreviewAttr()
        {
            equipAddExpPreview = 0;
            EquipDeComposeConfig deComposeConfig = EquipDeComposeConfig.Get(playerPack.decomposeLv);
            if (playerPack.selectDevourlist.Count > 0)
            {
                int devourCnt = GetRealDevourCnt();
                equipAddExpPreview = GetPreviewExpByDevour();
                int previewLv = GetPreviewDecomposeLv(playerPack.decomposeLv, 0);
                //decomPreviewLvText.gameObject.SetActive(true);
                //decomPreviewLvText.text = StringUtility.Contact("+", previewLv - playerPack.decomposeLv);
                Dictionary<int, int> attrDict = playerPack.GetDecomAttrDictByLv(playerPack.decomposeLv);
                Dictionary<int, int> attrPreviewDict = playerPack.GetDecomAttrDictByLv(previewLv);
                var previewLv = GetPreviewDecomposeLv(playerPack.decomposeLv, 0);
                var attrDict = playerPack.GetDecomAttrDictByLv(playerPack.decomposeLv);
                var attrPreviewDict = playerPack.GetDecomAttrDictByLv(previewLv);
                if (attrDict != null)
                {
                    int i = 0;
@@ -396,8 +335,8 @@
                        i += 1;
                    }
                }
                string previewExp = StringUtility.Contact(playerPack.decomposeExp,"+",equipAddExpPreview);
                expNumText.text = StringUtility.Contact(UIHelper.AppendColor(TextColType.Green,previewExp,true),"/"+ deComposeConfig.UpNeedExp);
                string previewExp = StringUtility.Contact(playerPack.decomposeExp, "+", equipAddExpPreview);
                expNumText.text = StringUtility.Contact(UIHelper.AppendColor(TextColType.Green, previewExp, true), "/" + deComposeConfig.UpNeedExp);
            }
            else
            {
@@ -405,10 +344,10 @@
            }
        }
        public int GetPreviewDecomposeLv(int decomLv,int sumNeedExp)
        public int GetPreviewDecomposeLv(int decomLv, int sumNeedExp)
        {
            EquipDeComposeConfig deComposeConfig = EquipDeComposeConfig.Get(decomLv);
            if(!playerPack.IsMaxDecomLv(decomLv,out decomLv))
            if (!playerPack.IsMaxDecomLv(decomLv, out decomLv))
            {
                if (decomLv == playerPack.decomposeLv)
                {
@@ -436,87 +375,27 @@
                SysNotifyMgr.Instance.ShowTip("EquipDevour_Text_1");
                return;
            }
            int devourCnt = GetRealDevourCnt();
            int betterEquip = 0;
            int preciousCnt = 0;
            int twoStarCnt = 0;
            bool isContain = playerPack.ContainPreciousItem(realDevourlist, out betterEquip, out preciousCnt);
            bool isTwoStarEquip = playerPack.ContainTwoStarEquip(realDevourlist,out twoStarCnt);
            if (isContain || isTwoStarEquip)
            var betterEquipCount = GetBetterEquipCount(playerPack.selectDevourlist);
            if (betterEquipCount > 0)
            {
               if(betterEquip > 0 && preciousCnt > 0)
                {
                   ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
                   Language.Get("EquipResolve_Text_1", betterEquip, preciousCnt),
                   (bool isOk) =>
                   {
                       if (isOk)
                       {
                           equipDevourEffect.Play();
                           SendEquipdevourQuest();
                       }
                   });
                }
               else if(twoStarCnt > 0 && preciousCnt > 0)
                {
                    ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
                      Language.Get("EquipResolve_Text_6", twoStarCnt, preciousCnt),
                      (bool isOk) =>
                ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
                   Language.Get("EquipResolve_Text_1", betterEquipCount),
                  (bool ok) =>
                  {
                      if (ok)
                      {
                          if (isOk)
                          {
                              equipDevourEffect.Play();
                              SendEquipdevourQuest();
                          }
                      });
                }
               else if(betterEquip > 0)
                {
                    ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
                     Language.Get("EquipResolve_Text_5", betterEquip),
                    (bool isOk) =>
                    {
                        if (isOk)
                        {
                            equipDevourEffect.Play();
                            SendEquipdevourQuest();
                        }
                    });
                }
               else if(preciousCnt > 0)
                {
                    ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
                       Language.Get("EquipResolve_Text_4",preciousCnt),
                      (bool isOk) =>
                      {
                          if (isOk)
                          {
                              equipDevourEffect.Play();
                              SendEquipdevourQuest();
                          }
                      });
                }
               else if(twoStarCnt > 0)
                {
                    ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
                      Language.Get("EquipResolve_Text_7", twoStarCnt),
                     (bool isOk) =>
                     {
                         if (isOk)
                         {
                             equipDevourEffect.Play();
                             SendEquipdevourQuest();
                         }
                     });
                }
                          equipDevourEffect.Play();
                          playerPack.SendEquipdevourQuest(false);
                      }
                  });
            }
            else
            {
                equipDevourEffect.Play();
                SendEquipdevourQuest();
                playerPack.SendEquipdevourQuest(false);
            }
        }
        private void OnCompleteEvent()
@@ -524,20 +403,38 @@
            decomEffect.Play();
        }
        public int GetPreviewExpByDevour()
        int GetBetterEquipCount(List<ItemModel> itemModels)
        {
            if (itemModels.IsNullOrEmpty())
            {
                return 0;
            }
            var count = 0;
            foreach (var item in itemModels)
            {
                if (ItemLogicUtility.Instance.IsFightUp(item.itemId, item.score) == 1)
                {
                    count += item.count;
                }
            }
            return count;
        }
        int GetPreviewExpByDevour()
        {
            int sumExp = 0;
            for (int i = 0; i < realDevourlist.Count; i++)
            for (int i = 0; i < playerPack.selectDevourlist.Count; i++)
            {
                int curExp = 0;
                ItemModel itemModel = realDevourlist[i];
                ItemModel itemModel = playerPack.selectDevourlist[i];
                if (itemModel.config.EquipPlace == 0)
                {
                    curExp = itemModel.count * itemModel.config.EffectValueA1;
                }
                else
                {
                    PetEatEquipConfig tagPet = PetEatEquipConfig.GetEquipColorAndEquipClass(itemModel.config.ItemColor, itemModel.config.LV);
                    var tagPet = PetEatEquipConfig.GetEquipColorAndEquipClass(itemModel.config.ItemColor, itemModel.config.LV);
                    if (tagPet != null)
                    {
                        curExp = tagPet.Exp;
@@ -556,45 +453,5 @@
            return sumExp;
        }
        public void SendEquipdevourQuest()
        {
            if (!ItemLogicUtility.Instance.isPackResetOk || SettingEffectMgr.Instance.isStartDecompose) return;
            playerPack.isAutoDecompose = false;
            SettingEffectMgr.Instance.isStartDecompose = true;
            CA32C_tagCMEquipDecompose _petEat = new CA32C_tagCMEquipDecompose();
            var _petIndex = new ushort[realDevourlist.Count];
            var idlist = new uint[realDevourlist.Count];
            for (int i = 0; i < realDevourlist.Count; i++)
            {
                _petIndex[i] = (ushort)realDevourlist[i].gridIndex;
                idlist[i] = (uint)realDevourlist[i].itemId;
            }
            _petEat.Count = (byte)_petIndex.Length;
            _petEat.IndexList = _petIndex;
            _petEat.ItemIDList = idlist;
            _petEat.IsAuto = 0;
            GameNetSystem.Instance.SendInfo(_petEat);
        }
        List<ItemModel> realDevourlist = new List<ItemModel>();
        private int GetRealDevourCnt()
        {
            realDevourlist.Clear();
            int devourCnt = 0;
            for (int i = 0; i < sumGridNum; i++)
            {
                if (i < devourModellist.Count)
                {
                    ItemModel itemModel = devourModellist[i];
                    if(playerPack.selectDevourlist.Contains(itemModel))
                    {
                        devourCnt += itemModel.count;
                        realDevourlist.Add(itemModel);
                    }
                }
            }
            return devourCnt;
        }
    }
}
System/KnapSack/Logic/EquipLvSelect.cs
File was deleted
System/KnapSack/Logic/EquipLvSelect.cs.meta
File was deleted
System/KnapSack/Logic/PackModel.cs
@@ -107,8 +107,7 @@
            itemSumUseCntDict.Clear();
            itemGUIDDict.Clear();
            isPlayBetterEquipEffect = false;
            colorType = EquipColorType.None;
            lvType = EquipLvType.All;
            colorType = EquipColorType.Purple;
            decomposeLv = 1;
            decomposeExp = 0;
            decomposeProgress = 0;
@@ -853,9 +852,19 @@
        public Redpoint redpointEquipDecom = new Redpoint(MainRedDot.RedPoint_MainPackKey, EquipDecompose_RedKey);
        public void EquipDecomRedCtrl()
        {
            if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.EquipDecompose)) return;
            if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.EquipDecompose))
            {
                return;
            }
            if (GetCanDevourModellist() != null && GetCanDevourModellist().Count >= minDevourEquipNum)
            if (PlayerDatas.Instance.baseData.LV < devourRedpointLevel)
            {
                redpointEquipDecom.state = RedPointState.None;
                return;
            }
            var canDevourItems = GetCanDevourModellist();
            if (canDevourItems != null && canDevourItems.Count >= minDevourEquipNum)
            {
                redpointEquipDecom.state = RedPointState.Simple;
            }
@@ -1055,74 +1064,31 @@
        #region 物品吞噬逻辑处理
        public EquipColorType colorType { get; private set; }
        public EquipLvType lvType { get; private set; }
        public event Action<EquipColorType> RefreshColorSelectAct;
        public event Action<EquipLvType> RefreshLvSelectAct;
        public event Action<EquipStarType> RefreshStarSelectAct;
        public event Action RefreshEquipDecomNumAct;
        public int[] defaultUnSelectlist { get; private set; }
        public bool ContainPreciousItem(List<ItemModel> itemModels, out int betterEquipCnt, out int preciousCnt)
        public int GetBetterEquipCount(List<ItemModel> itemModels)
        {
            betterEquipCnt = 0;
            preciousCnt = 0;
            if (itemModels == null) return false;
            if (itemModels.IsNullOrEmpty())
            {
                return 0;
            }
            for (int i = 0; i < itemModels.Count; i++)
            {
                if (defaultUnSelectlist.Contains(itemModels[i].itemId))
                {
                    preciousCnt += itemModels[i].count;
                }
                else if (ItemLogicUtility.Instance.IsFightUp(itemModels[i].itemId, itemModels[i].score) == 1)
                {
                    betterEquipCnt += itemModels[i].count;
                }
            var count = 0;
            foreach (var item in itemModels)
            {
                if (ItemLogicUtility.Instance.IsFightUp(item.itemId, item.score) == 1)
                {
                    count += item.count;
                }
            }
            if (betterEquipCnt > 0 || preciousCnt > 0)
            {
                return true;
            }
            return false;
        }
        public bool ContainTwoStarEquip(List<ItemModel> itemModels, out int twoStarEquipCnt)
        {
            twoStarEquipCnt = 0;
            if (itemModels == null) return false;
            for (int i = 0; i < itemModels.Count; i++)
            {
                if (itemModels[i].config.StarLevel >= 2 && itemModels[i].config.ItemColor >= (int)E_ItemColor.Orange)
                {
                    twoStarEquipCnt += itemModels[i].count;
                }
            }
            if (twoStarEquipCnt > 0)
            {
                return true;
            }
            return false;
            return count;
        }
        public void SetColorSelect(EquipColorType type)
        {
            colorType = type;
            if (colorType == EquipColorType.None)
            {
                if (lvType != EquipLvType.None)
                {
                    SetLvSelect(EquipLvType.None);
                }
            }
            else
            {
                if (lvType == EquipLvType.None)
                {
                    SetLvSelect(EquipLvType.All);
                }
            }
            if (RefreshColorSelectAct != null)
            {
@@ -1132,33 +1098,8 @@
            EquipDecomRedCtrl();
        }
        public void SetLvSelect(EquipLvType type)
        {
            lvType = type;
            if (lvType == EquipLvType.None)
            {
                if (colorType != EquipColorType.None)
                {
                    SetColorSelect(EquipColorType.None);
                }
            }
            else
            {
                if (colorType == EquipColorType.None)
                {
                    SetColorSelect(EquipColorType.White);
                }
            }
            if (RefreshLvSelectAct != null)
            {
                RefreshLvSelectAct(type);
            }
            SendEquipDevourRecordQuest();
            EquipDecomRedCtrl();
        }
        public List<int> devourPlacelist { get; private set; }
        public int MaxDevourEquipNum { get; private set; }
        public int devourRedpointLevel { get; private set; }
        public int minDevourEquipNum { get; private set; }
        public void SetDevourEquipPlace()
        {
@@ -1169,7 +1110,7 @@
            {
                devourPlacelist.Add(placeArray[i]);
            }
            MaxDevourEquipNum = int.Parse(funcConfig.Numerical2);
            devourRedpointLevel = int.Parse(funcConfig.Numerical2);
            minDevourEquipNum = int.Parse(funcConfig.Numerical3);
        }
@@ -1227,9 +1168,7 @@
        {
            List<ItemModel> canDevourModellist = new List<ItemModel>();
            SinglePack singlePack = GetSinglePack(PackType.Item);
            if (singlePack == null
                || colorType == EquipColorType.None
                || lvType == EquipLvType.None)
            if (singlePack == null || colorType == EquipColorType.None)
            {
                if (RefreshEquipDecomNumAct != null)
                {
@@ -1275,8 +1214,7 @@
                    if (ItemLogicUtility.Instance.IsFightUp(model.itemId, model.score) != 1)
                    {
                        if (model.config.ItemColor <= (int)colorType
                            && model.config.LV <= (int)lvType)
                        if (model.config.ItemColor <= (int)colorType)
                        {
                            return true;
                        }
@@ -1387,37 +1325,45 @@
            return false;
        }
        public void SendEquipdevourQuest()
        public void SendEquipdevourQuest(bool auto)
        {
            List<ItemModel> itemModels = GetCanDevourModellist();
            if (itemModels == null || itemModels.Count < minDecomposeNum || !ItemLogicUtility.Instance.isPackResetOk || SettingEffectMgr.Instance.isStartDecompose) return;
            List<ItemModel> items = null;
            if (auto)
            {
                items = GetCanDevourModellist();
            }
            else
            {
                items = selectDevourlist;
            }
            if (items == null || items.Count < minDecomposeNum || !ItemLogicUtility.Instance.isPackResetOk || SettingEffectMgr.Instance.isStartDecompose) return;
            SettingEffectMgr.Instance.isStartDecompose = true;
            isAutoDecompose = true;
            recordAutoDecomNum = itemModels.Count;
            CA32C_tagCMEquipDecompose _petEat = new CA32C_tagCMEquipDecompose();
            var _petIndex = new ushort[recordAutoDecomNum];
            recordAutoDecomNum = items.Count;
            var package = new CA32C_tagCMEquipDecompose();
            var indexLists = new ushort[recordAutoDecomNum];
            var idlist = new uint[recordAutoDecomNum];
            for (int i = 0; i < recordAutoDecomNum; i++)
            {
                _petIndex[i] = (ushort)itemModels[i].gridIndex;
                idlist[i] = (uint)itemModels[i].itemId;
                if (itemModels[i].config.StarLevel >= 2
                    || (itemModels[i].config.EquipPlace == 0 && itemModels[i].config.Type != 29))
                indexLists[i] = (ushort)items[i].gridIndex;
                idlist[i] = (uint)items[i].itemId;
                if ((items[i].config.EquipPlace == 0 && items[i].config.Type != 29))
                {
                    return;
                }
            }
            _petEat.Count = (byte)_petIndex.Length;
            _petEat.IndexList = _petIndex;
            _petEat.ItemIDList = idlist;
            _petEat.IsAuto = 1;
            GameNetSystem.Instance.SendInfo(_petEat);
            package.Count = (byte)indexLists.Length;
            package.IndexList = indexLists;
            package.ItemIDList = idlist;
            package.IsAuto = (byte)(auto ? 1 : 0);
            GameNetSystem.Instance.SendInfo(package);
        }
        public void SendEquipDevourRecordQuest()
        {
            var record = StringUtility.Contact((int)colorType + 1, (int)lvType + 1, 1);
            var record = StringUtility.Contact((int)colorType + 1, 1, 1);
            var decomSet = new CA32D_tagCMDecomposeSeting();
            decomSet.Seting = uint.Parse(record);
            GameNetSystem.Instance.SendInfo(decomSet);
@@ -1473,7 +1419,6 @@
                string colorStr = decomSetStr.Substring(0, 1);
                colorType = (EquipColorType)(int.Parse(colorStr) - 1);
                string lvStr = decomSetStr.Substring(1, decomSetStr.Length - 2);
                lvType = (EquipLvType)(int.Parse(lvStr) - 1);
            }
            if (RefreshDecomAttrAct != null)
            {
@@ -1525,7 +1470,6 @@
                                DecomposeGetMatInfo matInfo = new DecomposeGetMatInfo();
                                matInfo.ItemID = getItems[i].ItemID;
                                matInfo.Count = 1;
                                matInfo.IsBind = getItems[i].IsBind;
                                matInfo.IsSuite = getItems[i].IsSuite;
                                matInfo.UserData = getItems[i].UserData;
                                getMatInfos.Add(matInfo);
@@ -1552,41 +1496,10 @@
            All = 10,
        }
        public enum EquipLvType
        {
            None = 0,
            One,
            Two,
            Three,
            Four,
            Five,
            Six,
            Seven,
            Eight,
            Nine,
            Ten,
            Eleven,
            Twelve,
            Thirteen,
            Fourteen,
            Fifteen,
            All,
        }
        public enum EquipStarType
        {
            None = 0,
            One,
            Two,
            Three,
            All,
        }
        public class DecomposeGetMatInfo
        {
            public int ItemID;
            public int Count;
            public int IsBind;
            public int IsSuite;
            public string UserData;
        }
System/SystemSetting/SettingEffectMgr.cs
@@ -203,7 +203,7 @@
            {
                if (playerPack.IsReachMinDecomposeNum())
                {
                    playerPack.SendEquipdevourQuest();
                    playerPack.SendEquipdevourQuest(true);
                    return;
                }
            }