zhaoyang 3 years ago
parent
commit
6ef1fa7d46

+ 2 - 6
GameClient/Assets/Game/HotUpdate/Data/FriendDataManager.cs

@@ -52,7 +52,6 @@ namespace GFGGame
             if (_friendDic.ContainsKey(roleInfo.roleId))
             {
                 _friendDic[roleInfo.roleId].roleInfo = roleInfo;
-                UpdateFriendList(false);
             }
         }
         public void ChangeGiveGiftStates(long roleId, int state)
@@ -60,7 +59,6 @@ namespace GFGGame
             if (_friendDic.ContainsKey(roleId))
             {
                 _friendDic[roleId].giveGiftState = state;
-                UpdateFriendList(false);
             }
         }
         public void ChangeTakeGiftStates(long roleId, int state)
@@ -68,7 +66,6 @@ namespace GFGGame
             if (_friendDic.ContainsKey(roleId))
             {
                 _friendDic[roleId].takeGiftState = state;
-                UpdateFriendList(false);
             }
         }
         public void ChangeGiveTakeGiftStates(long roleId, int state, int takeState)
@@ -77,10 +74,9 @@ namespace GFGGame
             {
                 _friendDic[roleId].giveGiftState = state;
                 _friendDic[roleId].takeGiftState = takeState;
-                UpdateFriendList(false);
             }
         }
-        private void UpdateFriendList(bool sort)
+        public void UpdateFriendList(bool sort)
         {
             _list = _friendDic.Values.ToList<FriendInfoData>();
             if (!sort) return;
@@ -172,7 +168,7 @@ namespace GFGGame
             {
                 return 1;
             }
-            if (friendInfo.giveGiftState == (int)ConstGiveGiftStatus.Gave)
+            if (friendInfo.giveGiftState == (int)ConstGiveGiftStatus.Gave && friendInfo.takeGiftState != ConstBonusStatus.GOT)
             {
                 return 2;
             }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -114,6 +114,7 @@ namespace GFGGame
         /// <returns></returns>
         public bool GetFriendGiftRed()
         {
+            ET.Log.Debug("zoya:count:" + FriendDataManager.Instance.Count);
             if (FriendDataManager.Instance.Count >= GlobalCfgArray.globalCfg.maxGetPowerCount) return false;
 
             List<FriendInfoData> friendInfos = FriendDataManager.Instance.FriendDatas;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/FriendSProxy.cs

@@ -145,6 +145,8 @@ namespace GFGGame
                             FriendDataManager.Instance.AddApplyData(friendInfo);
                         }
                     }
+                    EventAgent.DispatchEvent(ConstMessage.FRIEND_ADD);
+
                     return true;
                 }
             }
@@ -237,6 +239,7 @@ namespace GFGGame
                         PromptController.Instance.ShowFloatTextPrompt(string.Format("已领取{0}体力", response.FriendIds.Count * GlobalCfgArray.globalCfg.onceGivePowerCount));
                     }
                     EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
+                    EventAgent.DispatchEvent(ConstMessage.FRIEND_REFRESH);
                     return true;
                 }
             }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -71,6 +71,7 @@ namespace GFGGame
                 EquipDataCache.cacher.setSceneObj(_sceneObject);
             }
             _ui.m_grpSlogan.visible = false;
+            FriendDataManager.Instance.UpdateFriendList(true);
             _ui.m_list.numItems = FriendDataManager.Instance.FriendDatas.Count;
 
             if (_ui.m_list.numItems > 0)