public override void OnShow(object param)
        {
            base.OnShow(param);

            GameEvents.UIEvents.UI_GameEntry_Event.OnMaskBGVisible.SafeInvoke(true);

            MessageHandler.RegisterMessageHandler(MessageDefine.SCEnterResponse, OnScResponse);



            this.m_task_id = -1;

            if (null != param)
            {
                List <long> my_param = param as List <long>;
                this.m_scene_id = my_param[0];
                this.m_task_id  = my_param[1];
                m_view.Refresh(this.m_scene_id, this.m_task_id);

                Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                {
                    { UBSParamKeyName.ContentID, ConfJigsawScene.Get(this.m_scene_id).sceneInfoId },
                };
                UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.Pintu_start, null, _params);
            }

            m_is_started = false;
        }
示例#2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfJigsawScene config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_JigsawScene", 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("JigsawScene 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
        public override void OnScResponse(object s)
        {
            base.OnScResponse(s);

            if (s is SCEnterResponse)
            {
                var rsp = s as SCEnterResponse;

                m_is_started = false;

                if (!MsgStatusCodeUtil.OnError(rsp.Result))
                {
                    this.RefreshCostItemNum();

                    Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                    {
                        { UBSParamKeyName.Success, 1 },
                        { UBSParamKeyName.SceneID, this.m_scene_id },
                        { UBSParamKeyName.ContentID, ConfJigsawScene.Get(this.m_scene_id).sceneInfoId },
                    };
                    UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.Pintu_begin, null, _params);

                    FrameMgr.OpenUIParams ui_param = new FrameMgr.OpenUIParams(UIDefine.UI_JIGSAW);

                    ui_param.Param = new List <long> {
                        this.m_scene_id, ConfJigsawScene.Get(this.m_scene_id).sceneInfoId
                    };

                    EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(ui_param);

                    this.CloseFrame();
                    EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_CHAPTER);
                }
                else
                {
                    //#if UNITY_DEBUG
                    //                    FrameMgr.OpenUIParams ui_param = new FrameMgr.OpenUIParams(UIDefine.UI_JIGSAW);

                    //                    ui_param.Param = new List<long> { this.m_scene_id, ConfJigsawScene.Get(this.m_scene_id).sceneInfoId };

                    //                    EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(ui_param);

                    //                    this.CloseFrame();
                    //                    EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_CHAPTER);
                    //#else

                    Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                    {
                        { UBSParamKeyName.Success, 0 },
                        { UBSParamKeyName.Description, rsp.Result },
                        { UBSParamKeyName.SceneID, this.m_scene_id },
                        { UBSParamKeyName.ContentID, ConfJigsawScene.Get(this.m_scene_id).sceneInfoId },
                    };
                    UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.Pintu_begin, null, _params);
                    //#endif
                }
            }
        }
示例#4
0
        private static ConfJigsawScene GetConfByDic(DataTable reader)
        {
            long id = reader.GetInt64(0);

            int[]  costPropNums = (int[])reader.GetArrayData(1, 11);
            long[] costPropIds  = (long[])reader.GetArrayData(2, 17);
            int    propId       = reader.GetInt32(3);
            int    sceneInfoId  = reader.GetInt32(4);
            int    num4         = reader.GetInt32(5);
            int    type4        = reader.GetInt32(6);
            int    percent4     = reader.GetInt32(7);
            int    num3         = reader.GetInt32(8);
            int    type3        = reader.GetInt32(9);
            int    percent3     = reader.GetInt32(10);
            int    num2         = reader.GetInt32(11);
            int    type2        = reader.GetInt32(12);
            int    percent2     = reader.GetInt32(13);
            int    num1         = reader.GetInt32(14);
            int    type1        = reader.GetInt32(15);
            int    percent1     = reader.GetInt32(16);
            string taskIds      = reader.GetString(17);
            int    difficulty   = reader.GetInt32(18);
            string thumbnail    = reader.GetString(19);
            string name         = reader.GetString(20);
            string desc2        = reader.GetString(21);
            string desc         = reader.GetString(22);

            ConfJigsawScene new_obj_ConfJigsawScene = new ConfJigsawScene(id,
                                                                          costPropNums,
                                                                          costPropIds,
                                                                          propId,
                                                                          sceneInfoId,
                                                                          num4,
                                                                          type4,
                                                                          percent4,
                                                                          num3,
                                                                          type3,
                                                                          percent3,
                                                                          num2,
                                                                          type2,
                                                                          percent2,
                                                                          num1,
                                                                          type1,
                                                                          percent1,
                                                                          taskIds,
                                                                          difficulty,
                                                                          thumbnail,
                                                                          name,
                                                                          desc2,
                                                                          desc
                                                                          );

            return(new_obj_ConfJigsawScene);
        }
        private void RefreshCostItemNum()
        {
            ConfJigsawScene data = ConfJigsawScene.Get(m_scene_id);

            if (data.costPropIds.Length > 0)
            {
                long prop_id         = data.costPropIds[0];
                int  item_in_bag_num = null != GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(prop_id) ? GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(prop_id).Count : 0;

                if (item_in_bag_num >= 1)
                {
                    GlobalInfo.MY_PLAYER_INFO.ReducePropForBag(prop_id);
                }
            }
        }
示例#6
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_JigsawScene");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfJigsawScene _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
示例#7
0
        public static bool GetConfig(long id, out ConfJigsawScene config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_JigsawScene", 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("JigsawScene 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
示例#8
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();
 }
示例#9
0
        private void RefreshOutputData(ConfJigsawScene data)
        {
            //foreach (var item in m_output_icon_list)
            //{
            //    item.Visible = false;
            //}

            //foreach (var item in m_output_txt_list)
            //{
            //    item.Visible = false;
            //}

            List <int> output_types = new List <int>()
            {
                data.type4,
                data.type3,
                data.type2,
                data.type1,
            };

            List <int> output_nums = new List <int>()
            {
                data.num4,
                data.num3,
                data.num2,
                data.num1,
            };

            Dictionary <int, Dictionary <string, int> > exist_output = new Dictionary <int, Dictionary <string, int> >();

            for (int i = 0; i < output_types.Count; ++i)
            {
                int cur_type = output_types[i];
                int cur_num  = output_nums[i];

                if (exist_output.ContainsKey(cur_type))
                {
                    if (cur_num < exist_output[cur_type]["min"])
                    {
                        int old_min = exist_output[cur_type]["min"];
                        exist_output[cur_type]["min"] = cur_num;
                        exist_output[cur_type]["max"] = old_min;
                    }
                    else
                    {
                        if (cur_num > exist_output[cur_type]["max"])
                        {
                            exist_output[cur_type]["max"] = cur_num;
                        }
                    }
                }
                else
                {
                    exist_output[cur_type]        = new Dictionary <string, int>();
                    exist_output[cur_type]["max"] = cur_num;
                    exist_output[cur_type]["min"] = cur_num;
                }
            }

            m_exist_output = exist_output;

            //int j = 0;
            //foreach (KeyValuePair<int, Dictionary<string, int>> kvp in exist_output)
            //{
            //    int output_type = kvp.Key;
            //    int max_num = kvp.Value["max"];
            //    int min_num = kvp.Value["min"];

            //    m_output_txt_list[j].Visible = true;
            //    if (min_num != max_num)
            //        m_output_txt_list[j].Text = string.Format("~{0}", max_num);
            //    else
            //        m_output_txt_list[j].Text = string.Format("~{0}", min_num);

            //    m_output_icon_list[j].Visible = true;
            //    switch (output_type)
            //    {
            //        case ((int)EUNM_BASE_REWARD.E_COIN):
            //            {
            //                m_output_icon_list[j].Sprite = "icon_mainpanel_coin.png";
            //            }
            //            break;
            //        case ((int)EUNM_BASE_REWARD.E_CASH):
            //            {

            //                m_output_icon_list[j].Sprite = "icon_mainpanel_cash.png";

            //            }
            //            break;
            //        case ((int)EUNM_BASE_REWARD.E_EXP):
            //            {

            //                m_output_icon_list[j].Sprite = "icon_mainpanel_exp.png";

            //            }
            //            break;
            //        case ((int)EUNM_BASE_REWARD.E_VIT):
            //            {

            //                m_output_icon_list[j].Sprite = "icon_mainpanel_energy.png";

            //            }
            //            break;
            //    }

            //    ++j;
            //}
        }
示例#10
0
        public void Refresh(long scene_id_, long task_id_ = -1)
        {
            m_task_id = task_id_;
            ConfJigsawScene data = ConfJigsawScene.Get(scene_id_);

            m_desc_txt.Text = LocalizeModule.Instance.GetString(data.desc2);

            m_output_title_txt.Text = LocalizeModule.Instance.GetString("ui.event.Output");

            m_time_txt.Text = CommonTools.SecondToStringMMSS(data.percent4);


            m_thumbnail_tex.TextureName = data.thumbnail;

            RefreshOutputData(data);
            RefreshOutputView();

            //m_drop_title_txt.Text = LocalizeModule.Instance.GetString("ui.event.CommonDrop");

            //if (data.propId > 0)
            //{
            //    List<long> ids = CommonHelper.GetDropOuts(data.propId);

            //    m_drop_grid.EnsureSize<DropItemIcon>(ids.Count);

            //    for (int i = 0; i < m_drop_grid.ChildCount; ++i)
            //    {
            //        m_drop_grid.GetChild<DropItemIcon>(i).InitSprite(ConfProp.Get(ids[i]).icon, 0, ids[i]);
            //        m_drop_grid.GetChild<DropItemIcon>(i).Visible = true;
            //    }

            //}
            //else
            //{
            //    m_drop_grid.Clear();
            //}

            m_case_name_txt.Text = LocalizeModule.Instance.GetString(data.name);

            if (data.costPropIds.Length > 0)
            {
                long prop_id = data.costPropIds[0];
                m_ticket_icon.Sprite = ConfProp.Get(prop_id).icon;
                m_item_in_bag_num    = null != GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(prop_id) ? GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(prop_id).Count : 0;
                m_item_cost_num      = data.costPropNums[0];

                m_action_btn_num_txt.Text = string.Format("{0}/{1}", m_item_in_bag_num, m_item_cost_num);

                if (m_item_in_bag_num >= m_item_cost_num)
                {
                    m_action_btn_num_txt.color = Color.white;
                }
                else
                {
                    m_action_btn_num_txt.color = Color.red;
                }
            }
            else
            {
                m_action_btn_num_txt.Text = "";
            }
        }