Beispiel #1
0
    private void AddFriendTag(FriendRow info, UserInfoRow user)
    {
        FriendTag tag = GetFriendTag(info);

        tag.UserName.text = user.NameInGame;
        tag.Describe.text = "Waiting " + info.AcceptTimeString();

        tag.RemoveButton.OnClickEvents += delegate
        {
            OnRejectButton(info);
            ReleaseTag(tag);
        };

        if (!info.RequestBool)
        {
            //tag.Add_AcceptButon.gameObject.SetActive(true);
            tag.Add_AcceptButon.OnClickEvents += delegate
            {
                OnAcceptButton(info);
                ReleaseTag(tag);
            };
        }
        tag.gameObject.SetActive(true);
    }
Beispiel #2
0
    private void CreateFriendTag(FriendRow friendInfo, UserInfoRow userInfo, bool isExisted)
    {
        FriendTag tag = GetFriendTag(friendInfo);

        tag.UserName.text = userInfo.NameInGame;

        if (isExisted)
        {
            bool alreadyFriend = IsAlreadyFriend(friendInfo);
            bool waitingAccept = IsWaitingAccept(friendInfo);
            bool waitingRemove = IsWaitingUnFriend(friendInfo);

            tag.UserName.text = userInfo.NameInGame;


            if (alreadyFriend)
            {
                tag.RemoveButton.OnClickEvents += delegate
                {
                    OnUnfriendButton(friendInfo);
                    ReleaseTag(tag);
                };
            }
            else if (waitingAccept)
            {
                tag.RemoveButton.OnClickEvents += delegate
                {
                    OnRejectButton(friendInfo);
                    ReleaseTag(tag);
                };
                tag.Add_AcceptButon.OnClickEvents += delegate
                {
                    OnAcceptButton(friendInfo);
                    ReleaseTag(tag);
                };
            }
            //else if(waitingRemove)
            //{
            //    tag.RemoveButton.gameObject.SetActive(false);
            //    tag.Add_AcceptButon.gameObject.SetActive(false);
            //}

            string acceptTime = friendInfo.AcceptTime != 0.0f ? "Waiting " + friendInfo.AcceptTimeString() : null;
            string removeTime = friendInfo.RemoveTime != 0.0f ? "Removing " + friendInfo.RemoveTimeString() : null;

            tag.Describe.text = acceptTime + removeTime;
        }
        else
        {
            // doesn't friend
            tag.RemoveButton.gameObject.SetActive(false);
            tag.Add_AcceptButon.gameObject.SetActive(true);

            tag.Add_AcceptButon.OnClickEvents += delegate
            {
                OnAddFriendButton(friendInfo);
                ReleaseTag(tag);
            };
        }
        tag.gameObject.SetActive(true);
    }
Beispiel #3
0
 protected void ReleaseTag(FriendTag tag)
 {
     TagsPooling.Release(tag);
     tag.gameObject.SetActive(false);
 }
Beispiel #4
0
    public void GenerateProximityTagsLister()
    {
        List <FriendTag> FriendTagList = FriendTag.GetProximityTags(member.MemberID);


        List <FriendTag> FriendTagListMini = new List <FriendTag>();

        try
        {
            for (int i = 0; i < 10; i++)
            {
                if (i <= FriendTagList.Count)
                {
                    FriendTagListMini.Add(FriendTagList[i]);
                }
            }
        }
        catch { }

        FriendTagListMini.Reverse();

        FriendTagList = FriendTagListMini;


        NumberOfProximityTags = FriendTagList.Count;

        StringBuilder sbHTMLList = new StringBuilder();

        if (FriendTagList.Count == 0)
        {
            sbHTMLList.Append("<div>No Friend request</div>");
        }
        else
        {
            sbHTMLList.Append("<ul class='friends_list'>");
        }

        for (int i = 0; i < 10; i++)
        {
            if (FriendTagList.Count <= i)
            {
                break;
            }

            // add the member to the js array
            AddJSMemberArray(FriendTagList[i].WebMemberID, FriendTagList[i].FirstName + " " + FriendTagList[i].LastName);


            StringBuilder sbHTMLItem = new StringBuilder();

            object[] parameters = new object[9];

            parameters[0] = FriendTagList[i].WebMemberID;
            parameters[1] = "http://www.next2friends.com/user/" + FriendTagList[i].ProfilePhotoURL;
            parameters[2] = FriendTagList[i].NickName;
            parameters[3] = FriendTagList[i].FirstName;
            parameters[4] = FriendTagList[i].LastName;
            parameters[5] = FriendTagList[i].CountryName;
            parameters[7] = TimeDistance.TimeAgo(FriendTagList[i].TaggedDT);


            string HTMLItem = @"<li>
							<a onclick='dmp(""{0}"");return false;'>

								<img src='{1}' alt='{3} {4}' height='45' width='45'>
							</a>
							<p>
								<a onclick='dmp(""{0}"");return false;'>{3} {4}</a><br />
								{7}
							</p>
						</li>"                        ;

            sbHTMLItem.AppendFormat(HTMLItem, parameters);
            sbHTMLList.Append(sbHTMLItem.ToString());
        }

        if (FriendTagList.Count > 0)
        {
            sbHTMLList.Append("</ul>");
        }

        ProximityTagsLister = sbHTMLList.ToString();
    }