public void SetInitData(PersuadeData persuadeData, int total, PresuadeChooseComponent chooseCom, Dictionary <int, PresuadeRecordData> serialIndexDic)
        {
            this.m_persuadeData   = persuadeData;
            this.m_chooseCom      = chooseCom;
            this.m_serialIndexDic = serialIndexDic;
            string npcIcon      = ConfNpc.Get(persuadeData.npcId).icon;
            string npcIconSpine = CommonData.GetSpineHead(npcIcon);

            npcIcon = string.IsNullOrEmpty(npcIconSpine) ? CommonData.GetBigPortrait(npcIcon) : npcIconSpine;

            string selfIcon      = "juzhang_laonianren_01_SkeletonData.asset";//GlobalInfo.MY_PLAYER_INFO.PlayerIcon;
            string selfIconSpine = CommonData.GetSpineHead(npcIcon);

            selfIcon = string.IsNullOrEmpty(selfIconSpine) ? CommonData.GetBigPortrait(selfIcon) : selfIconSpine;

            this.m_currentNpcIcon  = GetCurrentIcon(this.m_npcSpine, this.m_npcTex, npcIcon);
            this.m_currentSelfIcon = GetCurrentIcon(this.m_selfSpine, this.m_selfTex, selfIcon);

            this.m_npcTween = this.m_currentNpcIcon.GetComponent <TweenPosition>();
            this.m_serialIconGrid.EnsureSize <SerialToggle>(total);
            for (int i = 0; i < total; i++)
            {
                SerialToggle t = this.m_serialIconGrid.GetChild <SerialToggle>(i);
                t.SetIndex(i);
                t.Visible = true;
            }
        }
        private void PlayTalk(long officer_id_, long phase_id_, int valuation)
        {
            m_desc_root.Visible = true;

            if (0 != officer_id_)
            {
                m_officer_tex.TextureName = ConfOfficer.Get(officer_id_).hollowPortrait;
            }
            else
            {
                m_officer_tex.TextureName = CommonData.GetBigPortrait(GlobalInfo.MY_PLAYER_INFO.PlayerIcon);
            }

            string t_feedback, t_dialogue;

            EventGameUIAssist.GetFeedBackAndDialogue(officer_id_, phase_id_, valuation, out t_feedback, out t_dialogue);
            m_desc_txt.Text = t_dialogue;
        }
예제 #3
0
        public void SetHeadIcon(GameNetworkRawImage head_tex, string icon_url_, long player_id_)
        {
            if (CommonTools.IsNeedDownloadIcon(icon_url_))
            {
                head_tex.Visible = true;

                if (FriendDataManager.Instance.Friend_icons_dict.ContainsKey(player_id_))
                {
                    FriendIcon f_icon = FriendDataManager.Instance.Friend_icons_dict[player_id_];
                    if (f_icon.Url != icon_url_)
                    {
                        head_tex.OnLoadFinish = (tex_) => { f_icon.Url = icon_url_; f_icon.m_tex = tex_; };
                        head_tex.TextureName  = icon_url_;
                    }
                    else
                    {
                        head_tex.SetTexture(f_icon.m_tex);
                    }
                }
                else
                {
                    head_tex.OnLoadFinish = (tex_) =>
                    {
                        FriendIcon f_icon = new FriendIcon();
                        f_icon.Url   = icon_url_;
                        f_icon.m_tex = tex_;
                        FriendDataManager.Instance.Friend_icons_dict.Add(player_id_, f_icon);
                    };
                    head_tex.TextureName = icon_url_;
                }
            }
            else
            {
                head_tex.Visible     = true;
                head_tex.TextureName = CommonData.GetBigPortrait(icon_url_);
            }
        }
예제 #4
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;
                    }
                }
            }
        }