Example #1
0
        private void MoveStopped(int select_index_)
        {
            m_police_name.Text      = LocalizeModule.Instance.GetString(ConfOfficer.Get(m_officers[select_index_].OfficerId).name);
            m_skill_label.Text      = LocalizeModule.Instance.GetString(ConfOfficer.Get(m_officers[select_index_].OfficerId).descs);
            m_police_name.Visible   = true;
            m_skill_icon.Visible    = true;
            m_skill_label.Visible   = true;
            this.m_send_btn.Visible = true;

            //Debug.Log("========================" + select_index_);
            string icon, desc;

            if (SkillUtil.GetCurLevelSkillIconAndDesc(m_officers[select_index_].OfficerId, m_officers[select_index_].Level, out icon, out desc))
            {
                m_skill_icon.Sprite = icon;
                m_skill_label.Text  = desc;
            }

            if (m_selected_IDs.Contains(m_officers[select_index_].OfficerId))
            {
                this.m_send_btn.SetGray(true);
                this.m_send_btn.Enable = false;
            }
            else
            {
                GameEvents.UI_Guid_Event.OnSelectPolice.SafeInvoke(select_index_);
                this.m_send_btn.SetGray(false);
                this.m_send_btn.Enable = true;
            }

            RefreshNum(select_index_ + 1);
        }
Example #2
0
        public void Refresh(ConfOfficer ori_info_, OfficerInfo server_info_)
        {
            this.m_portrait_icon.Sprite = ori_info_.icon;

            long officer_id = null == server_info_ ? ori_info_.id : server_info_.OfficerId;;
            int  lvl        = null == server_info_ ? 0 : server_info_.Level;
            int  outsight   = null == server_info_ ? ori_info_.outsight : server_info_.Outsight;
            int  memory     = null == server_info_ ? ori_info_.memory : server_info_.Memory;
            int  attention  = null == server_info_ ? ori_info_.attention : server_info_.Attention;
            int  willpower  = null == server_info_ ? ori_info_.willpower : server_info_.WillPower;


            m_name_title.Text    = LocalizeModule.Instance.GetString(ori_info_.name);
            m_quality_label.Text = PoliceUILogicAssist.GetQualityString(ori_info_.quality);
            m_lvl_icon.Sprite    = PoliceUILogicAssist.GetPoliceRankIcon(lvl);

            string icon_name, desc;

            if (SkillUtil.GetCurLevelSkillIconAndDesc(officer_id, lvl, out icon_name, out desc))
            {
                if (lvl == 0)
                {
                    this.m_skillLevelLab.Text = "1";
                }
                else
                {
                    this.m_skillLevelLab.Text = lvl.ToString();
                }
                m_skill_icon.Sprite = icon_name;
                m_skill_desc.Text   = desc;
            }

            m_ability_icon.SetPropList(new List <float> {
                outsight, memory, attention, willpower
            });

            m_observe_num.Text   = outsight.ToString();
            m_memory_num.Text    = memory.ToString();
            m_attention_num.Text = attention.ToString();
            m_willpower_num.Text = willpower.ToString();

            List <string> key_words      = PoliceUILogicAssist.GetKeyWords(ori_info_);
            List <string> key_words_icon = PoliceUILogicAssist.GetKeyWordsIcon(ori_info_);

            foreach (var key in m_key_roots)
            {
                key.Visible = false;
            }

            for (int i = 0; i < key_words.Count && i < m_key_labels.Count; ++i)
            {
                m_key_roots[i].Visible = true;
                m_key_labels[i].Text   = key_words[i];
                m_key_icons[i].Sprite  = key_words_icon[i];
            }
        }
        public void Refresh(OfficerInfo info, Action <long> OnSelected_, ENUM_SEARCH_MODE mode_)
        {
            m_info        = info;
            m_on_selected = OnSelected_;

            ConfOfficer officer_data = ConfOfficer.Get(info.OfficerId);

            m_tex.TextureName = officer_data.portrait;
            m_name_txt.Text   = LocalizeModule.Instance.GetString(officer_data.name);
            m_name_txt.color  = PoliceUILogicAssist.GetPoliceQualityColor(officer_data.quality);


            if (ENUM_SEARCH_MODE.E_SEARCH_ROOM == mode_)
            {
                m_skill_root.Visible   = true;
                m_keyword_root.Visible = false;

                m_lvl_icon.Sprite = PoliceUILogicAssist.GetPoliceRankIcon(info.Level);
                string icon, desc;
                if (SkillUtil.GetCurLevelSkillIconAndDesc(info.OfficerId, info.Level, out icon, out desc))
                {
                    m_skill_lvl_txt.Text  = info.Level.ToString();
                    m_skill_icon.Sprite   = icon;
                    m_skill_desc_txt.Text = desc;
                }
            }
            else if (ENUM_SEARCH_MODE.E_EVENTGAME == mode_)
            {
                m_skill_root.Visible   = false;
                m_keyword_root.Visible = true;
                m_lvl_icon.Sprite      = PoliceUILogicAssist.GetPoliceRankIcon(info.Level);
                List <long> keywords_id = EventGameUIAssist.GetPoliceKeyWordByOfficerID(info.OfficerId);
                m_keyword_grid.EnsureSize <EventGameKeywordItemView>(keywords_id.Count);

                for (int i = 0; i < m_keyword_grid.ChildCount; ++i)
                {
                    m_keyword_grid.GetChild <EventGameKeywordItemView>(i).Refresh(i, keywords_id[i]);
                    m_keyword_grid.GetChild <EventGameKeywordItemView>(i).Visible = true;
                }
            }
        }