UIChat:世界聊天为空的情况

This commit is contained in:
fatiao 2025-11-05 10:15:25 +08:00
parent 2ac08c11d3
commit 430ef3c6d7

View File

@ -718,15 +718,21 @@ function UIChatView:RefreshMessageTab()
end
if #worldHeadIcons >= 9 then break end
end
local worldTitle = "世界"
local worldSubTitle = "给世界发一条消息吧!"
if #worldHeadIcons > 0 then
table.insert(chatTabDataList, {
chatType = ChatType.Group,
channelId = CONST_CHANNEL_WORLD,
title = "世界",
headIcons = worldHeadIcons,
subTitle = worldChats[#worldChats].fromData.nickname..": "..worldChats[#worldChats].message.message,
})
worldSubTitle = worldChats[#worldChats].fromData.nickname..": "..worldChats[#worldChats].message.message
else
worldHeadIcons = {"Heads/head_100102"}
end
table.insert(chatTabDataList, {
chatType = ChatType.Group,
channelId = CONST_CHANNEL_WORLD,
title = worldTitle,
headIcons = worldHeadIcons,
subTitle = worldSubTitle
})
-------------------------- 2. 公会群聊 --------------------------
local guildChats = ManagerContainer.DataMgr.ChatData:GetGuildChatDatas()
@ -1093,6 +1099,7 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
-- private chat
else
self.currChatData.chats = {}
local privateChats = ManagerContainer.DataMgr.ChatData:GetPrivateSortChatDatas()
for k, v in pairs(privateChats) do
if v.fromData.uid == channelId then
@ -1113,7 +1120,9 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
-- subType = 7
-- }
-- })
self.chatLayer2.titleBarText.text.text = self.currChatData.fromData.nickname
if self.currChatData.fromData then
self.chatLayer2.titleBarText.text.text = self.currChatData.fromData.nickname
end
local datas = self.currChatData.chats
local max = datas and #datas or 0