Exemplo n.º 1
0
 public void Add(FriendData friend)
 {
     MyFriends.Add(friend);
 }
Exemplo n.º 2
0
        public void OnDeleteBtnClick()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");
            System.Action callback = delegate()
            {
                if (mCurrentItem != null && mCurrentItem.ViewIndex > 3)
                {
                    mSelectLast = mCurrentItem.ViewIndex;
                }

                if (TabController.Type == eFriendType.My || TabController.Type == eFriendType.Black)
                {
                    mSelectMyFriendData = null;
                }
                else if (TabController.Type == eFriendType.Recently || TabController.Type == eFriendType.Team)
                {
                    if (CurrentSelectData.IsFriend && mSelectMyFriendData.Uid == CurrentSelectData.Uid)
                    {
                        mSelectMyFriendData = null;
                    }

                    if (TabController.Type == eFriendType.Recently)
                    {
                        mSelectRecentlyFriendData = null;
                    }
                    else if (TabController.Type == eFriendType.Team)
                    {
                        mSelectTeamFriendData = null;
                    }
                }

                FriendManager.Instance.MarkDirty(FriendManager.MyFriendListId);
            };

            if (TabController.Type == eFriendType.My || TabController.Type == eFriendType.Black)
            {
                var ht = Johny.HashtablePool.Claim();
                ht.Add("0", CurrentSelectData.Name);
                MessageTemplateManager.ShowMessage(FriendManager.CodeDeleteFriend, ht, delegate(int result)
                {
                    if (result == 0)
                    {
                        FriendManager.Instance.Delete(CurrentSelectData.Uid, CurrentSelectData.Type, delegate(bool successful)
                        {
                            callback();
                        });
                    }
                });
            }
            else if (TabController.Type == eFriendType.Recently || TabController.Type == eFriendType.Team)
            {
                if (CurrentSelectData.IsFriend)
                {
                    var ht = Johny.HashtablePool.Claim();
                    ht.Add("0", CurrentSelectData.Name);
                    MessageTemplateManager.ShowMessage(FriendManager.CodeDeleteFriend, ht, delegate(int result)
                    {
                        if (result == 0)
                        {
                            FriendManager.Instance.Delete(CurrentSelectData.Uid, CurrentSelectData.Type, delegate(bool successful)
                            {
                                callback();
                            });
                        }
                    });
                }
                else
                {
                    FriendManager.Instance.Remove(CurrentSelectData.Uid, CurrentSelectData.Type, delegate(bool successful)
                    {
                        callback();
                    });
                }
            }
        }
Exemplo n.º 3
0
        public void DoSelectFriendAction()
        {
            if (mTargetUid != 0)
            {
                FriendData friendData = null;
                if (TabController.Type == eFriendType.My)
                {
                    friendData = FriendManager.Instance.MyFriends.Find(mTargetUid);
                }
                else if (TabController.Type == eFriendType.Black)
                {
                    friendData = FriendManager.Instance.BlackLists.Find(mTargetUid);
                }
                else if (TabController.Type == eFriendType.Recently)
                {
                    friendData = FriendManager.Instance.Recentlys.Find(mTargetUid);
                }
                else if (TabController.Type == eFriendType.Team)
                {
                    friendData = FriendManager.Instance.Teams.Find(mTargetUid);
                }

                mTargetUid = 0;
                SetFriendData(friendData);
                return;
            }


            if (TabController.Type == eFriendType.My)
            {
                if (mSelectMyFriendData != null)
                {
                    if (FriendManager.Instance.MyFriends.Find(mSelectMyFriendData.Uid) == null)
                    {
                        mSelectMyFriendData = null;
                    }
                }

                if (FriendManager.Instance.MyFriends.List.Count > 0 && mSelectMyFriendData == null)
                {
                    SetFriendData(FriendManager.Instance.MyFriends.List[mSelectLast > 3 ? mSelectLast - 3 : 0]);
                }
                else if (FriendManager.Instance.MyFriends.List.Count > 0 && mSelectMyFriendData != null)
                {
                    SetFriendData(mSelectMyFriendData);
                }
                else
                {
                    SetFriendData(null);
                }
            }
            else if (TabController.Type == eFriendType.Black)
            {
                if (FriendManager.Instance.BlackLists.List.Count > 0 && mSelectBlacklistData == null)
                {
                    SetFriendData(FriendManager.Instance.BlackLists.List[mSelectLast > 3 ? mSelectLast - 3 : 0]);
                }
                else if (FriendManager.Instance.BlackLists.List.Count > 0 && mSelectBlacklistData != null)
                {
                    SetFriendData(mSelectBlacklistData);
                }
                else
                {
                    SetFriendData(null);
                }
            }
            else if (TabController.Type == eFriendType.Recently)
            {
                if (FriendManager.Instance.Info.NewestSendId != 0)
                {
                    MoveToFirst(eFriendType.Recently, FriendManager.Instance.Info.NewestSendId);
                }
                if (FriendManager.Instance.Recentlys.List.Count > 0 && mSelectRecentlyFriendData == null)
                {
                    SetFriendData(FriendManager.Instance.Recentlys.List[0]);
                }
                else if (FriendManager.Instance.Recentlys.List.Count > 0 && mSelectRecentlyFriendData != null)
                {
                    SetFriendData(mSelectRecentlyFriendData);
                }
                else
                {
                    SetFriendData(null);
                }
            }
            else if (TabController.Type == eFriendType.Team)
            {
                if (FriendManager.Instance.Teams.List.Count > 0 && mSelectTeamFriendData == null)
                {
                    SetFriendData(FriendManager.Instance.Teams.List[0]);
                }
                else if (FriendManager.Instance.Teams.List.Count > 0 && mSelectTeamFriendData != null)
                {
                    SetFriendData(mSelectTeamFriendData);
                }
                else
                {
                    SetFriendData(null);
                }
            }
        }
Exemplo n.º 4
0
        private void SetFriendData(FriendData data)
        {
            ShowFriendUI(data);
            if (data != null)
            {
                data.IsSelect = true;
                FriendManager.Instance.Info.RemoveUnreadMessageId(data.Uid);
                if (FriendManager.Instance.Info.UnreadMessageUIds.Count <= 0)
                {
                    controller.GObjects["RecentRedPoint"].CustomSetActive(false);
                    controller.GObjects["FriendRedPoint"].CustomSetActive(false || FriendManager.Instance.MyFriends.canReceiveVigor);
                }

                if (FriendManager.Instance.Info.UnreadMessageUIds.Count > 0)
                {
                    controller.GObjects["RecentRedPoint"].CustomSetActive(true);
                    for (int i = 0; i < FriendManager.Instance.Info.UnreadMessageUIds.Count; i++)
                    {
                        bool isFriend = FriendManager.Instance.MyFriends.Find(FriendManager.Instance.Info.UnreadMessageUIds[i]) != null;
                        controller.GObjects["FriendRedPoint"].CustomSetActive(isFriend || FriendManager.Instance.MyFriends.canReceiveVigor);
                    }
                }
            }

            if (TabController.Type == eFriendType.My)
            {
                if (mSelectMyFriendData != null && mSelectMyFriendData != data)
                {
                    mSelectMyFriendData.IsSelect = false;
                }

                mSelectMyFriendData = data;
                DynamicScroll.SetDataItems(FriendManager.Instance.MyFriends.List, true);
                OnFriendSendAllButtonState();
                if (mSelectLast > 3)
                {
                    DynamicScroll.MoveTo(mSelectLast > 3 ? mSelectLast - 3 : 0, true);
                    mSelectLast = 3;
                }
            }
            else if (TabController.Type == eFriendType.Black)
            {
                if (mSelectBlacklistData != null && mSelectBlacklistData != data)
                {
                    mSelectBlacklistData.IsSelect = false;
                }

                mSelectBlacklistData = data;
                DynamicScroll.SetDataItems(FriendManager.Instance.BlackLists.List, false);
                if (mSelectLast > 3)
                {
                    DynamicScroll.MoveTo(mSelectLast > 3 ? mSelectLast - 3 : 0, false);
                    EB.Debug.LogError("移到第{0}", (mSelectLast - 3));
                    mSelectLast = 3;
                }
            }
            else if (TabController.Type == eFriendType.Recently)
            {
                if (mSelectRecentlyFriendData != null && mSelectRecentlyFriendData != data)
                {
                    mSelectRecentlyFriendData.IsSelect = false;
                }

                mSelectRecentlyFriendData = data;
                DynamicScroll.SetDataItems(FriendManager.Instance.Recentlys.List, false);
            }
            else if (TabController.Type == eFriendType.Team)
            {
                if (mSelectTeamFriendData != null && mSelectTeamFriendData != data)
                {
                    mSelectTeamFriendData.IsSelect = false;
                }

                mSelectTeamFriendData = data;
                DynamicScroll.SetDataItems(FriendManager.Instance.Teams.List, false);
            }
        }
Exemplo n.º 5
0
 private void UpdateLikeState(FriendData data)
 {
 }
Exemplo n.º 6
0
 private void ShowBlacklist(FriendData data)
 {
     controller.Transforms["ChatWindowTrans"].gameObject.CustomSetActive(false);
     controller.Transforms["BlacklistTrans"].gameObject.CustomSetActive(true);
     controller.UiLabels["BlacklistTitleLabel"].text = "[fff348]" + string.Format(EB.Localizer.GetString("ID_PLAYER_ENTER_YOUR_BLACKLIST"), "[ffffff]" + data.Name + "[-]");
 }