Exemplo n.º 1
0
	public void Present(uint questID, QuestProcess state, string xml)
	{
		if (state != QuestProcess.QuestProcess_CanDone && state != QuestProcess.QuestProcess_None)
		{
			Debug.LogError(string.Format("不可接受的任务状态: {0} {1}", questID, state));
			return;
		}
		this.questID = questID;
		this.questState = state;
		uiOKButton.GetComponentInChildren<UILabel>().text = this.questState == QuestProcess.QuestProcess_CanDone ? "完成" : "接受";
		uiTitle.text = "任务交接";
		uiXmlRichText.Clear();
		uiXmlRichText.AddXml(xml);
	}
Exemplo n.º 2
0
    IEnumerator WaitForDestroy()
    {
        yield return(new WaitForSeconds(3f));

        if (m_bottomXmlText != null)
        {
            m_bottomXmlText.Clear();
        }

        if (m_bottomQueue.Count <= 0)
        {
            m_trans_Bottom.gameObject.SetActive(false);
            CheckToHide();
        }
        else
        {
            AddBottomText();
        }
    }
Exemplo n.º 3
0
    private void SetSelectSecondType(uint type, bool force = false)
    {
        if (null == mSecondTabCreator)
        {
            return;
        }
        if (m_uint_activeStype == type && !force)
        {
            return;
        }
        UISecondTypeGrid sGrid = null;

        if (m_uint_activeFType != 0)
        {
            sGrid = mSecondTabCreator.GetGrid <UISecondTypeGrid>(mlstFirstTabIds.IndexOf(m_uint_activeFType), m_dic[m_uint_activeFType].IndexOf(m_uint_activeStype));
            if (null != sGrid)
            {
                sGrid.SetHightLight(false);
            }
        }

        m_uint_activeStype = type;
        if (m_uint_activeFType != 0)
        {
            sGrid = mSecondTabCreator.GetGrid <UISecondTypeGrid>(mlstFirstTabIds.IndexOf(m_uint_activeFType), m_dic[m_uint_activeFType].IndexOf(m_uint_activeStype));
            if (null != sGrid)
            {
                sGrid.SetHightLight(true);
            }
        }
        m_UIXmlRichText.Clear();
        BibleDataBase table = GameTableManager.Instance.GetTableItem <BibleDataBase>(m_uint_activeFType, (int)m_uint_activeStype);

        if (table == null)
        {
            Engine.Utility.Log.Warning("华夏宝典表格大类{0}-小类{1}数据为空!", m_uint_activeFType, m_uint_activeStype);
            return;
        }
        string content = table.content;

        m_UIXmlRichText.AddXml(RichXmlHelper.RichXmlAdapt(content));
    }
Exemplo n.º 4
0
    protected override void OnShow(object data)
    {
        base.OnShow(data);

        if (data is LangTalkData)
        {
            m_LangTalkData = data as LangTalkData;

            m_trans_BtnRoot.transform.DestroyChildren();

            m_trans_BtnRoot.transform.parent.GetComponent <UIScrollView>().ResetPosition();

            table.NpcDataBase npcdb = GameTableManager.Instance.GetTableItem <table.NpcDataBase>(m_LangTalkData.nNpcId);
            if (npcdb != null)
            {
                m_label_Npc_Name.text = npcdb.strName;
            }

            m_UIXmlRichText.Clear();
            if (m_LangTalkData.lstTalks.Count > 0)
            {
                m_UIXmlRichText.AddXml(RichXmlHelper.RichXmlAdapt(m_LangTalkData.lstTalks[0].strText));
            }

            for (int i = 0; i < m_LangTalkData.buttons.Count; i++)
            {
                GameObject go = NGUITools.AddChild(m_trans_BtnRoot.gameObject, m_btn_btn.gameObject);
                if (go != null)
                {
                    go.GetComponentInChildren <UILabel>().text = m_LangTalkData.buttons[i].strBtnName;
                    go.name = string.Format("btn_{0}", i);
                    UIEventListener.Get(go).onClick = onClick_Btn_Btn;
                    go.transform.localPosition      = new UnityEngine.Vector3(0, -i * 58, 0);
                    go.SetActive(true);
                }
            }
        }
    }
Exemplo n.º 5
0
 /// <summary>
 /// 移除超过聊天数目限制的信息
 /// </summary>
 /// <param name="addingCount"></param>
 private bool RemoveOverfloorChat(out UIXmlRichText richtext)
 {
     richtext = null;
     if (m_lstxmlText.Count >= MaxChatNum)
     {
         richtext = m_lstxmlText[0];//移除第一个
         //Transform title = richtext.transform.Find("titlebg");
         // if (title != null)
         // {
         //                 Transform spriteBg = title.Find("titlebg");
         //                 if (spriteBg != null)
         //                 {
         //                     spriteBg.parent = richtext.transform;
         //                 }
         //   title.parent = this.transform;
         //}
         m_lstxmlText.RemoveAt(0);
         richtext.Clear();
         // title.parent = richtext.transform;
         return(true);
     }
     return(false);
 }
Exemplo n.º 6
0
    void SetContent(QuestionTab type)
    {
        m_UIXmlRichText.Clear();
        QuestionDataBase db = GameTableManager.Instance.GetTableItem <QuestionDataBase>((uint)type);

        if (db == null)
        {
            Engine.Utility.Log.Error("问卷表格id{0}的数据为空", (uint)type);
            return;
        }

        switch (type)
        {
        case QuestionTab.GongGao:
            m_trans_GongGao.gameObject.SetActive(true);
            m_trans_WenJuan.gameObject.SetActive(false);
            m_trans_FanKui.gameObject.SetActive(false);
            m_label_title.text = db.title;
            string content = db.descr;
            m_UIXmlRichText.AddXml(RichXmlHelper.RichXmlAdapt(content));
            break;

        case QuestionTab.WenJuan_1:
            m_trans_GongGao.gameObject.SetActive(false);
            m_trans_WenJuan.gameObject.SetActive(true);
            m_trans_FanKui.gameObject.SetActive(false);
            m_label_WenJuanText.text = db.descr;
            H5Address = db.H5Address;
            CreateRewardObj(m_trans_WJRewardGrid, db);
            SetWenJuanBtn();
            break;

        case QuestionTab.WenJuan_2:
            m_trans_GongGao.gameObject.SetActive(false);
            m_trans_WenJuan.gameObject.SetActive(true);
            m_trans_FanKui.gameObject.SetActive(false);
            m_label_WenJuanText.text = db.descr;
            H5Address = db.H5Address;
            CreateRewardObj(m_trans_WJRewardGrid, db);
            SetWenJuanBtn();
            break;

        case QuestionTab.WenJuan_3:
            m_trans_GongGao.gameObject.SetActive(false);
            m_trans_WenJuan.gameObject.SetActive(true);
            m_trans_FanKui.gameObject.SetActive(false);
            m_label_WenJuanText.text = db.descr;
            H5Address = db.H5Address;
            CreateRewardObj(m_trans_WJRewardGrid, db);
            SetWenJuanBtn();
            break;

        case QuestionTab.FanKui:
            m_trans_GongGao.gameObject.SetActive(false);
            m_trans_WenJuan.gameObject.SetActive(false);
            m_trans_FanKui.gameObject.SetActive(true);
            m_label_FanKuiText.text = db.descr;
            CreateRewardObj(m_trans_FKRewardGrid, db);
            SetFanKuiBtn();
            break;
        }
    }
Exemplo n.º 7
0
 void ResetDes()
 {
     uiXmlRichText.Clear();
 }
Exemplo n.º 8
0
 public void SetMessage(string xml)
 {
     uiXmlRichText.Clear();
     uiXmlRichText.AddXml(xml);
 }
Exemplo n.º 9
0
    void ShowTaskInfo(QuestTraceInfo quest)
    {
        if (quest == null)
        {
            m_label_taskName.text = "";
            richText.Clear();
            m_trans_detailInfo.gameObject.SetActive(false);
            return;
        }
        m_trans_detailInfo.gameObject.SetActive(true);



        if (m_CurrPage != MissionPanelPageEnum.Page_已接)
        {
            m_btn_btnGiveUp.gameObject.SetActive(false);
        }
        else
        {
            if (quest.taskSubType == TaskSubType.Guild)
            {
                m_btn_btnGiveUp.gameObject.SetActive(false);
            }
            else
            {
                m_btn_btnGiveUp.gameObject.SetActive(quest.taskType != GameCmd.TaskType.TaskType_Normal);
            }
        }



        //暂时因为版本问题关闭氏族的放弃按钮
        //if (quest.taskType == GameCmd.TaskType.TaskType_Clan)
        //{
        //    m_btn_btnGiveUp.gameObject.SetActive(false);
        //}



        m_label_taskReward.gameObject.SetActive(quest.taskType != GameCmd.TaskType.TaskType_Token);
        m_currquest = quest;

        m_label_taskName.text = quest.QuestTable.strName;

        richText.Clear();
        string desc = string.Format("<size value=\"24\"><color value=\"#1c2850\">{0} </color></size>", quest.strIntro);

        richText.AddXml(RichXmlHelper.RichXmlAdapt(desc));

        if (quest.Items.Count <= 0) //请求任务奖励
        {
            NetService.Instance.Send(new GameCmd.stRequestTaskRewardScriptUserCmd_C()
            {
                task_id = quest.taskId
            });
        }
        else
        {
            m_lstRewardItemInfo = GetRewardInfoList(quest.exp, quest.money, quest.gold, quest.Items, quest.ItemNum);
            m_rewardItemGridCreator.CreateGrids(m_lstRewardItemInfo != null ? m_lstRewardItemInfo.Count : 0);
            //ShowReward(quest.Items, quest.ItemNum, quest.gold, quest.money, quest.exp);
        }
    }
Exemplo n.º 10
0
    public void SetChatInfo(int panelWidth, ChatInfo text, PanelID panelid = PanelID.None)
    {
        m_parentPanelID = panelid;
        m_panelWidth    = panelWidth;
        float halfPanelWidth = m_panelWidth * 0.5f;

        if ((text.Channel == GameCmd.CHATTYPE.CHAT_SYS || text.Id == 0) && !text.IsRedPacket)
        {
            if (m_transNormal.gameObject.activeSelf)
            {
                m_transNormal.gameObject.SetActive(false);
            }
            if (!m_transSys.gameObject.activeSelf)
            {
                m_transSys.gameObject.SetActive(true);
            }


            if (m_spriteTitleBg != null)
            {
                m_spriteTitleBg.transform.localPosition = new UnityEngine.Vector3(-halfPanelWidth, 5, 0);

                m_spriteTitleBg.ChangeSprite(GetChannelIndex(GameCmd.CHATTYPE.CHAT_SYS));
            }

            if (m_lableSysTitle != null)
            {
                if (text.Id == 0)
                {
                    m_lableSysTitle.text = DataManager.Manager <ChatDataManager>().GetChannelStr(text.Channel);
                }
                else
                {
                    m_lableSysTitle.text = "系统";
                }
                m_spriteSysBg.height = m_lableSysTitle.height;

                // m_spriteTitleBg.width = m_lableSysTitle.width + 10;
                //m_spriteTitleBg.height = m_lableSysTitle.height + 10;

                m_lableSysTitle.transform.localPosition = new Vector3(-halfPanelWidth + 5, 0, 0);
            }

            m_spriteSysBg.transform.localPosition = new Vector3(m_spriteTitleBg.transform.localPosition.x + m_spriteTitleBg.width + 2, 0, 0);

            // m_spriteSysBg.width = GetMaxWidth() - m_lableSysTitle.width;
            m_sysRichTextContext.Clear();
            m_sysRichTextContext.AddXml(text.Content);
            bound      = NGUIMath.CalculateRelativeWidgetBounds(transform, false);
            m_chatdata = null;
        }
        else
        {
            if (!m_transNormal.gameObject.activeSelf)
            {
                m_transNormal.gameObject.SetActive(true);
            }
            if (m_transSys.gameObject.activeSelf)
            {
                m_transSys.gameObject.SetActive(false);
            }

            m_chatdata = text;

            m_normalRichTextContext.Clear();
            if (text.IsRedPacket)
            {
                m_trans_normalInfo.gameObject.SetActive(false);
                m_trans_redPacket.gameObject.SetActive(true);
            }
            else
            {
                m_trans_normalInfo.gameObject.SetActive(true);
                m_trans_redPacket.gameObject.SetActive(false);
            }
            m_label_blessmsg.text = text.RichText;
            if (text.IsMe)
            {
                SetChatMsgUI_Right(text);
            }
            else
            {
                SetChatMsgUI_Left(text);
            }
        }
    }