private void SendMessageToBulletCurtain(int srcChannel, ChatManager.ChatInfo chatInfo) { if (srcChannel != 8 && srcChannel != 64) { BulletCurtainManager.Instance.Add2BulletCurtain(chatInfo); } }
public void Add2BulletCurtain(ChatManager.ChatInfo chatInfo) { if (this.CheckIsBulletCurtainOn(chatInfo.src_channel)) { this.BulletCurtainNews.Add(chatInfo); } }
private void UpdateTeamChatTip(ChatManager.ChatInfo chatInfo) { if (!base.get_gameObject().get_activeInHierarchy()) { return; } Transform transform = base.FindTransform("TeamTalkToot"); int num = 0; if (chatInfo != null && this.m_memberResume.roleId == chatInfo.sender_uid) { if (transform.get_childCount() > num) { transform.GetChild(num).get_gameObject().SetActive(true); ChatInfoBase component = transform.GetChild(num).GetComponent <ChatInfo2Bubble>(); if (component != null) { component.Clear(); component.ShowInfo(chatInfo); } } else { GameObject chatInfo2Bubble = ChatManager.Instance.GetChatInfo2Bubble(chatInfo, transform); chatInfo2Bubble.set_name("chatInfoBubble"); chatInfo2Bubble.get_transform().set_localPosition(Vector3.get_zero()); } num++; } for (int i = num; i < transform.get_childCount(); i++) { GameObject gameObject = transform.GetChild(i).get_gameObject(); gameObject.SetActive(false); } }
public void SetChat(ChatManager.ChatInfo chatInfo, Action callback) { this.FONT_SIZE = this.GetRandomFontSize(); this.m_srcChannel = chatInfo.src_channel; this.ShowInfo(chatInfo); this.ResetAll(); this.m_BaseTweenPostion.MoveTo(new Vector3(this.GetEndPosX(), base.get_transform().get_localPosition().y, 0f), this.GetRandomSpeed(), callback); }
public void AddToChatList(ChatManager.ChatInfo chatInfo) { if (this.teamChatList != null && chatInfo != null) { this.teamChatList.Add(chatInfo); this.HandleToShowFirstChat(); } }
public static int GetVoiceTime(ChatManager.ChatInfo chatInfo) { if (chatInfo.items.get_Count() > 0 && !string.IsNullOrEmpty(chatInfo.items.get_Item(0).label)) { return(int.Parse(chatInfo.items.get_Item(0).label)); } return(0); }
private void Add2ChatTipUI(int dstChannels, ChatManager.ChatInfo chatInfo) { for (int i = 0; i < ChannelBit.all_channelviews.Length; i++) { if (ChannelBit.IsContainChannel(dstChannels, ChannelBit.all_channelviews[i]) && !this.CheckIsChannelMaskOn(ChannelBit.all_channelviews[i])) { ChatTipUIViewModel.AddChat(chatInfo); return; } } }
public GameObject GetChatInfo2Bubble(ChatManager.ChatInfo chatInfo, Transform chatParent = null) { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("ChatInfo2Bubble"); if (chatParent != null) { instantiate2Prefab.get_transform().SetParent(chatParent); } instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one()); ChatInfoBase component = instantiate2Prefab.GetComponent <ChatInfo2Bubble>(); component.ShowInfo(chatInfo); return(instantiate2Prefab); }
private void Add2ChatUI(int dstChannels, ChatManager.ChatInfo chatInfo) { for (int i = 0; i < ChannelBit.all_channelviews.Length; i++) { if (ChannelBit.IsContainChannel(dstChannels, ChannelBit.all_channelviews[i])) { this.ChatNews.get_Item(ChannelBit.all_channelviews[i]).Add(chatInfo); if (ChannelBit.all_channelviews[i] == 4) { this.CheckPrivateBadge(); } } } }
private string GetBroadcastContent(ChatManager.ChatInfo chatInfo) { string channelNameWithColor = ChatManager.GetChannelNameWithColor(chatInfo.src_channel); string text = string.Empty; if (!string.IsNullOrEmpty(chatInfo.sender_name)) { text = TextColorMgr.GetColorByID(chatInfo.sender_name + ":", 209); } string text2 = channelNameWithColor + text; string text3 = this.BroadcastContentSplit(chatInfo.chat_content, chatInfo.items); return(text2 + text3); }
public static void AddChat(ChatManager.ChatInfo chatInfo) { ChatManager.ChatInfo chatInfo2 = chatInfo; if (chatInfo.src_channel == 2 && chatInfo.sender_uid <= 0L) { for (int i = 0; i < chatInfo.items.get_Count(); i++) { DetailInfo detailInfo = chatInfo.items.get_Item(i); if (detailInfo.type == DetailType.DT.GuildQuestionNotice) { return; } if (detailInfo.type == DetailType.DT.GuildQuestion) { string[] array = chatInfo.chat_content.Split(new char[] { '|' }); if (i == 0 && array.Length > 0) { chatInfo2 = new ChatManager.ChatInfo(); chatInfo2.chat_type = chatInfo.chat_type; chatInfo2.sender_uid = chatInfo.sender_uid; chatInfo2.src_channel = chatInfo.src_channel; chatInfo2.sender_occupation = chatInfo.sender_occupation; chatInfo2.viplevel = chatInfo.viplevel; chatInfo2.time = chatInfo.time; chatInfo2.module = chatInfo.module; chatInfo2.items = chatInfo.items; chatInfo2.sender_name = string.Format("第{0}题", array[0]); chatInfo2.chat_content = array[1]; } } } } if (ChatTipUIViewModel.chatNews.get_Count() >= 4) { ChatTipUIViewModel.chatNews.RemoveAt(0); } ChatTipUIViewModel.chatNews.Add(chatInfo2); if (ChatTipUIView.Instance != null && ChatTipUIView.Instance.get_gameObject() != null && ChatTipUIView.Instance.get_gameObject().get_activeInHierarchy()) { ChatTipUIView.Instance.RefreshChats(ChatTipUIViewModel.chatNews); } else { ChatTipUIViewModel.IsNeedRefresh = true; } }
public void SetButton2Touch(ChatManager.ChatInfo chatInfo, Transform parent, DetailInfo detailInfo, Action callback = null) { this.m_chatInfo = chatInfo; UGUITools.ResetTransform(this.m_myRectTransform, parent); this.m_myRectTransform.set_anchorMin(new Vector2(0f, 0.5f)); this.m_myRectTransform.set_anchorMax(new Vector2(0f, 0.5f)); this.m_myRectTransform.set_pivot(new Vector2(0f, 1f)); if (this.m_button2Collider == null) { this.m_button2Collider = this.m_myRectTransform.get_gameObject().AddComponent <Button>(); } this.m_button2Collider.set_transition(0); this.m_button2Collider.get_onClick().AddListener(new UnityAction(this.OnButtonClick)); this.m_action2Click = callback; this.m_detailInfo = detailInfo; }
private void AddNews2Chats(int channel) { List <ChatManager.ChatInfo> list = ChatManager.Instance.ChatNews.get_Item(channel); for (int i = 0; i < list.get_Count(); i++) { ChatManager.ChatInfo chatInfo = list.get_Item(i); ChatUIView.Instance.AddChatNew(channel, chatInfo); List <ChatManager.ChatInfo> list2 = ChatManager.Instance.Chats.get_Item(channel); if (list2.get_Count() > 0 && list2.get_Count() >= ChatManager.MAX_CHAT_SHOWNUM) { list2.RemoveAt(0); } list2.Add(chatInfo); } ChatManager.Instance.ChatNews.get_Item(channel).Clear(); }
private void JustShowInfo(ChatManager.ChatInfo chatInfo) { this.m_chatInfo = chatInfo; this.SenderUID = chatInfo.sender_uid; this.SenderName = chatInfo.sender_name; this.SetSenderIcon(chatInfo.src_channel, chatInfo.sender_occupation); this.SetVIP(chatInfo.viplevel); string channelNameWithColor = ChatManager.GetChannelNameWithColor(chatInfo.src_channel); string senderName = this.GetSenderName(chatInfo.src_channel, chatInfo.sender_name); this.SetSenderName(senderName, chatInfo.time, chatInfo.viplevel); string previous = channelNameWithColor + senderName; if (ChatManager.IsVoice(chatInfo)) { this.SetContent(channelNameWithColor, senderName, chatInfo.chat_content, chatInfo.time); return; } string text = this.GetContent(); text = this.DealPlaceholder(previous, text, chatInfo.items); for (int i = this.PlaceholderIndex; i < chatInfo.items.get_Count(); i++) { DetailInfo detailInfo = chatInfo.items.get_Item(i); if (detailInfo.type == DetailType.DT.Equipment) { Items items = DataReader <Items> .Get(detailInfo.cfgId); if (items != null) { string detailInfoName = ChatManager.GetDetailInfoName(detailInfo); this.ButtonItem(text, detailInfo, detailInfoName); text += detailInfoName; } } } text = this.GetContentTextInColor(text); this.SetContent(channelNameWithColor, senderName, text, chatInfo.time); this.ButtonSender(channelNameWithColor, senderName); this.SettingSuccess(); }
public void AddChat2Channel(ChatManager.ChatInfo chatInfo) { this.CheckNums(); ChatInfoBase chatInfoBase = ChatManager.CreatePrefab2ChannelChatInfo("_ChatItem" + this.m_listChats.get_Count()); UGUITools.ResetTransform(chatInfoBase.get_transform(), this.m_rChannelChatsOffset); chatInfoBase.get_transform().set_localPosition(new Vector3(0f, this.CalHeight4Chats(this.m_listChats.get_Count()), 0f)); chatInfoBase.ShowInfo(chatInfo); this.m_listChats.Add(chatInfoBase); this.m_rChannelChats.set_sizeDelta(new Vector2(0f, Mathf.Abs(this.CalHeight4Chats(this.m_listChats.get_Count())))); this.SetContentPos(); if (chatInfo.sender_uid == EntityWorld.Instance.EntSelf.ID) { this.OnBtnlockClick(null); } else if (this.Islock) { this.NewNum++; this.ShowLock(true); } }
public void ServerStringReceive(string msg) { int dstChannels = ChannelBit.GetDstChannels(8, 0L); ChatManager.ChatInfo chatInfo = this.GetChatInfo(64, dstChannels, new TalkMsg { content = new ArticleContent(), content = { text = msg } }); chatInfo.viplevel = -1; chatInfo.sender_uid = -1L; chatInfo.sender_occupation = 0; chatInfo.items = new List <DetailInfo>(); chatInfo.time = this.GetServerTimeString(TimeManager.Instance.PreciseServerTime); this.Add2ChatUI(dstChannels, chatInfo); this.Add2ChatTipUI(dstChannels, chatInfo); this.RefreshCurrentChatChannel(); }
private void PopOne() { if (this.BulletCurtainNews.get_Count() > 0) { ChatManager.ChatInfo chatInfo = this.BulletCurtainNews.get_Item(0); this.BulletCurtainNews.RemoveAt(0); if (this.CheckIsBulletCurtainOn(chatInfo.src_channel)) { ChatInfo2BulletCurtain gridUI = this.CreatePrefab2BulletCurtain(); this.BulletCurtainUnits.Add(gridUI); gridUI.SetChat(chatInfo, delegate { this.BulletCurtainUnits.Remove(gridUI); this.Reuse2BulletCurtains(gridUI); }); } else { this.PopOne(); } } }
private ChatManager.ChatInfo GetChatInfo(int srcChannel, int dstChannels, TalkMsg talkMsg) { ChatManager.ChatInfo chatInfo = new ChatManager.ChatInfo(); chatInfo.src_channel = srcChannel; if (talkMsg.sender != null) { chatInfo.sender_name = talkMsg.sender.label; chatInfo.sender_uid = talkMsg.sender.id; chatInfo.chat_type = talkMsg.sender.type; chatInfo.sender_occupation = talkMsg.sender.icon; chatInfo.viplevel = (int)talkMsg.sender.num; } chatInfo.chat_content = talkMsg.content.text; chatInfo.items = talkMsg.content.items; chatInfo.module = this.ApplyTeamInvite(talkMsg.content.text); chatInfo.time = this.GetServerTimeString(TimeManager.Instance.CalculateLocalServerTimeBySecond(talkMsg.time)); if (srcChannel == 4 && chatInfo.sender_uid == EntityWorld.Instance.EntSelf.ID) { chatInfo.sender_name = "@" + ((talkMsg.receiver == null) ? "NONE" : talkMsg.receiver.label); } return(chatInfo); }
private void Add2Channels(int srcChannel, int dstChannels, TalkMsg talkMsg) { ChatManager.ChatInfo chatInfo = this.GetChatInfo(srcChannel, dstChannels, talkMsg); if (chatInfo.sender_uid <= 0L) { chatInfo.sender_name = TextColorMgr.GetColor("系统消息", "AA0A00", string.Empty); } if (srcChannel == 32) { EventDispatcher.Broadcast <ChatManager.ChatInfo>("ChatManager.TeamMessage", chatInfo); } if (ChatManager.IsVoice(chatInfo)) { this.Add2ChatUI(dstChannels, chatInfo); this.Add2ChatTipUI(dstChannels, chatInfo); } else { this.SendMessageToBulletCurtain(srcChannel, chatInfo); this.Add2ChatUI(dstChannels, chatInfo); this.Add2ChatTipUI(dstChannels, chatInfo); } }
public virtual void ShowInfo(ChatManager.ChatInfo chatInfo) { this.JustShowInfo(chatInfo); }
public void AddChatNew(int dstChannel, ChatManager.ChatInfo chatInfo) { this.m_ChatChannelViews.get_Item(dstChannel).AddChat2Channel(chatInfo); }
public static bool IsVoice(ChatManager.ChatInfo chatInfo) { return(chatInfo.items.get_Count() == 1 && chatInfo.items.get_Item(0).type == DetailType.DT.Audio); }