From 4efedb5a54922452a3d90e7074d78d19b2f5f2ce Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 24 一月 2019 19:34:20 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/FriendSystem/MailPanel.cs |  126 +++++++++++++++++++++++++++--------------
 1 files changed, 83 insertions(+), 43 deletions(-)

diff --git a/System/FriendSystem/MailPanel.cs b/System/FriendSystem/MailPanel.cs
index 340dc11..bd27369 100644
--- a/System/FriendSystem/MailPanel.cs
+++ b/System/FriendSystem/MailPanel.cs
@@ -623,69 +623,109 @@
         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;
+            int remainCount = playerPack.GetReaminGridCount(key);
+            int getCount = GetPackItemDcit[key];
+            if(remainCount < getCount)
+            {
+                SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_676165",key);
+                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;
-        }
+        //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;

--
Gitblit v1.8.0