|
@@ -85,7 +85,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
for (int i = 0; i < FriendDataManager.Instance.FriendDatas.Count; i++)
|
|
for (int i = 0; i < FriendDataManager.Instance.FriendDatas.Count; i++)
|
|
{
|
|
{
|
|
- if (_friendRoleId == FriendDataManager.Instance.FriendDatas[i].roleInfo.roleId)
|
|
|
|
|
|
+ if (_friendRoleId == FriendDataManager.Instance.FriendDatas[i])
|
|
{
|
|
{
|
|
_ui.m_list.selectedIndex = i;
|
|
_ui.m_list.selectedIndex = i;
|
|
_ui.m_list.ScrollToView(i);
|
|
_ui.m_list.ScrollToView(i);
|
|
@@ -144,7 +144,8 @@ namespace GFGGame
|
|
|
|
|
|
private void RenderListItem(int index, GObject obj)
|
|
private void RenderListItem(int index, GObject obj)
|
|
{
|
|
{
|
|
- FriendInfoData friendInfo = FriendDataManager.Instance.FriendDatas[index];
|
|
|
|
|
|
+ long roleId = FriendDataManager.Instance.FriendDatas[index];
|
|
|
|
+ FriendInfoData friendInfo = FriendDataManager.Instance.GetFriendDataById(roleId);
|
|
|
|
|
|
UI_ListItem item = UI_ListItem.Proxy(obj);
|
|
UI_ListItem item = UI_ListItem.Proxy(obj);
|
|
|
|
|
|
@@ -157,7 +158,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
item.m_btnSend.onClick.Add(OnClickBtnSend);
|
|
item.m_btnSend.onClick.Add(OnClickBtnSend);
|
|
}
|
|
}
|
|
- item.m_btnSend.data = friendInfo;
|
|
|
|
|
|
+ item.m_btnSend.data = roleId;
|
|
item.target.data = index;
|
|
item.target.data = index;
|
|
|
|
|
|
UI_ListItem.ProxyEnd();
|
|
UI_ListItem.ProxyEnd();
|
|
@@ -213,7 +214,7 @@ namespace GFGGame
|
|
AlertUI.Show("是否删除好友?").SetLeftButton(true).SetRightButton(true, "确定", (object data) =>
|
|
AlertUI.Show("是否删除好友?").SetLeftButton(true).SetRightButton(true, "确定", (object data) =>
|
|
{
|
|
{
|
|
int index = _ui.m_list.selectedIndex;
|
|
int index = _ui.m_list.selectedIndex;
|
|
- long roleId = FriendDataManager.Instance.FriendDatas[index].roleInfo.roleId;
|
|
|
|
|
|
+ long roleId = FriendDataManager.Instance.FriendDatas[index];
|
|
FriendSProxy.ReqDeleteFriend(roleId).Coroutine();
|
|
FriendSProxy.ReqDeleteFriend(roleId).Coroutine();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -245,9 +246,10 @@ namespace GFGGame
|
|
if (_ui.m_list.numItems > 0)
|
|
if (_ui.m_list.numItems > 0)
|
|
{
|
|
{
|
|
int childIndex = _ui.m_list.ItemIndexToChildIndex(_ui.m_list.selectedIndex);
|
|
int childIndex = _ui.m_list.ItemIndexToChildIndex(_ui.m_list.selectedIndex);
|
|
|
|
+ if (childIndex < 0) return;
|
|
GButton item = _ui.m_list.GetChildAt(childIndex).asButton.GetChild("btnSend").asButton;
|
|
GButton item = _ui.m_list.GetChildAt(childIndex).asButton.GetChild("btnSend").asButton;
|
|
- FriendInfoData friendInfo = item.data as FriendInfoData;
|
|
|
|
- selectedIndex = FriendDataManager.Instance.FriendDatas.IndexOf(friendInfo);
|
|
|
|
|
|
+ long roleId = (long)item.data;
|
|
|
|
+ selectedIndex = FriendDataManager.Instance.FriendDatas.IndexOf(roleId);
|
|
}
|
|
}
|
|
_ui.m_list.numItems = FriendDataManager.Instance.FriendDatas.Count;
|
|
_ui.m_list.numItems = FriendDataManager.Instance.FriendDatas.Count;
|
|
_ui.m_list.selectedIndex = selectedIndex;
|
|
_ui.m_list.selectedIndex = selectedIndex;
|
|
@@ -260,7 +262,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
if (index >= 0)
|
|
if (index >= 0)
|
|
{
|
|
{
|
|
- _friendRoleId = FriendDataManager.Instance.FriendDatas[index].roleInfo.roleId;
|
|
|
|
|
|
+ _friendRoleId = FriendDataManager.Instance.FriendDatas[index];
|
|
|
|
|
|
OtherRoleInfoDetailData roleInfoDetail = await RoleInfoSProxy.ReqOtherRoleDetailInfo(_friendRoleId);
|
|
OtherRoleInfoDetailData roleInfoDetail = await RoleInfoSProxy.ReqOtherRoleDetailInfo(_friendRoleId);
|
|
if (roleInfoDetail != null)
|
|
if (roleInfoDetail != null)
|