예제 #1
0
        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;
        }
예제 #2
0
        public void Refresh(PlayerFriendMsg info_)
        {
            m_player_id = info_.PlayerId;
            System.DateTime dataTime = CommonTools.TimeStampToDateTime(info_.StatusTime * 10000);
            m_time_text.Text = string.Format("{0}", dataTime.ToString("yyyy.MM.dd"));

            m_info_text.Text = string.Format(LocalizeModule.Instance.GetString("friend_invite_ok", info_.Name));
        }
예제 #3
0
        public void Refresh(PlayerFriendMsg info_)
        {
            m_player_id      = info_.PlayerId;
            m_name_text.Text = info_.Name;

            FriendDataManager.Instance.SetHeadIcon(m_head_tex, info_.Icon, info_.PlayerId);
            m_gender_icon.Sprite = CommonTools.GetGenderIcon(info_.Gender);
            m_lvl_text.Text      = string.Format("LV{0}", info_.Level);
        }
예제 #4
0
        public void Refresh(PlayerFriendMsg info_)
        {
            m_player_id      = info_.PlayerId;
            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) : "";

            FriendDataManager.Instance.SetHeadIcon(m_head_tex, info_.Icon, info_.PlayerId);


            m_gender_icon.Sprite = CommonTools.GetGenderIcon(info_.Gender);
            m_lvl_text.Text      = string.Format("LV{0}", info_.Level);

            bool enable_gift = FriendDataManager.Instance.Send_gift_left_num <= 0 ? false : info_.Gift;

            m_send_gift_btn.Enable = enable_gift;
            m_send_gift_btn.SetGray(!enable_gift);
        }
예제 #5
0
        public void Refresh(PlayerFriendMsg info_, IEnumerable <AchievementFriendMsg> achievements_)
        {
            ConfTitle my_title = ConfTitle.Get(info_.TitleId);
            string    temp_str = null != my_title?LocalizeModule.Instance.GetString(my_title.name) : "";

            m_rank_text.Text = $"{title_str}: {temp_str}";

            m_name_text.Text = info_.Name;
            m_lvl_text.Text  = LocalizeModule.Instance.GetString("UI_start_1.lvl", info_.Level);

            if (CommonTools.IsNeedDownloadIcon(info_.Icon))
            {
                if (FriendDataManager.Instance.Friend_icons_dict.ContainsKey(info_.PlayerId))
                {
                    FriendIcon f_icon = FriendDataManager.Instance.Friend_icons_dict[info_.PlayerId];
                    if (f_icon.Url != info_.Icon)
                    {
                        m_head_tex.OnLoadFinish = (tex_) => { f_icon.Url = info_.Icon; f_icon.m_tex = tex_; };
                        m_head_tex.TextureName  = info_.Icon;
                    }
                    else
                    {
                        m_head_tex.SetTexture(f_icon.m_tex);
                    }
                }
                else
                {
                    m_head_tex.OnLoadFinish = (tex_) =>
                    {
                        FriendIcon f_icon = new FriendIcon();
                        f_icon.Url   = info_.Icon;
                        f_icon.m_tex = tex_;
                        FriendDataManager.Instance.Friend_icons_dict.Add(info_.PlayerId, f_icon);
                    };
                    m_head_tex.TextureName = info_.Icon;
                }
            }
            else
            {
                m_head_tex.TextureName = CommonData.GetBigPortrait(info_.Icon);
            }

            m_player_id_text.Text = $"{id_str}: {info_.PlayerId.ToString()}";

            List <AchievementFriendMsg> msgs = new List <AchievementFriendMsg>(achievements_);

            m_achievement_grid.Clear();

            if (msgs.Count > 0)
            {
                List <AchievementFriendMsg> filtered_msgs = msgs.FindAll((item) =>
                {
                    return((item.SubmitStatus & (1 << 1)) > 0 || (item.SubmitStatus & (1 << 2)) > 0 || (item.SubmitStatus & (1 << 3)) > 0);
                });

                if (filtered_msgs.Count > 4)
                {
                    filtered_msgs = filtered_msgs.GetRange(0, 4);
                }

                if (filtered_msgs.Count > 0)
                {
                    m_achievement_grid.EnsureSize <PlayerAchievementComponent>(filtered_msgs.Count);

                    for (int i = 0; i < m_achievement_grid.ChildCount; ++i)
                    {
                        ConfAchievement            confAchieve = ConfAchievement.Get(filtered_msgs[i].Id);
                        PlayerAchievementComponent item        = m_achievement_grid.GetChild <PlayerAchievementComponent>(i);

                        if (confAchieve != null)
                        {
                            string reward_icon = string.Empty;
                            long   finish_time = 0L;
                            if ((filtered_msgs[i].SubmitStatus & (1 << 3)) > 0)
                            {
                                reward_icon = confAchieve.rewardicon3;
                                finish_time = filtered_msgs[i].FinishTime;
                            }
                            else if ((filtered_msgs[i].SubmitStatus & (1 << 2)) > 0)
                            {
                                reward_icon = confAchieve.rewardicon2;
                                finish_time = filtered_msgs[i].FinishTime2;
                            }
                            else if ((filtered_msgs[i].SubmitStatus & (1 << 1)) > 0)
                            {
                                reward_icon = confAchieve.rewardicon1;
                                finish_time = filtered_msgs[i].FinishTime1;
                            }

                            item.SetData(reward_icon, confAchieve.name, finish_time);
                        }

                        item.Visible = true;
                    }
                }
            }
        }
예제 #6
0
        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
        }