예제 #1
0
        private static ConfChatItem GetConfByDic(DataTable reader)
        {
            long id = reader.GetInt64(0);

            string[] jumpcontens = (string[])reader.GetArrayData(1, 12);
            long[]   jumpids     = (long[])reader.GetArrayData(2, 17);
            int      jumptype    = reader.GetInt32(3);

            string[] propids      = (string[])reader.GetArrayData(4, 12);
            string   content      = reader.GetString(5);
            string   name         = reader.GetString(6);
            int      iconPosition = reader.GetInt32(7);
            string   icon         = reader.GetString(8);
            string   apellation   = reader.GetString(9);
            string   description  = reader.GetString(10);
            long     chatId       = reader.GetInt64(11);

            ConfChatItem new_obj_ConfChatItem = new ConfChatItem(id,
                                                                 jumpcontens,
                                                                 jumpids,
                                                                 jumptype,
                                                                 propids,
                                                                 content,
                                                                 name,
                                                                 iconPosition,
                                                                 icon,
                                                                 apellation,
                                                                 description,
                                                                 chatId
                                                                 );

            return(new_obj_ConfChatItem);
        }
예제 #2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfChatItem config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_ChatItem", 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("ChatItem 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
예제 #3
0
        private void setPartData()
        {
            GetCurrentIndex();
            //++m_currentIndex;
            if (m_currentIndex < 0 || m_currentIndex >= m_talkdata.partData.Count)
            {
                TalkOver();
                return;
            }
            ConfChatItem partdata = m_talkdata.partData[m_currentIndex];

            setPartData(partdata);
        }
예제 #4
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_ChatItem");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfChatItem _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
예제 #5
0
        public static bool GetConfig(long id, out ConfChatItem config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_ChatItem", 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("ChatItem 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
예제 #6
0
        private void InitData(long id)
        {
            ConfChat confChat = ConfChat.Get(id);

            if (confChat == null)
            {
                DebugUtil.LogError("chat data is not exist");
            }
            m_talkdata          = new TalkData();
            m_talkdata.chatData = confChat;
            string sceneName = confChat.sceanid;

            if (!sceneName.Contains(".png"))
            {
                sceneName += ".png";
            }
            m_bg_tex.TextureName = sceneName;
            ConfChatItem.GetConfig("chatId", confChat.id, out m_talkdata.partData);
        }
예제 #7
0
 private void EventChoose(long id)
 {
     if (id == 0)
     {
         TalkOver();
     }
     else if (id > 0)
     {
         for (int i = 0; i < m_talkdata.partData.Count; i++)
         {
             ConfChatItem partdata = m_talkdata.partData[i];
             if (partdata.id == id)
             {
                 m_currentIndex = i;
                 setPartData(partdata);
             }
         }
     }
     else if (id < 0)
     {
         setPartData();
     }
 }
예제 #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 setPartData(ConfChatItem partdata)
        {
            if (partdata.jumpids != null)
            {
                for (int i = 0; i < partdata.jumpids.Length; i++)
                {
                    if (!m_chooseID.Contains(partdata.jumpids[i]))
                    {
                        m_chooseID.Add(partdata.jumpids[i]);
                    }
                }
            }

            for (int i = 0; i < this.m_talkTexture.Length; i++)
            {
                string[] apellationName = partdata.apellation.Split(',');
                if (partdata.propids != null && i < partdata.propids.Length)
                {
                    string propName    = partdata.propids[i];
                    string articleName = string.Empty;
                    if (i < apellationName.Length)
                    {
                        articleName = LocalizeModule.Instance.GetString(apellationName[i]);
                    }
                    if (propName.Contains("role") || propName.Contains("suspect"))
                    {
                        this.m_talkTexture[i].SetData(propName, articleName, false);
                        //m_person_Img[i].TextureName = propName;
                        //m_article_img[i].Visible = false;
                        //m_person_Img[i].Visible = true;
                    }
                    else
                    {
                        this.m_talkTexture[i].SetData(propName, articleName, true);
                        //m_article_img[i].Sprite = propName;
                        //m_article_img[i].Visible = true;
                        //m_person_Img[i].Visible = false;
                    }
                    m_talkTexture[i].m_isTweener = false;
                    m_talkTexture[i].Visible     = true;
                }
                else
                {
                    if (!m_talkTexture[i].m_isTweener)
                    {
                        m_talkTexture[i].m_isTweener = true;
                        m_talkTexture[i].Visible     = false;
                    }
                }
            }
            if (0 == partdata.iconPosition)
            {
                m_leftPartUI.Visible = true;
            }
            else
            {
                m_rightPartUI.Visible = true;
            }

            if (partdata.iconPosition == 0)
            {
                m_leftPartUI.setData(partdata);
                this.m_currentPart = m_leftPartUI;
            }
            else// if (partdata.iconPosition == 2)
            {
                m_rightPartUI.setData(partdata);
                this.m_currentPart = m_rightPartUI;
            }
            m_leftPartUI.IsTalk(partdata.iconPosition == 0);
            m_rightPartUI.IsTalk(partdata.iconPosition != 0);
        }
예제 #10
0
 public void setData(ConfChatItem partdata)
 {
     if (partdata == null)
     {
         return;
     }
     m_partdata = partdata;
     if (m_partdata.icon.Contains("${player_icon}"))
     {
         //if (!GlobalInfo.MY_PLAYER_INFO.PlayerIcon.Contains("http") && !GlobalInfo.MY_PLAYER_INFO.PlayerIcon.Contains("https"))
         //    m_icon_tex.TextureName = CommonData.GetBigPortrait(GlobalInfo.MY_PLAYER_INFO.PlayerIcon);
         //else
         //    m_icon_tex.TextureName = "image_player_size4_1.png";
         m_icon_tex.SpineName = CommonData.GetSpineHead(GlobalInfo.MY_PLAYER_INFO.PlayerIcon);
         m_isSpine            = true;
         //this.m_icon_tex.Visible = true;
         //m_icon_texture.Visible = false;
     }
     else
     {
         if (m_partdata.icon.Contains(".png"))
         {
             m_icon_texture.TextureName = m_partdata.icon;
             m_isSpine = false;
             //m_icon_texture.Visible = true;
             //this.m_icon_tex.Visible = false;
         }
         else
         {
             m_icon_tex.SpineName = m_partdata.icon.Trim();
             m_isSpine            = true;
             //m_icon_tex.Visible = true;
             //this.m_icon_texture.Visible = false;
         }
     }
     //m_icon_tex.PlayAnimation(string.Empty,true);
     setPartType(m_partdata.jumptype);
     m_curType = m_partdata.jumptype;
     if (m_partdata.jumptype == 0)
     {
         //文字
         string temp = LocalizeModule.Instance.GetString(m_partdata.content);
         TalkContent = temp;
         //m_noContent_lab.Text = temp;
         int   line         = GetLineForText(temp);
         float fonts_height = (line + 2) * fontSize;
         m_textRoot_obj.Widget.sizeDelta = new Vector2(m_textRoot_obj.Widget.sizeDelta.x, fonts_height);
     }
     else
     {
         m_chooseContent_lab.Text = LocalizeModule.Instance.GetString(m_partdata.content);
         if (m_partdata.jumptype == 2)
         {
             setTextChoose();
         }
         else if (m_partdata.jumptype == 1)
         {
             setImgChoose();
         }
     }
 }