示例#1
0
 void OnFriendAction(E_FriendAction action)
 {
     if (m_FriendActionDelegate != null)
     {
         m_FriendActionDelegate(m_FriendName, action);
     }
 }
示例#2
0
 void OnFriendAction(string inFriendName, E_FriendAction inAction)
 {
     if (m_OnFriendActionDelegate != null)
     {
         m_OnFriendActionDelegate(inFriendName, inAction);
     }
 }
示例#3
0
    void OnFriendAction(string primaryKey, E_FriendAction action)
    {
        switch (action)
        {
        case E_FriendAction.Remove:
            int idx = m_Friends.FindIndex(obj => obj.PrimaryKey == primaryKey);
            if (idx >= 0)
            {
                LeaveChat(idx, true);
            }
            break;

        default:
            break;
        }
    }
示例#4
0
    // =========================================================================================================================
    // === internal gui delegates ==============================================================================================
    void Delegate_OnFriendAction(string inFriendName, E_FriendAction inAction)
    {
        switch (inAction)
        {
        case E_FriendAction.Select:
            break;

        case E_FriendAction.ShowStats:
        {
            PlayerPersistantInfo        ppi  = null;
            List <PlayerPersistantInfo> ppis = new List <PlayerPersistantInfo>();
            foreach (var friend in m_Friends)
            {
                PlayerPersistantInfo temp = new PlayerPersistantInfo();
                temp.Name       = friend.Nickname;
                temp.PrimaryKey = friend.PrimaryKey;
                temp.InitPlayerDataFromStr(JsonMapper.ToJson(friend.PPIData));

                ppis.Add(temp);

                if (friend.PrimaryKey == inFriendName)
                {
                    ppi = temp;
                }
            }

            if (ppi != null)
            {
                GuiScreenPlayerStats.UserPPIs = ppis.ToArray();
                GuiScreenPlayerStats.UserPPI  = ppi;
                m_Owner.Owner.ShowScreen("PlayerStats");
            }
        }
        break;

        case E_FriendAction.SendMail:
            m_Owner.Owner.ShowPopup("SendMail", inFriendName, null);
            break;

        case E_FriendAction.Chat:
            if (GuiScreenChatFriends.StartChat(inFriendName) == true)
            {
                m_Owner.Owner.ShowScreen("Chat:1", true);
            }
            break;

        case E_FriendAction.Remove:
        {
            string text = string.Format(TextDatabase.instance[02040235], GuiBaseUtils.FixNameForGui(inFriendName));
            m_Owner.Owner.ShowPopup("ConfirmDialog",
                                    TextDatabase.instance[02040234],
                                    text,
                                    (inPopup, inResult) =>
                {
                    if (inResult == E_PopupResultCode.Ok)
                    {
                        GameCloudManager.friendList.RemoveFriend(inFriendName);
                    }
                });
        }
        break;

        default:
            break;
        }
    }