zhaoyang 3 лет назад
Родитель
Сommit
42eebe87ca

+ 5 - 5
GameClient/Assets/Game/HotUpdate/Controller/LogController.cs

@@ -22,10 +22,10 @@ namespace GFGGame
             msgDic.Add(_all, new List<string>());
             msgDic.Add(_error, new List<string>());
             msgDic.Add(_log, new List<string>());
-            if (LauncherConfig.onDebug == 1)
-            {
-                this.CreatBtnLog();
-            }
+            // if (LauncherConfig.onDebug == 1)
+            // {
+            this.CreatBtnLog();
+            // }
 
             this.AddMsgListener();
         }
@@ -64,7 +64,7 @@ namespace GFGGame
                     msgDic[_all].Add(msg);
                     msgDic[_error].Add(msg);
 
-                    if(_btnLog != null)
+                    if (_btnLog != null)
                     {
                         _btnLog.m_c1.selectedIndex = 1;
                         _btnLog.target.alpha = 1;

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

@@ -89,11 +89,11 @@ namespace GFGGame
                 long count = b.roleInfo.offlineTimeSec - a.roleInfo.offlineTimeSec;
                 if (count > 0)
                 {
-                    return 1;
+                    return -1;
                 }
                 else
                 {
-                    return -1;
+                    return 1;
                 }
             });
         }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/FriendSProxy.cs

@@ -81,6 +81,7 @@ namespace ET
             }
             EventAgent.DispatchEvent(ConstMessage.FRIEND_ADD);
             EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
+            ET.Log.Debug("好友添加推送");
 
             await ETTask.CompletedTask;
         }
@@ -93,7 +94,7 @@ namespace ET
         {
             FriendDataManager.Instance.RemoveFriend(message.RoleId);
             EventAgent.DispatchEvent(ConstMessage.FRIEND_REMOVE);
-
+            ET.Log.Debug("好友删除推送");
             await ETTask.CompletedTask;
         }
     }

+ 13 - 5
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -109,6 +109,7 @@ namespace GFGGame
 
         private void RefreshView()
         {
+            ET.Log.Debug("好友刷新");
             _ui.m_list.RefreshVirtualList();
             _ui.m_txtCount.text = string.Format("好友数:{0}/{1}", _ui.m_list.numItems, GlobalCfgArray.globalCfg.maxFriendCount);
             _ui.m_btnSendAll.text = RedDotDataManager.Instance.GetFriendGiftRed() ? "一键领取并赠送" : "一键赠送";
@@ -191,6 +192,8 @@ namespace GFGGame
 
         private void RefreshRemoveFriend()
         {
+            ET.Log.Debug("好友删除");
+
             int index = _ui.m_list.selectedIndex;
             _ui.m_list.numItems = FriendDataManager.Instance.FriendDatas.Count;
             if (FriendDataManager.Instance.FriendDatas.Count > 0)
@@ -212,11 +215,16 @@ namespace GFGGame
 
         private void RefreshAddFriend()
         {
-            if (_ui.m_list.numItems <= 0) return;
-            int childIndex = _ui.m_list.ItemIndexToChildIndex(_ui.m_list.selectedIndex);
-            GButton item = _ui.m_list.GetChildAt(childIndex).asButton.GetChild("btnSend").asButton;
-            FriendInfoData friendInfo = item.data as FriendInfoData;
-            int selectedIndex = FriendDataManager.Instance.FriendDatas.IndexOf(friendInfo);
+            ET.Log.Debug("好友添加");
+
+            int selectedIndex = 0;
+            if (_ui.m_list.numItems > 0)
+            {
+                int childIndex = _ui.m_list.ItemIndexToChildIndex(_ui.m_list.selectedIndex);
+                GButton item = _ui.m_list.GetChildAt(childIndex).asButton.GetChild("btnSend").asButton;
+                FriendInfoData friendInfo = item.data as FriendInfoData;
+                selectedIndex = FriendDataManager.Instance.FriendDatas.IndexOf(friendInfo);
+            }
             _ui.m_list.numItems = FriendDataManager.Instance.FriendDatas.Count;
             _ui.m_list.selectedIndex = selectedIndex;
             ReqFriendDetialInfo(selectedIndex);