public void Refresh(SCEventPhaseFeedbackResponse data_)
        {
            m_data = (SCEventPhaseFeedbackResponse)data_;

            foreach (var item in m_data.PhaseInfos)
            {
                m_phases.Enqueue(item);
            }

            ConfEvent event_data = ConfEvent.Get(CurViewLogic().Event_id);

            m_type_icon.Sprite     = ConfEventAttribute.Get(event_data.type).icon;
            m_cur_score_num.Text   = event_data.perfectMark.ToString();
            m_full_score           = m_cur_score = event_data.perfectMark;
            m_score_progress.Value = ((float)m_cur_score) / event_data.perfectMark;

            Vector3[] corners = new Vector3[4];
            m_score_progress.Widget.GetWorldCorners(corners);
            Vector3 bottomLeftConner = corners[0];
            Vector3 topRightConner   = corners[2];

            float normal_progress = (float)(event_data.perfectMark - event_data.passMark) / (float)event_data.perfectMark;

            float normal_worldpos_x = bottomLeftConner.x + (topRightConner.x - bottomLeftConner.x) * normal_progress;

            m_normal_img.Widget.transform.position = new Vector3(normal_worldpos_x, m_normal_img.Widget.transform.position.y, m_normal_img.Widget.transform.position.z);

            NextStep();
        }
示例#2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfEvent config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_Event", 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("Event 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
示例#3
0
        public static List <long> GetPhaseIDs(ConfEvent event_data_)
        {
            List <long> ret = new List <long>();

            for (int i = 0; i < event_data_.phases.Length; i++)
            {
                ret.Add(event_data_.phases[i]);
            }

            return(ret);
        }
        public void Refresh(int total_officer_count_)
        {
#if OFFICER_SYS
            m_officers_grid.EnsureSize <EventGameOfficerDispatchItemView>(total_officer_count_);

            for (int i = 0; i < m_officers_grid.ChildCount; ++i)
            {
                m_officers_grid.GetChild <EventGameOfficerDispatchItemView>(i).Init(i);
                m_officers_grid.GetChild <EventGameOfficerDispatchItemView>(i).Visible = true;
            }
#endif

            ConfEvent event_data = ConfEvent.Get(CurViewLogic().Event_id);

            m_vit_cost_num_txt.Text = event_data.vitConsume.ToString();

            HashSet <long> keywords = new HashSet <long>();

            foreach (var phase_id in event_data.phases)
            {
                var phase = ConfEventPhase.Get(phase_id);

                foreach (var key_id in phase.keyWords)
                {
                    keywords.Add(key_id);
                }
            }

            m_keywords_grid.EnsureSize <EventGameKeywordItemView>(keywords.Count);

            int gi = 0;
            foreach (var item in keywords)
            {
                m_keywords_grid.GetChild <EventGameKeywordItemView>(gi).Refresh(gi, item);
                m_keywords_grid.GetChild <EventGameKeywordItemView>(gi).Visible = true;
                ++gi;
            }

            m_event_icon.Sprite    = ConfEventAttribute.Get(event_data.type).icon;
            m_event_name.Text      = LocalizeModule.Instance.GetString(event_data.name);
            m_event_desc.Text      = LocalizeModule.Instance.GetString(event_data.descs);
            m_case_name.Text       = LocalizeModule.Instance.GetString(ConfEventAttribute.Get(event_data.type).name);
            m_case_tex.TextureName = event_data.sceneInfo;


            m_normal_cash_txt.Text  = event_data.coinGain.ToString();
            m_perfect_cash_txt.Text = event_data.cashGain.ToString();
        }
示例#5
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_Event");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfEvent _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
示例#6
0
        private static ConfEvent GetConfByDic(DataTable reader)
        {
            long   id            = reader.GetInt64(0);
            string conclusion    = reader.GetString(1);
            long   perfectDropId = reader.GetInt64(2);
            long   normalDropId  = reader.GetInt64(3);
            int    cashGain      = reader.GetInt32(4);
            int    coinGain      = reader.GetInt32(5);
            int    expGain       = reader.GetInt32(6);
            int    vitGain       = reader.GetInt32(7);

            long[] phases         = (long[])reader.GetArrayData(8, 17);
            int    perfectMark    = reader.GetInt32(9);
            int    passMark       = reader.GetInt32(10);
            int    vitConsume     = reader.GetInt32(11);
            int    type           = reader.GetInt32(12);
            string sceneInfo      = reader.GetString(13);
            string conclusionFail = reader.GetString(14);
            string background     = reader.GetString(15);
            string descInfo       = reader.GetString(16);
            string descs          = reader.GetString(17);
            string name           = reader.GetString(18);

            ConfEvent new_obj_ConfEvent = new ConfEvent(id,
                                                        conclusion,
                                                        perfectDropId,
                                                        normalDropId,
                                                        cashGain,
                                                        coinGain,
                                                        expGain,
                                                        vitGain,
                                                        phases,
                                                        perfectMark,
                                                        passMark,
                                                        vitConsume,
                                                        type,
                                                        sceneInfo,
                                                        conclusionFail,
                                                        background,
                                                        descInfo,
                                                        descs,
                                                        name
                                                        );

            return(new_obj_ConfEvent);
        }
示例#7
0
        public static bool GetConfig(long id, out ConfEvent config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_Event", 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("Event 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
示例#8
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            if (param is EventGameEntryData)
            {
                m_event_id = ((EventGameEntryData)param).M_event_id;
            }

            MessageHandler.RegisterMessageHandler(MessageDefine.SCEventPhaseFeedbackResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCEventEnterResponse, OnScResponse);
#if OFFICER_SYS
            GameEvents.UIEvents.UI_EventGame_Event.Listen_NeedAnOfficer   += NeedAnOfficerForEventGame;
            GameEvents.UIEvents.UI_EventGame_Event.Listen_RemoveAnOfficer += RemoveAnOfficerForEventGame;

            GameEvents.UIEvents.UI_Enter_Event.EVT_SELECT_POLICE += Evt_Select_Police_Obersver;
#endif


            m_view.Refresh(ConfEvent.Get(Event_id).phases.Length);
        }
示例#9
0
 public static void Register()
 {
     ConfAchievement.Init();
     ConfActiveDrop.Init();
     ConfActivityBase.Init();
     ConfAssetManifest.Init();
     Confbranchtask.Init();
     ConfBuilding.Init();
     ConfCartoonScene.Init();
     ConfChapter.Init();
     ConfCharge.Init();
     ConfChat.Init();
     ConfChatItem.Init();
     ConfCheckIn.Init();
     ConfCombineFormula.Init();
     ConfDemoScene.Init();
     ConfDropOut.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfDropOut2.Init();
     Confetl.Init();
     ConfEvent.Init();
     ConfEventAttribute.Init();
     ConfEventPhase.Init();
     Confexhibit.Init();
     ConfExpToLevel.Init();
     Conffailtips.Init();
     ConfFeedback.Init();
     ConfFind.Init();
     ConfFindClue.Init();
     ConfFindTypeIcon.Init();
     ConfGMCMD.Init();
     ConfGuid.Init();
     ConfGuidArt.Init();
     ConfGuidNew.Init();
     ConfGuidNewFunction.Init();
     Confinapppurchase.Init();
     ConfJigsawScene.Init();
     ConfKeyWords.Init();
     ConfLanguage.Init();
     ConfMsgCode.Init();
     ConfNode.Init();
     ConfNpc.Init();
     ConfOfficer.Init();
     ConfPath.Init();
     ConfPoliceRankIcon.Init();
     ConfProp.Init();
     ConfPropGift.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfPush.Init();
     ConfReasoning.Init();
     ConfScene.Init();
     ConfSceneDifficulty.Init();
     ConfSceneSpecial.Init();
     ConfServiceConfig.Init();
     ConfSkill.Init();
     ConfSkyEye.Init();
     ConfSound.Init();
     ConfTask.Init();
     ConfTitle.Init();
 }
示例#10
0
        public static List <long> GetPhaseIDs(long event_id_)
        {
            ConfEvent event_data = ConfEvent.Get(event_id_);

            return(GetPhaseIDs(event_data));
        }