少年修仙传客户端代码仓库
client_Zxw
2019-01-28 f47ea60f59e0b2b8601583351e269151237c6708
System/FriendSystem/MailPanel.cs
@@ -340,7 +340,7 @@
                        itemCell.gameObject.SetActive(true);
                        MailItemModel itemModel = info.Items[giftCount];
                        ItemCellModel cellModel = new ItemCellModel((int)itemModel.ItemID, false, (ulong)itemModel.Count,
                            itemModel.IsBind,"",PackType.rptDeleted, false, ConfigParse.Analysis(itemModel.UserData));
                            itemModel.IsBind, "", PackType.rptDeleted, false, ConfigParse.Analysis(itemModel.UserData));
                        itemCell.Init(cellModel);
                        itemCell.cellBtn.onClick.RemoveAllListeners();
                        itemCell.cellBtn.onClick.AddListener(() =>
@@ -603,10 +603,10 @@
            {
                if (preReceiveIndex != _nextReceiveIndex)
                {
                    if(_chooseMailList != null && _chooseMailList.Count > _nextReceiveIndex)
                    if (_chooseMailList != null && _chooseMailList.Count > _nextReceiveIndex)
                    {
                        ReceiveAllChooseMail(_nextReceiveIndex, _chooseMailList[_nextReceiveIndex]);
                    }
                    }
                }
            }
@@ -623,69 +623,122 @@
        CreateMailCell();
    }
    private Dictionary<PackType, int> GetPackItemDcit = new Dictionary<PackType, int>();
    public void SendAskReceive(string id)
    {
        MailInfo mailInfo = MailAllModel.Instance.GetMailInfo(id);
        if (mailInfo == null) return;
        GetPackItemDcit.Clear();
        int i = 0;
        int getBagItemCount = 0;
        int getRuneCount = 0;
        int getDogzCount = 0;
        int getSoulCount = 0;
        //int getBagItemCount = 0;
        //int getRuneCount = 0;
        //int getDogzCount = 0;
        //int getSoulCount = 0;
        ItemConfig tagChinItem = null;
        //for (i = 0; i < mailInfo.Count; i++)
        //{
        //    tagChinItem = Config.Instance.Get<ItemConfig>((int)mailInfo.Items[i].ItemID);
        //    if (tagChinItem != null)
        //    {
        //        var packType = GeneralDefine.GetPackTypeByItemType(tagChinItem.Type);
        //        if(!GetPackItemDcit.ContainsKey(packType))
        //        {
        //            GetPackItemDcit.Add(packType,1);
        //        }
        //        else
        //        {
        //            GetPackItemDcit[packType]
        //        }
        //        switch(tagChinItem.Type)
        //        {
        //            case RuneModel.RUNE_TYPE:
        //            case  RuneModel.RUNE_CREAMTYPE:
        //                 getRuneCount += 1;
        //                break;
        //            case (int)ItemType.DogzStrengthMat:
        //            case (int)ItemType.DogzEquipType1:
        //            case (int)ItemType.DogzEquipType2:
        //            case (int)ItemType.DogzEquipType3:
        //            case (int)ItemType.DogzEquipType4:
        //            case (int)ItemType.DogzEquipType5:
        //                getDogzCount += 1;
        //                break;
        //            case GatheringSoulModel.GATHERSOUL_CORE_TYPE:
        //            case GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE:
        //            case GatheringSoulModel.GATHERSOUL_SOUL_TYPE:
        //                getSoulCount += 1;
        //                break;
        //            default:
        //                getBagItemCount += 1;
        //                break;
        //        }
        //    }
        //}
        for (i = 0; i < mailInfo.Count; i++)
        {
            tagChinItem = Config.Instance.Get<ItemConfig>((int)mailInfo.Items[i].ItemID);
            if (tagChinItem != null)
            {
                switch(tagChinItem.Type)
                var packType = GeneralDefine.GetPackTypeByItemType(tagChinItem.Type);
                if (!GetPackItemDcit.ContainsKey(packType))
                {
                    case RuneModel.RUNE_TYPE:
                    case  RuneModel.RUNE_CREAMTYPE:
                         getRuneCount += 1;
                        break;
                    case (int)ItemType.DogzStrengthMat:
                    case (int)ItemType.DogzEquipType1:
                    case (int)ItemType.DogzEquipType2:
                    case (int)ItemType.DogzEquipType3:
                    case (int)ItemType.DogzEquipType4:
                    case (int)ItemType.DogzEquipType5:
                        getDogzCount += 1;
                        break;
                    case GatheringSoulModel.GATHERSOUL_CORE_TYPE:
                    case GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE:
                    case GatheringSoulModel.GATHERSOUL_SOUL_TYPE:
                        getSoulCount += 1;
                        break;
                    default:
                        getBagItemCount += 1;
                        break;
                    GetPackItemDcit.Add(packType, 1);
                }
                else
                {
                    GetPackItemDcit[packType] += 1;
                }
            }
        }
        if (getBagItemCount > playerPack.GetReaminGridCount(PackType.rptItem))
        foreach (var key in GetPackItemDcit.Keys)
        {
            SysNotifyMgr.Instance.ShowTip("BagFull");
            return;
        }
        else if (getRuneCount > runeModel.SurplusRunePackCnt)
        {
            int remainCount = 0;
            switch (key)
            {
                case PackType.rptGatherSoul:
                    remainCount = virtualPackModel.GetPackRemainCount(key);
                    break;
                case PackType.rptRunePack:
                    remainCount = runeModel.SurplusRunePackCnt;
                    break;
                default:
                    remainCount = playerPack.GetReaminGridCount(key);
                    break;
            }
            SysNotifyMgr.Instance.ShowTip("RuneBagFull");
            return;
            int getCount = GetPackItemDcit[key];
            if (remainCount < getCount)
            {
                SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_676165", key);
                return;
            }
        }
        else if(getDogzCount > playerPack.GetReaminGridCount(PackType.rptDogzItem))
        {
            SysNotifyMgr.Instance.ShowTip("DogzBagFull");
            return;
        }
        else if(getSoulCount > virtualPackModel.GetPackRemainCount(PackType.rptGatherSoul))
        {
            SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_676165",PackType.rptGatherSoul);
            return;
        }
        //if (getBagItemCount > playerPack.GetReaminGridCount(PackType.rptItem))
        //{
        //    SysNotifyMgr.Instance.ShowTip("BagFull");
        //    return;
        //}
        //else if (getRuneCount > runeModel.SurplusRunePackCnt)
        //{
        //    SysNotifyMgr.Instance.ShowTip("RuneBagFull");
        //    return;
        //}
        //else if(getDogzCount > playerPack.GetReaminGridCount(PackType.rptDogzItem))
        //{
        //    SysNotifyMgr.Instance.ShowTip("DogzBagFull");
        //    return;
        //}
        //else if(getSoulCount > virtualPackModel.GetPackRemainCount(PackType.rptGatherSoul))
        //{
        //    SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_676165",PackType.rptGatherSoul);
        //    return;
        //}
        CA53B_tagCMRequestCompensation askRecive = new CA53B_tagCMRequestCompensation();
        askRecive.GUID = id;