少年修仙传客户端代码仓库
client_Wu Xijin
2019-05-21 39ef97b5c0550d00e6d6e20f697df07f7c614301
System/FriendSystem/AddFriendTips.cs
@@ -20,18 +20,15 @@
    private GameObject _searchBG;
    private bool _isRecommend = true;
    public bool IsRecommend
    {
    public bool IsRecommend {
        get { return _isRecommend; }
        set { _isRecommend = value; }
    }
    private string _strSearch = "";
    FriendsModel _friendsModel;
    FriendsModel friendsModel
    {
        get
        {
    FriendsModel friendsModel {
        get {
            return _friendsModel ?? (_friendsModel = ModelCenter.Instance.GetModel<FriendsModel>());
        }
    }
@@ -51,7 +48,7 @@
    {
        _addfriendCtrl = transform.Find("AddFriendCtrl").GetComponent<ScrollerController>();
        _addfriendCtrl.OnRefreshCell += OnRefreshAddFriendCell;
        _addfriendGroup = transform.Find("AddFriendCtrl").GetComponent<ToggleGroup>();
        _titleText = transform.Find("SearchTitle/Text").GetComponent<Text>();
        _refreshBtn = transform.Find("RefreshBtn").GetComponent<Button>();
@@ -62,9 +59,9 @@
        _searchBG = transform.Find("BG").gameObject;
        _searchGo = transform.Find("SearchTitle").gameObject;
        _refreshBtn.onClick.AddListener(()=> { OnClickRefreshBtn(); });
        _lookBtn.onClick.AddListener(()=> { OnClickLookBtn(); });
        _inputPlayerName.onValueChanged.AddListener((string inputStr)=> { OnEndInput(inputStr); });
        _refreshBtn.onClick.AddListener(() => { OnClickRefreshBtn(); });
        _lookBtn.onClick.AddListener(() => { OnClickLookBtn(); });
        _inputPlayerName.onValueChanged.AddListener((string inputStr) => { OnEndInput(inputStr); });
        ChatCtrl.Inst.OnClickCloseChatEvent += CloseFriendlist;
    }
@@ -73,13 +70,13 @@
    {
        FriendListUICtrl(false);
    }
    public void OnInit()
    {
        _addfriendCtrl.vertical = true;
        RefreshRecommendModel();
       friendsModel.RefreshRecommendFriendEvent -= RefreshRecommendModel;
       friendsModel.RefreshRecommendFriendEvent += RefreshRecommendModel;
        friendsModel.RefreshRecommendFriendEvent -= RefreshRecommendModel;
        friendsModel.RefreshRecommendFriendEvent += RefreshRecommendModel;
        TimeDownMgr.CoolTimeData data;
        if (TimeDownMgr.Instance.Get(TimeDownMgr.CoolTimeType.BagSort, out data))
        {
@@ -117,7 +114,7 @@
        }
        else
        {
            _refreshText.text = Language.Get("FriendsPlayer101",time);
            _refreshText.text = Language.Get("FriendsPlayer101", time);
            _refreshBtn.interactable = false;
            _refreshText.color = greyColor;
        }
@@ -150,7 +147,7 @@
    private void OnRefreshAddFriendCell(ScrollerDataType type, CellView cell)
    {
        cell.GetComponent<Toggle>().group = _addfriendGroup;
        FriendPlayer data =friendsModel.GetAddFriendInfo((uint)cell.index);
        FriendPlayer data = friendsModel.GetAddFriendInfo((uint)cell.index);
        Text friendName = cell.transform.Find("PlayerNameText").GetComponent<Text>();
        Text friendLv = cell.transform.Find("Contain_LV/PlayerLv").GetComponent<Text>();
        Image friendLvIcon = cell.transform.Find("Contain_LV/PlayerLvIcon").GetComponent<Image>();
@@ -173,7 +170,7 @@
        RealmConfig realmModel = RealmConfig.Get(data.RealmLV);
        if (data.RealmLV != 0)
        if (data.RealmLV > 0 && RealmConfig.Has(data.RealmLV))
        {
            titleIcon.gameObject.SetActive(true);
            titleIcon.SetSprite(realmModel.Img);
@@ -202,8 +199,8 @@
            stateText.gameObject.SetActive(false);
        }
        Dictionary<uint, FriendPlayer> friendDict =friendsModel.GetFriendInfoDict((byte)GroupType.Friend);
        if(friendDict != null)
        Dictionary<uint, FriendPlayer> friendDict = friendsModel.GetFriendInfoDict((byte)GroupType.Friend);
        if (friendDict != null)
        {
            if (friendDict.ContainsKey(data.PlayerID))
            {
@@ -212,7 +209,7 @@
                //stateText.text = Language.Get("Friend105");
            }
        }
    }
@@ -232,7 +229,7 @@
        {
            ServerTipDetails.DisplayNormalTip(Language.Get("Friend106"));
        }
    }
    private void OnEndInput(string inputStr)
@@ -242,10 +239,10 @@
    public void OnClickRefreshBtn()
    {
       friendsModel.OnSendCA9A3_tagCGQueryRecommendFriends();
        friendsModel.OnSendCA9A3_tagCGQueryRecommendFriends();
        TimeDownMgr.Instance.Begin(TimeDownMgr.CoolTimeType.BagSort, 5.0f, RefreshTime);
        _refreshImage.SetSprite("BlackBtn");
        _refreshText.text = Language.Get("FriendsPlayer101",5);
        _refreshText.text = Language.Get("FriendsPlayer101", 5);
        _refreshBtn.interactable = false;
        _refreshText.color = greyColor;
    }