【聊天】聊天框根据内容跳转到不同的频道

dev_chengFeng
gaoxin 2021-07-30 14:07:08 +08:00
parent aece2194b5
commit 5aadeb406b
1 changed files with 18 additions and 4 deletions

View File

@ -31,11 +31,23 @@ end
--绑定事件(用于子类重写)
function ChatTipView:BindEvent()
Util.AddClick(self.btn, function()
if self._ViewType == VIEW_TYPE.MAIN then
UIManager.OpenPanel(UIName.ChatPanel)
elseif self._ViewType == VIEW_TYPE.GUILD then
UIManager.OpenPanel(UIName.ChatPanel, 2, 2)
local jumpType = 1
if self._ViewType == VIEW_TYPE.GUILD then
jumpType = 2
end
local tabIndex = 3
if not self.channel then
tabIndex = 3
elseif self.channel == CHAT_CHANNEL.SYSTEM then
tabIndex = 5
elseif self.channel == CHAT_CHANNEL.FAMILY then
tabIndex = 2
elseif self.channel == CHAT_CHANNEL.GLOBAL then
tabIndex = 3
elseif self.channel == CHAT_CHANNEL.JUMP_SERVER then
tabIndex = 4
end
UIManager.OpenPanel(UIName.ChatPanel, tabIndex, jumpType)
end)
Util.AddClick(self.redPackage,function()
UIManager.OpenPanel(UIName.RedPacketPanel,3)
@ -101,8 +113,10 @@ function ChatTipView:RefreshChatShow()
local chat = ChatManager.AnalysisGlobalChat(msg.chat.msg)
content = string.format("[跨服]%s%s", msg.chat.senderName, chat.content)
end
self.channel = msg.channel
end
self.content.text = content
end
-- 开始聊天数据刷新