public void Refresh(FriendGift g_info_) { m_gift_id = g_info_.GiftId; PlayerFriendMsg info_ = g_info_.PlayerFriends; m_name_text.Text = info_.Name; ConfTitle my_title = ConfTitle.Get(info_.TitleId); m_title_text.Text = null != my_title?LocalizeModule.Instance.GetString(my_title.name) : ""; if (info_.Icon.Contains("http://")) { m_head_icon.Visible = false; m_head_tex.Visible = true; m_head_tex.TextureName = info_.Icon; } else { m_head_icon.Visible = true; m_head_tex.Visible = false; m_head_icon.Sprite = info_.Icon; } //m_gender_icon.Sprite = CommonTools.GetGenderIcon(info_.Gender); m_lvl_text.Text = string.Format("LV{0}", info_.Level); m_receive_gift_btn.Enable = FriendDataManager.Instance.Receive_gift_left_num > 0; m_receive_gift_btn.SetGray(!(FriendDataManager.Instance.Receive_gift_left_num > 0)); m_receive_gift_btn.Visible = true; m_received_gift_btn.Visible = false; }
protected override void OnInit() { base.OnInit(); //m_add_friend_view = this.Make<AddFriendUI>("Panel_search"); m_friend_detail_view = this.Make <FriendDetailUI>("Panel_detail"); m_friend_list_view = this.Make <FriendListUI>("Panel_animation:Panel_down"); this.m_tweenPos = this.m_friend_list_view.GetComponent <TweenScale>(); //m_gift_list_view = this.Make<GiftListUI>("Panel_gift"); m_recommend_view = this.Make <RecommendUI>("Panel_recommend"); this.SetCloseBtnID("Button_close"); #if TEST List <PlayerFriendMsg> t_list = new List <PlayerFriendMsg>(); PlayerFriendMsg t_msg = new PlayerFriendMsg(); t_msg.PlayerId = 50000L; t_msg.Name = t_msg.PlayerId.ToString(); t_msg.Level = (int)t_msg.PlayerId; t_msg.Gender = 1; t_msg.Icon = "http://www.betasoft.cn/Public/HOME/images/to_job.jpg"; t_msg.TitleId = 1; t_msg.Gift = true; t_msg.StatusTime = 0; t_list.Add(t_msg); t_msg = new PlayerFriendMsg(); t_msg.PlayerId = 50001L; t_msg.Name = t_msg.PlayerId.ToString(); t_msg.Level = (int)t_msg.PlayerId; t_msg.Gender = 1; t_msg.Icon = "image_player_size3_1.png"; t_msg.TitleId = 2; t_msg.Gift = false; t_msg.StatusTime = 0; t_list.Add(t_msg); t_msg = new PlayerFriendMsg(); t_msg.PlayerId = 50002L; t_msg.Name = t_msg.PlayerId.ToString(); t_msg.Level = (int)t_msg.PlayerId; t_msg.Gender = 2; t_msg.Icon = "image_player_size3_1.png"; t_msg.TitleId = 3; t_msg.Gift = false; t_msg.StatusTime = 0; t_list.Add(t_msg); FriendDataManager.Instance.SetDatas(t_list, FriendReqType.Added); FriendDataManager.Instance.SetDatas(t_list, FriendReqType.Agreeing); FriendDataManager.Instance.SetDatas(t_list, FriendReqType.Addinfo); List <FriendGift> gift_list = new List <FriendGift>(); FriendGift gift_msg = new FriendGift(); gift_msg.GiftId = 1001L; PlayerFriendMsg p_msg = new PlayerFriendMsg(); p_msg.PlayerId = 50000L; p_msg.Name = p_msg.PlayerId.ToString(); p_msg.Level = (int)p_msg.PlayerId; p_msg.Gender = 1; p_msg.Icon = "image_player_size3_1.png"; p_msg.TitleId = 1; p_msg.Gift = true; p_msg.StatusTime = 0; gift_msg.PlayerFriends = p_msg; gift_list.Add(gift_msg); gift_msg = new FriendGift(); gift_msg.GiftId = 1002L; gift_msg.PlayerFriends = p_msg; gift_list.Add(gift_msg); FriendDataManager.Instance.SetGifts(gift_list); #endif }