示例#1
0
        string GetOutputIcon(long combine_id_)
        {
            ConfCombineFormula data = ConfCombineFormula.Get(combine_id_);
            long out_put_id         = data.outputId;

            if (0 == out_put_id)
            {
                return(null);
            }

            switch ((ENUM_COMBINE_TYPE)data.type)
            {
            case ENUM_COMBINE_TYPE.POLICE:
            {
                return(ConfOfficer.Get(ConfProp.Get(out_put_id).officerId).icon);
            }

            case ENUM_COMBINE_TYPE.COLLECTION:
            case ENUM_COMBINE_TYPE.OTHER:
            {
                return(ConfProp.Get(out_put_id).icon);
            }

            default:
                break;
            }

            return(null);
        }
示例#2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfOfficer config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_Officer", fieldName, fieldValue);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        config = null;
                        return(false);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("Officer 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
        public static List <String> GetKeyWords(ConfOfficer info_)
        {
            List <String> ret = new List <string>();

            for (int i = 0; i < info_.features.Length; i++)
            {
                ret.Add(LocalizeModule.Instance.GetString(ConfKeyWords.Get(info_.features[i]).word));
            }

            //string features = info_.features;

            //string[] ids = features.Split(';');

            //foreach (string id in ids)
            //{
            //    if (string.IsNullOrEmpty(id))
            //        continue;

            //    int id_int = int.Parse(id);

            //    ret.Add(LocalizeModule.Instance.GetString(ConfKeyWords.Get(id_int).word));
            //}

            return(ret);
        }
示例#4
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);
        }
示例#5
0
        public void OnEnterLocalSceneByID(int sceneID, IList <long> sceneExhibits, IList <long> taskExhibits, bool needPolice)
        {
            TryCreateGameScene(sceneID);
            int          totalTime = 0;
            IList <long> polices   = new List <long>();

#if OFFICER_SYS
            if (needPolice)
            {
                polices = PoliceDispatchManager.Instance.GetAllDispathOfficersID();
                for (int i = 0; i < polices.Count; i++)
                {
                    ConfOfficer confPolice = ConfOfficer.Get(polices[i]);
                    if (confPolice == null)
                    {
                        continue;
                    }
                    totalTime += confPolice.secondGain;
                }
            }
            else
            {
                totalTime = 18000; //30分钟
            }
#endif
            TimeModule.Instance.SetTimeout(() =>
            {
                OnPrepareScene();
                (this.m_currentScene as GameSceneBase).InitScene(this.m_sceneData, sceneExhibits, taskExhibits, polices, totalTime);
            }, 0.5f);
        }
        private ENUM_SELECT_TYPE RefreshOfficers(List <UIOfficerInfo> officers_, GameLoopUIContainer grid_, ENUM_SELECT_TYPE selected_type_)
        {
            int totalCount = officers_.Count;

            grid_.EnsureSize <ToggleIconItem>(totalCount);

            ENUM_SELECT_TYPE cur_type = selected_type_;

            if (0 == totalCount)
            {
                grid_.Visible = false;
                return(cur_type);
            }
            grid_.Visible = true;


            for (int i = 0; i < totalCount; i++)
            {
                ConfOfficer    prop        = officers_[i].m_data;
                ToggleIconItem toggle_item = grid_.GetChild <ToggleIconItem>(i);
                toggle_item.Visible = false;
                toggle_item.Visible = true;

                bool be_selected = false;

                if (ENUM_SELECT_TYPE.NONE == cur_type)
                {
                    be_selected = 0 == i;
                }
                else if (ENUM_SELECT_TYPE.SELECTED == cur_type)
                {
                    be_selected = false;
                }
                else if (ENUM_SELECT_TYPE.RESELECT == cur_type)
                {
                    be_selected = prop.id == this.m_choose_officer_id;
                }

                if (be_selected && ENUM_SELECT_TYPE.SELECTED != cur_type)
                {
                    cur_type = ENUM_SELECT_TYPE.SELECTED;
                }

                toggle_item.Refresh(i, prop.icon, prop.id, be_selected, (clicked_, index_) =>
                {
                    if (clicked_)
                    {
                        if (-1 != this.m_last_choose_officer_id)
                        {
                            EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, EngineCommonAudioKey.table_change.ToString());
                        }
                        OnPoliceItemClicked(index_);
                    }
                }, null);

                toggle_item.LockVisible = 0 == officers_[i].m_lvl;
            }

            return(cur_type);
        }
示例#7
0
        public static int GetOfficerVitCost(long officer_id_, int lvl_)
        {
            ConfOfficer officer = ConfOfficer.Get(officer_id_);

            int base_vit_cost = officer.vitConsume;
            int delta_vit     = officer.upGainSceneVit;

            return(base_vit_cost + (lvl_ - 1) * delta_vit);
        }
示例#8
0
        public static int GetOfficerTimeAddition(long officer_id_, int lvl_)
        {
            ConfOfficer officer = ConfOfficer.Get(officer_id_);

            int base_time_addition = officer.secondGain;
            int delta_time         = officer.upGainSceneSceond;

            return(base_time_addition + (lvl_ - 1) * delta_time);
        }
示例#9
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 static List <String> GetKeyWordsIcon(ConfOfficer info_)
        {
            List <String> ret = new List <string>();

            for (int i = 0; i < info_.features.Length; i++)
            {
                ret.Add(LocalizeModule.Instance.GetString(ConfKeyWords.Get(info_.features[i]).icon));
            }

            return(ret);
        }
示例#11
0
        public void Refresh(long officer_id_)
        {
            m_officer_id = officer_id_;

            ConfOfficer info = ConfOfficer.Get(officer_id_);

            m_head_tex.TextureName = info.portrait;
            m_name_txt.Text        = LocalizeModule.Instance.GetString(info.name);
            m_name_txt.color       = PoliceUILogicAssist.GetPoliceQualityColor(info.quality);
            Occupied(true);
        }
示例#12
0
        private static long GetCurLevelSkillID(long officer_id_, int lvl_)
        {
            lvl_ = 0 == lvl_ ? 1 : lvl_;
            int cur_level = lvl_;

            ConfOfficer exl_data = ConfOfficer.Get(officer_id_);

            long skill_id = -1;

            switch (cur_level)
            {
            case 1:
                skill_id = exl_data.skillId;
                break;

            case 2:
                skill_id = exl_data.level2SkillId;
                break;

            case 3:
                skill_id = exl_data.level3SkillId;
                break;

            case 4:
                skill_id = exl_data.level4SkillId;
                break;

            case 5:
                skill_id = exl_data.level5SkillId;
                break;

            case 6:
                skill_id = exl_data.level6SkillId;
                break;

            case 7:
                skill_id = exl_data.level7SkillId;
                break;

            case 8:
                skill_id = exl_data.level8SkillId;
                break;

            case 9:
                skill_id = exl_data.level9SkillId;
                break;

            case 10:
                skill_id = exl_data.level10SkillId;
                break;
            }

            return(skill_id);
        }
示例#13
0
        public static string GetPoliceIconByIndex(int idx_)
        {
            long officer_id;

            if (EventGameManager.Instance.GetOfficerIdByIndex(idx_, out officer_id))
            {
                return(ConfOfficer.Get(officer_id).icon);
            }

            return(null);
        }
        public static int OfficerCompare(OfficerInfo a, OfficerInfo b)
        {
            if (a.OfficerId == b.OfficerId)
            {
                return(0);
            }

            if (a.Level > 0 && 0 == b.Level)
            {
                return(-1);
            }
            else if (0 == a.Level && b.Level > 0)
            {
                return(1);
            }
            else
            {
                if (ConfOfficer.Get(a.OfficerId).quality > ConfOfficer.Get(b.OfficerId).quality)
                {
                    return(-1);
                }
                else if (ConfOfficer.Get(a.OfficerId).quality < ConfOfficer.Get(b.OfficerId).quality)
                {
                    return(1);
                }
                else
                {
                    if (a.Level > b.Level)
                    {
                        return(-1);
                    }
                    else if (a.Level < b.Level)
                    {
                        return(1);
                    }
                    else
                    {
                        if (a.OfficerId < b.OfficerId)
                        {
                            return(-1);
                        }
                        else if (a.OfficerId > b.OfficerId)
                        {
                            return(1);
                        }
                        else
                        {
                            return(-1);
                        }
                    }
                }
            }
        }
示例#15
0
        public static List <long> GetPoliceKeyWordByOfficerID(long officer_id_)
        {
            List <long> ret = new List <long>();

            ConfOfficer confOfficer = ConfOfficer.Get(officer_id_);

            for (int i = 0; i < confOfficer.features.Length; i++)
            {
                ret.Add(confOfficer.features[i]);
            }
            return(ret);
        }
        public void PreloadLastestDispatchOffers()
        {
            List <long> latestDispatchOffers = GetAllDispathOfficersID();

            for (int i = 0; i < latestDispatchOffers.Count; ++i)
            {
                string dispatchOfferImage = ConfOfficer.Get(latestDispatchOffers[i]).portrait;
                if (!string.IsNullOrEmpty(dispatchOfferImage))
                {
                    ResourceModule.Instance.PreloadAsset(dispatchOfferImage, null);
                }
            }
        }
示例#17
0
        public static List <string> GetPoliceKeyWordIconsByOfficerID(long officer_id_)
        {
            List <string> ret         = new List <string>();
            ConfOfficer   confOfficer = ConfOfficer.Get(officer_id_);

            for (int i = 0; i < confOfficer.features.Length; i++)
            {
                int    word_id  = confOfficer.features[i];
                string word_str = LocalizeModule.Instance.GetString(ConfKeyWords.Get(word_id).icon);
                ret.Add(word_str);
            }
            return(ret);
        }
示例#18
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_Officer");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfOfficer _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
示例#19
0
        public static void GetFeedBackAndDialogue(long officer_id_, long phase_id_, int valuation_, out string feedback_, out string dialogue_)
        {
            officer_id_ = 0 == officer_id_ ? 101 : officer_id_;
            string temp_feedback = 0 == valuation_?ConfEventPhase.Get(phase_id_).normaFeedback : ConfEventPhase.Get(phase_id_).successFeedback;

            string temp_dialogue = 0 == valuation_?ConfEventPhase.Get(phase_id_).normalDialogue : ConfEventPhase.Get(phase_id_).successDialogue;

            string officer_name = LocalizeModule.Instance.GetString(ConfOfficer.Get(officer_id_).name);

            feedback_ = LocalizeModule.Instance.GetString(temp_feedback);

            feedback_ = ExchangeKeyWords(feedback_, officer_name);

            dialogue_ = LocalizeModule.Instance.GetString(temp_dialogue);

            dialogue_ = ExchangeKeyWords(dialogue_, officer_name);
        }
        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;
        }
示例#21
0
        public void AddOfficerInfo(long officerId)
        {
            OfficerInfo officerInfo = new OfficerInfo();

            officerInfo.PlayerOfficerId = officerId * 100;
            officerInfo.OfficerId       = officerId;
            officerInfo.Level           = 1;
            ConfOfficer confOfficer = ConfOfficer.Get(officerId);

            officerInfo.Outsight   = confOfficer.outsight;
            officerInfo.WillPower  = confOfficer.willpower;
            officerInfo.Attention  = confOfficer.attention;
            officerInfo.Memory     = confOfficer.memory;
            officerInfo.VitConsume = confOfficer.vitConsume;
            officerInfo.SecondGain = confOfficer.secondGain;
            AddOfficerInfo(officerInfo);
            //officerInfo.Outsight
        }
示例#22
0
        public static bool GetConfig(long id, out ConfOfficer config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_Officer", id);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        dic[id] = null;
                        config  = null;
                        return(false);
                    }
                    dic[id] = config;
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("Officer 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
示例#23
0
 public static long GetSkillIdByLevel(ConfOfficer confOffice, int level)
 {
     if (1 == level)
     {
         return(confOffice.skillId);
     }
     else if (2 == level)
     {
         return(confOffice.level2SkillId);
     }
     else if (3 == level)
     {
         return(confOffice.level3SkillId);
     }
     else if (4 == level)
     {
         return(confOffice.level4SkillId);
     }
     else if (5 == level)
     {
         return(confOffice.level5SkillId);
     }
     else if (6 == level)
     {
         return(confOffice.level6SkillId);
     }
     else if (7 == level)
     {
         return(confOffice.level7SkillId);
     }
     else if (8 == level)
     {
         return(confOffice.level8SkillId);
     }
     else if (9 == level)
     {
         return(confOffice.level9SkillId);
     }
     else
     {
         return(confOffice.level10SkillId);
     }
 }
示例#24
0
        private void RefreshOfficerView()
        {
            //if (m_officer_timestamp != GlobalInfo.MY_PLAYER_INFO.OfficerTimestamp)

            List <OfficerInfo> temp = GlobalInfo.MY_PLAYER_INFO.Officer_infos;

            if (0 != PlayerInfoManager.Instance.LimitNum)
            {
                temp = temp.GetRange(0, PlayerInfoManager.Instance.LimitNum);
            }

            if (m_officers.Count != temp.Count)
            {
                m_officers          = temp;
                m_officer_timestamp = GlobalInfo.MY_PLAYER_INFO.OfficerTimestamp;
                int police_num = m_officers.Count;


                this.m_police_item_pool.EnsureSize <CustomPoliceItem>(police_num);

                for (int i = 0; i < police_num; ++i)
                {
                    OfficerInfo info = m_officers[i];
                    var         item = this.m_police_item_pool.GetChild <CustomPoliceItem>(i);
                    item.OfficerID = info.OfficerId;
                    item.InitTex(ConfOfficer.Get(info.OfficerId).portrait);
                    item.InitMaterial();
                    item.gameObject.name = i.ToString();
                }

                List <BlurGrayTexture> polices = new List <BlurGrayTexture>();

                for (int i = 0; i < this.m_police_item_pool.ChildCount; ++i)
                {
                    polices.Add(this.m_police_item_pool.GetChild <CustomPoliceItem>(i).Police_head_tex);
                }

                this.m_curve_move_panel.InitCustomItems(polices);

                RefreshNum(1);
            }
        }
示例#25
0
        protected override void InitCarryBase()
        {
            OfficerInfo officerInfo = GlobalInfo.MY_PLAYER_INFO.GetOfficerInfoByPlayId(m_carryID);
            ConfOfficer confOffice  = ConfOfficer.Get(officerInfo.OfficerId);

            if (confOffice != null)
            {
                m_skillID = SkillTools.GetSkillIdByLevel(confOffice, officerInfo.Level);
                ConfSkill confSkill = ConfSkill.Get(m_skillID);
                if (confSkill != null)
                {
                    if (confSkill.phase == 3)
                    {
                        GameSkillManager.Instance.m_hasPoliceAddition = true;
                    }
                }
                MessageHandler.RegisterMessageHandler(MessageDefine.SCSkillTimerEmitResp, OnRes);
                base.InitCarryBase();
            }
        }
示例#26
0
        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;
                }
            }
        }
        public static ConfCombineFormula GetCombineInfo(ConfOfficer ori_officer_, int lvl_)
        {
            switch (lvl_)
            {
            case 1:
                return(ConfCombineFormula.Get(ori_officer_.unlockFormula));

            case 2:
                return(ConfCombineFormula.Get(ori_officer_.up2Formula));

            case 3:
                return(ConfCombineFormula.Get(ori_officer_.up3Formula));

            case 4:
                return(ConfCombineFormula.Get(ori_officer_.up4Formula));

            case 5:
                return(ConfCombineFormula.Get(ori_officer_.up5Formula));

            case 6:
                return(ConfCombineFormula.Get(ori_officer_.up6Formula));

            case 7:
                return(ConfCombineFormula.Get(ori_officer_.up7Formula));

            case 8:
                return(ConfCombineFormula.Get(ori_officer_.up8Formula));

            case 9:
                return(ConfCombineFormula.Get(ori_officer_.up9Formula));

            case 10:
                return(ConfCombineFormula.Get(ori_officer_.up10Formula));
            }

            return(null);
        }
示例#28
0
        void ShowOutputContent(long combine_id_)
        {
            long out_put_id = ConfCombineFormula.Get(combine_id_).outputId;

            if (0 == out_put_id)
            {
                return;
            }

            switch (m_combine_type)
            {
            case ENUM_COMBINE_TYPE.POLICE:
            {
                m_tex_view.TextureName = ConfOfficer.Get(ConfProp.Get(out_put_id).officerId).hollowPortrait;
            }
            break;

            case ENUM_COMBINE_TYPE.COLLECTION:
            {
                m_3D_view.Refresh(ConfProp.Get(out_put_id).exhibit);
                //m_3D_view.Refresh(Confexhibit.Get(out_put_id).assetName);

                //int ret = UnityEngine.Random.Range(1, 3);
                //m_3D_view.Refresh(0 == ret % 2 ? "FaYuanWai_01_MoTuoChe_01.prefab" : "G_BaoLuoGongZuoShi_01_gangtiexia_01.prefab");
            }
            break;

            case ENUM_COMBINE_TYPE.OTHER:
            {
                m_icon_view.Sprite = ConfProp.Get(out_put_id).icon;
            }
            break;

            default:
                break;
            }
        }
示例#29
0
        public void Refresh(long officer_id_, bool checked_, Action <long, bool> Clicked_)
        {
            Officer_id      = officer_id_;
            m_clicked_event = Clicked_;

            m_officer_portrait.TextureName = ConfOfficer.Get(officer_id_).portrait;

            List <string> key_word_icons = EventGameUIAssist.GetPoliceKeyWordIconsByOfficerID(officer_id_);

            m_grid.EnsureSize <GameImage>(key_word_icons.Count);

            for (int i = 0; i < m_grid.ChildCount; ++i)
            {
                var item = m_grid.GetChild <GameImage>(i);
                item.Sprite  = key_word_icons[i];
                item.Visible = true;
            }

            m_toggle.Checked = checked_;
            m_mask.Visible   = false;

            m_effect.EffectPrefabName = $"UI_jingyuanpaiqian_pinzhi0{ConfOfficer.Get(officer_id_).quality}.prefab";
            m_effect.Visible          = true;
        }
示例#30
0
        private bool IsThisOfficerCouldCombine(ConfOfficer officer_, Dictionary <long, OfficerInfo> my_combined_officers, Dictionary <long, int> all_item_in_bag_)
        {
            ConfOfficer item = officer_;

            long id  = item.id;
            int  lvl = 0;

            if (my_combined_officers.ContainsKey(id))
            {
                lvl = my_combined_officers[id].Level;
            }

            ConfCombineFormula next_level_combine_info = PoliceUILogicAssist.GetCombineInfo(item, lvl + 1);

            if (null == next_level_combine_info)
            {
                return(false);
            }

            if (!all_item_in_bag_.ContainsKey(next_level_combine_info.propId1) || !all_item_in_bag_.ContainsKey(next_level_combine_info.propId2) ||
                !all_item_in_bag_.ContainsKey(next_level_combine_info.propId3) || !all_item_in_bag_.ContainsKey(next_level_combine_info.propId4) ||
                !all_item_in_bag_.ContainsKey(next_level_combine_info.propId5) || !all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId1) ||
                !all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId2) || !all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId3) ||
                !all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId4))
            {
                //if (!bag_items.ContainsKey(next_level_combine_info.propId1) || !bag_items.ContainsKey(next_level_combine_info.propId2)
                // || !bag_items.ContainsKey(next_level_combine_info.propId3) || !bag_items.ContainsKey(next_level_combine_info.propId4)
                // || !bag_items.ContainsKey(next_level_combine_info.propId5) || !bag_items.ContainsKey(next_level_combine_info.specialPropId1)
                // || !bag_items.ContainsKey(next_level_combine_info.specialPropId2) || !bag_items.ContainsKey(next_level_combine_info.specialPropId3)
                // || !bag_items.ContainsKey(next_level_combine_info.specialPropId4))
                //{
                return(false);
                //}
            }

            //int s_id1_in_bag_count = bag_items.ContainsKey(next_level_combine_info.specialPropId1) ? bag_items[next_level_combine_info.specialPropId1].Count : 0;
            //int s_id2_in_bag_count = bag_items.ContainsKey(next_level_combine_info.specialPropId2) ? bag_items[next_level_combine_info.specialPropId2].Count : 0;
            //int s_id3_in_bag_count = bag_items.ContainsKey(next_level_combine_info.specialPropId3) ? bag_items[next_level_combine_info.specialPropId3].Count : 0;
            //int s_id4_in_bag_count = bag_items.ContainsKey(next_level_combine_info.specialPropId4) ? bag_items[next_level_combine_info.specialPropId4].Count : 0;

            int s_id1_in_add_count = all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId1) ? all_item_in_bag_[next_level_combine_info.specialPropId1] : 0;
            int s_id2_in_add_count = all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId2) ? all_item_in_bag_[next_level_combine_info.specialPropId2] : 0;
            int s_id3_in_add_count = all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId3) ? all_item_in_bag_[next_level_combine_info.specialPropId3] : 0;
            int s_id4_in_add_count = all_item_in_bag_.ContainsKey(next_level_combine_info.specialPropId4) ? all_item_in_bag_[next_level_combine_info.specialPropId4] : 0;


            //if (s_id1_in_bag_count + s_id1_in_add_count < next_level_combine_info.special1Count
            //    || s_id2_in_bag_count + s_id2_in_add_count < next_level_combine_info.special2Count
            //    || s_id3_in_bag_count + s_id3_in_add_count < next_level_combine_info.special3Count
            //    || s_id4_in_bag_count + s_id4_in_add_count < next_level_combine_info.special4Count)
            if (s_id1_in_add_count < next_level_combine_info.special1Count ||
                s_id2_in_add_count < next_level_combine_info.special2Count ||
                s_id3_in_add_count < next_level_combine_info.special3Count ||
                s_id4_in_add_count < next_level_combine_info.special4Count)

            {
                return(false);
            }

            //if (bag_items[next_level_combine_info.specialPropId1].Count < next_level_combine_info.special1Count
            //|| bag_items[next_level_combine_info.specialPropId2].Count < next_level_combine_info.special2Count
            //|| bag_items[next_level_combine_info.specialPropId3].Count < next_level_combine_info.special3Count
            //|| bag_items[next_level_combine_info.specialPropId4].Count < next_level_combine_info.special4Count)
            //{

            //    continue;
            //}

            return(true);
        }