Example #1
0
    bool OnIsMessageSelectable(Chat.Message message)
    {
        // filter out friends
        FriendList.FriendInfo friend = GameCloudManager.friendList.friends.Find(obj => obj.PrimaryKey == message.PrimaryKey);
        if (friend != null)
        {
            return(false);
        }

        // filter out pending friends
        FriendList.PendingFriendInfo pending = GameCloudManager.friendList.pendingFriends.Find(obj => obj.PrimaryKey == message.PrimaryKey);
        if (pending != null)
        {
            return(false);
        }

        // done
        return(true);
    }
Example #2
0
        public void Update(PendingFriendInfo inFriend)
        {
            m_FriendInfo = inFriend;

            // update GUI...

            {
                m_FacebookIcon.Show(false, false);
                m_FacebookName.Widget.Show(false, false);
                m_Username.Widget.Show(true, false);

                string username = string.IsNullOrEmpty(m_FriendInfo.Username_New) ? m_FriendInfo.PrimaryKey : m_FriendInfo.Username_New;
                string nickname = string.IsNullOrEmpty(m_FriendInfo.Nickname) ? username : m_FriendInfo.Nickname;

                m_Username.SetNewText(GuiBaseUtils.FixNameForGui(nickname));
            }

            string added = GetLastOnlineInfo(m_FriendInfo);

            m_Added.SetNewText(added);

            bool beMyFriendRequest = m_FriendInfo.IsItRequest;

            string message = string.IsNullOrEmpty(m_FriendInfo.Message) ? TextDatabase.instance[FS_REQUEST] : m_FriendInfo.Message;
            string status  = beMyFriendRequest ? message : TextDatabase.instance[FS_PENDING];

            if (status.Length > MESSAGE_MAX_LENGTH)
            {
                status = status.Substring(0, MESSAGE_MAX_LENGTH - 3) + "...";
            }

            m_Status.SetNewText(status);
            m_Accept.Widget.Show((beMyFriendRequest ? true : false), true);
            m_Reject.Widget.Show((beMyFriendRequest ? true : false), true);
            m_Remove.Widget.Show((beMyFriendRequest ? false : true), true);

            //Debug.Log("show PPI " + inPPI.Name + " " + inPPI.Score.Score.ToString());
        }
Example #3
0
        string GetLastOnlineInfo(PendingFriendInfo inFriend)
        {
            double addedDate = inFriend.AddedDate;

            return(addedDate <= 0 ? TextDatabase.instance[LOI_UNKNOWN] : GuiBaseUtils.EpochToString(addedDate));
        }