private void OnFriendTabSetActive(bool active, GameObject go, Button btn) { MonoFriendChatInfo component = btn.transform.parent.GetComponent <MonoFriendChatInfo>(); if (active) { FriendBriefDataItem friendData = component.GetFriendData(); if (friendData != null) { Singleton <ChatModule> .Instance.SetFriendMsgRead(friendData.uid); component.SetNewMessageTipShow(false); } } component.RefreshNickName(); }
private void OnFriendScrollChange(Transform trans, int index) { if (this._mode == Mode.Friend) { int targetUid = Singleton <ChatModule> .Instance.GetSortedChatFriendList()[index]; FriendBriefDataItem friendBriefData = Singleton <FriendModule> .Instance.TryGetFriendBriefData(targetUid); trans.Find("FriendBtn/Name").GetComponent <Text>().text = friendBriefData.nickName; MonoFriendChatInfo component = trans.GetComponent <MonoFriendChatInfo>(); bool friendMsgNewState = Singleton <ChatModule> .Instance.GetFriendMsgNewState(friendBriefData.uid); bool flag2 = friendBriefData.uid == this._talkingFriendUid; bool hasNewMessage = friendMsgNewState && !flag2; component.SetupView(friendBriefData, hasNewMessage, new ChangeTalkingFriend(this.OnChangeTalkingFriendClick)); MonoGridScroller scroller = base.view.transform.Find("Dialog/Content/ChatList/ScrollView").GetComponent <MonoGridScroller>(); Button btn = trans.Find("FriendBtn").GetComponent <Button>(); this._friendTabManager.SetTab(friendBriefData.uid.ToString(), btn, scroller.gameObject); } }