private DetailType.DT GetQuestionContentType() { DetailType.DT result = DetailType.DT.Equipment; if (this.m_chatInfo.src_channel == 2 && this.m_chatInfo.items != null) { result = this.m_chatInfo.items.get_Item(0).type; } return(result); }
private string DealQuestionContent(string content) { DetailType.DT questionContentType = this.GetQuestionContentType(); string text = string.Empty; string[] array = content.Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { if (!string.IsNullOrEmpty(array[i])) { if (i == 0 && questionContentType == DetailType.DT.GuildQuestion) { this.m_questionTitle.set_text(string.Format("第{0}题", array[i])); } else if (questionContentType == DetailType.DT.GuildRightAnswer) { text = array[i]; } else if (questionContentType == DetailType.DT.GuildQuestionNotice) { GameObject gameObject = new GameObject(); gameObject.set_name("diamond" + i); gameObject.AddComponent <Image>(); Image component = gameObject.GetComponent <Image>(); component.get_rectTransform().SetParent(this.m_questionRootContent); component.get_rectTransform().set_localPosition(new Vector3(0f, -12.5f - (float)(27 * i), 0f)); component.get_rectTransform().set_localScale(new Vector3(1f, 1f, 1f)); component.get_rectTransform().set_sizeDelta(new Vector2(25f, 25f)); ResourceManager.SetSprite(component, ResourceManager.GetIconSprite("j_diamond001")); text += array[i]; if (i != array.Length - 1 && array.Length > 0) { text += "\n"; } } else { text += array[i]; } } } if (questionContentType == DetailType.DT.GuildQuestion) { text = "<color=#50321E><size=22>" + text + "</size></color>"; } return(text); }
private void SetSender(bool isOwn, bool isVoice, string sender_name, string datetime) { if (!isOwn) { bool flag = this.CheckIsQuestionContent(); this.m_normalMsg.SetActive(!flag); if (this.m_questionMsg != null) { this.m_questionMsg.SetActive(flag); } if (flag) { DetailType.DT questionContentType = this.GetQuestionContentType(); if (questionContentType == DetailType.DT.GuildQuestionNotice) { if (this.m_quContentBg != null) { this.m_quContentBg.get_gameObject().SetActive(false); } if (this.m_quContentBg2 != null) { this.m_quContentBg2.get_gameObject().SetActive(false); } if (this.m_quInfoBg != null) { this.m_quInfoBg.get_gameObject().SetActive(true); } if (this.m_questionRootTitle != null) { this.m_questionRootTitle.SetActive(false); } if (this.m_questionContent != null) { this.m_questionContent.set_color(ChatInfo2Channel.Color_questionContent_GuildQuestionNotice); } if (this.m_questionRootContent != null) { this.m_questionRootContent.set_anchoredPosition(new Vector2(-175f, this.m_questionRootContent.get_anchoredPosition().y)); } } else if (questionContentType == DetailType.DT.GuildQuestion) { if (this.m_quContentBg != null) { this.m_quContentBg.get_gameObject().SetActive(true); } if (this.m_quContentBg2 != null) { this.m_quContentBg2.get_gameObject().SetActive(true); } if (this.m_quInfoBg != null) { this.m_quInfoBg.get_gameObject().SetActive(false); } if (this.m_questionRootTitle != null) { this.m_questionRootTitle.SetActive(true); } if (this.m_questionRootContent != null) { this.m_questionRootContent.set_anchoredPosition(new Vector2(-210f, -60f)); } } else if (questionContentType == DetailType.DT.GuildRightAnswer) { if (this.m_quContentBg != null) { this.m_quContentBg.get_gameObject().SetActive(false); } if (this.m_quContentBg2 != null) { this.m_quContentBg2.get_gameObject().SetActive(false); } if (this.m_quInfoBg != null) { this.m_quInfoBg.get_gameObject().SetActive(true); } if (this.m_questionRootTitle != null) { this.m_questionRootTitle.SetActive(false); } if (this.m_questionRootContent != null) { this.m_questionRootContent.set_anchoredPosition(new Vector2(-175f, this.m_questionRootContent.get_anchoredPosition().y)); } if (this.m_quInfoBg != null) { ResourceManager.SetSprite(this.m_quInfoBg, ResourceManager.GetCodeSprite("heidi_yuyin")); this.m_quInfoBg.set_color(ChatInfo2Channel.Color_quInfoBg); } if (this.m_questionContent != null) { this.m_questionContent.set_color(ChatInfo2Channel.Color_questionContent_GuildRightAnswer); this.m_questionContent.set_alignment(1); } if (this.m_questionContent != null) { this.m_questionContent.get_rectTransform().set_pivot(ConstVector2.MR); this.m_questionContent.get_rectTransform().set_anchoredPosition(new Vector2(175f, 0f)); } } } else { ResourceManager.SetSprite(this.m_spContentBg, ResourceManager.GetCodeSprite("talkframe_1")); RectTransform rectTransform = this.m_spContentBg.get_transform() as RectTransform; rectTransform.set_pivot(new Vector2(0f, 1f)); rectTransform.set_anchoredPosition(new Vector2(-130f, rectTransform.get_anchoredPosition().y)); this.m_sender.set_anchoredPosition(new Vector2(-170f, this.m_sender.get_anchoredPosition().y)); this.m_lblSenderName.set_alignment(3); RectTransform rectTransform2 = this.m_lblSenderName.get_transform() as RectTransform; rectTransform2.set_pivot(new Vector2(0f, 0.5f)); rectTransform2.set_anchoredPosition(new Vector2(-125f, rectTransform2.get_anchoredPosition().y)); this.m_rectVIP.set_pivot(new Vector2(0f, 0.5f)); this.m_rectVIP.set_anchoredPosition(new Vector2(rectTransform2.get_anchoredPosition().x, this.m_rectVIP.get_anchoredPosition().y)); this.m_rectVIP.GetComponent <HorizontalLayoutGroup>().set_padding(new RectOffset(0, 128, 0, 0)); this.m_rectVIP.GetComponent <HorizontalLayoutGroup>().set_childAlignment(0); this.m_rootContent.set_anchoredPosition(new Vector2(-105f, this.m_rootContent.get_anchoredPosition().y)); this.m_rootVoice.get_gameObject().SetActive(isVoice); if (isVoice) { this.m_rootVoice.set_anchoredPosition(new Vector2(0f, this.m_rootVoice.get_anchoredPosition().y)); this.m_rootVoiceIcon.set_localEulerAngles(new Vector3(0f, 0f, 0f)); this.m_rootVoiceIcon.set_anchoredPosition(new Vector2(-95f, this.m_rootVoiceIcon.get_anchoredPosition().y)); this.m_rootVoiceDOT.set_pivot(new Vector2(0f, 0.5f)); this.m_rootVoiceDOT.set_anchoredPosition(new Vector2(rectTransform.get_sizeDelta().x + -145f, this.m_rootVoiceDOT.get_anchoredPosition().y)); this.m_lblRootVoiceTime.get_rectTransform().set_pivot(new Vector2(0f, 0.5f)); this.m_lblRootVoiceTime.get_rectTransform().set_anchoredPosition(new Vector2(rectTransform.get_sizeDelta().x + -125f, this.m_lblRootVoiceTime.get_rectTransform().get_anchoredPosition().y)); } } } else { this.m_normalMsg.SetActive(true); ResourceManager.SetSprite(this.m_spContentBg, ResourceManager.GetCodeSprite("talkframe_2")); RectTransform rectTransform3 = this.m_spContentBg.get_transform() as RectTransform; rectTransform3.set_pivot(new Vector2(1f, 1f)); rectTransform3.set_anchoredPosition(new Vector2(130f, rectTransform3.get_anchoredPosition().y)); this.m_sender.set_anchoredPosition(new Vector2(170f, this.m_sender.get_anchoredPosition().y)); this.m_lblSenderName.set_alignment(5); RectTransform rectTransform4 = this.m_lblSenderName.get_transform() as RectTransform; rectTransform4.set_pivot(new Vector2(1f, 0.5f)); rectTransform4.set_anchoredPosition(new Vector2(125f, rectTransform4.get_anchoredPosition().y)); this.m_rectVIP.set_pivot(new Vector2(1f, 0.5f)); this.m_rectVIP.set_anchoredPosition(new Vector2(rectTransform4.get_anchoredPosition().x - 4f, this.m_rectVIP.get_anchoredPosition().y)); this.m_rectVIP.GetComponent <HorizontalLayoutGroup>().set_padding(new RectOffset(0, 0, 0, 0)); this.m_rectVIP.GetComponent <HorizontalLayoutGroup>().set_childAlignment(2); this.m_rootContent.set_anchoredPosition(new Vector2(-190f + this.LINE_WIDTH - this.GetWidthOfContent(), this.m_rootContent.get_anchoredPosition().y)); this.m_rootVoice.get_gameObject().SetActive(isVoice); if (isVoice) { this.m_rootVoice.set_anchoredPosition(new Vector2(0f, this.m_rootVoice.get_anchoredPosition().y)); this.m_rootVoiceIcon.set_localEulerAngles(new Vector3(0f, 180f, 0f)); this.m_rootVoiceIcon.set_anchoredPosition(new Vector2(95f, this.m_rootVoiceIcon.get_anchoredPosition().y)); this.m_rootVoiceDOT.set_pivot(new Vector2(1f, 0.5f)); this.m_rootVoiceDOT.set_anchoredPosition(new Vector2(-rectTransform3.get_sizeDelta().x - -146f, this.m_rootVoiceDOT.get_anchoredPosition().y)); this.m_lblRootVoiceTime.get_rectTransform().set_pivot(new Vector2(1f, 0.5f)); this.m_lblRootVoiceTime.get_rectTransform().set_anchoredPosition(new Vector2(-rectTransform3.get_sizeDelta().x + 210f, this.m_lblRootVoiceTime.get_rectTransform().get_anchoredPosition().y)); } } }