|
@@ -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);
|