UIChat
This commit is contained in:
parent
6ca66fd8bc
commit
c2d3a4f949
@ -137,10 +137,13 @@ function CfgMgr:ctor()
|
||||
self.CompetitionAidouluCfg = InternalRequire("CompetitionAidouluCfg") --偶像祭宝奖励箱表
|
||||
|
||||
self.TaskCfgV2 = InternalRequire("TaskCfgV2")
|
||||
self.StoryNpcCfg = InternalRequire("StoryNpcCfg")
|
||||
self.StoryNpcCfgV2 = InternalRequire("StoryNpcCfgV2")
|
||||
self.StoryRewardCfg = InternalRequire("StoryRewardCfg")
|
||||
|
||||
self.ChatGiftCfg = InternalRequire("ChatGiftCfg")
|
||||
self.ChatDateCfg = InternalRequire("ChatDateCfg")
|
||||
self.ChatPhotoCfg = InternalRequire("ChatPhotoCfg")
|
||||
|
||||
end
|
||||
|
||||
-- function CfgMgr:GetEvilLevelCfg(id)
|
||||
@ -181,6 +184,10 @@ function CfgMgr:GetTaskCfgV2()
|
||||
return self.TaskCfgV2
|
||||
end
|
||||
|
||||
function CfgMgr:GetStoryRewardCfg(id)
|
||||
return self.StoryRewardCfg[id]
|
||||
end
|
||||
|
||||
function CfgMgr:GetTaskCfgV2ByMapLv(mapLv)
|
||||
local currTaskCfgs = {}
|
||||
local nextTaskCfgs = {}
|
||||
@ -204,12 +211,12 @@ function CfgMgr:GetTaskCfgV2ByMapLv(mapLv)
|
||||
end
|
||||
|
||||
function CfgMgr:GetStoryNpcCfg()
|
||||
return self.StoryNpcCfg
|
||||
return self.StoryNpcCfgV2
|
||||
end
|
||||
function CfgMgr:GetStoryNpcCfgByChatNpcId(chatNpcId)
|
||||
local cfg = nil
|
||||
for k, v in pairs(self.StoryNpcCfg) do
|
||||
if v.ChatNpcId == chatNpcId then
|
||||
for k, v in pairs(self.StoryNpcCfgV2) do
|
||||
if v.StoryNpcId == chatNpcId then
|
||||
cfg = v
|
||||
break
|
||||
end
|
||||
@ -218,7 +225,7 @@ function CfgMgr:GetStoryNpcCfgByChatNpcId(chatNpcId)
|
||||
end
|
||||
function CfgMgr:GetStoryNpcCfgIn(recordStoryIdList)
|
||||
local cfgs = {}
|
||||
for k, v in ipairs(self.StoryNpcCfg) do
|
||||
for k, v in ipairs(self.StoryNpcCfgV2) do
|
||||
local isIn = false
|
||||
local storyId = v['StoryId']
|
||||
for kk, vv in pairs(recordStoryIdList) do
|
||||
@ -235,7 +242,7 @@ function CfgMgr:GetStoryNpcCfgIn(recordStoryIdList)
|
||||
end
|
||||
function CfgMgr:GetStoryNpcCfgNotIn(recordStoryIdList)
|
||||
local cfgs = {}
|
||||
for k, v in ipairs(self.StoryNpcCfg) do
|
||||
for k, v in ipairs(self.StoryNpcCfgV2) do
|
||||
local isIn = false
|
||||
local storyId = v['StoryId']
|
||||
for kk, vv in pairs(recordStoryIdList) do
|
||||
@ -244,7 +251,7 @@ function CfgMgr:GetStoryNpcCfgNotIn(recordStoryIdList)
|
||||
break
|
||||
end
|
||||
end
|
||||
if isIn == false then
|
||||
if isIn == false and v['Type'] >= 1 then
|
||||
table.insert(cfgs, v)
|
||||
end
|
||||
end
|
||||
@ -253,7 +260,7 @@ end
|
||||
function CfgMgr:GetStoryNpcCfgByMapLevel(map, level)
|
||||
local mapLevel = map*10000 + level
|
||||
local cfgs = {}
|
||||
for k, v in ipairs(self.StoryNpcCfg) do
|
||||
for k, v in ipairs(self.StoryNpcCfgV2) do
|
||||
if v['MapLevel'] <= mapLevel then
|
||||
table.insert(cfgs, v)
|
||||
end
|
||||
|
||||
@ -149,7 +149,13 @@ function ChatContentItemCtr:SetData(wnd, itemLua, itemData, enterType, onClickOw
|
||||
itemLua.rightNode:SetActive(false)
|
||||
itemLua.centerNode:SetActive(true)
|
||||
local contentStr = itemData.message.message
|
||||
contentStr = "好感度+2"
|
||||
local rewardId = tonumber(contentStr:match("%[heart%-(%d+)%]"))
|
||||
local storyRewardCfg = ManagerContainer.CfgMgr:GetStoryRewardCfg(rewardId)
|
||||
local strs = string.split(storyRewardCfg.HeartReward, ':')
|
||||
local storyNpcId = strs[1]
|
||||
local addHeart = strs[2]
|
||||
local storyNpcCfg = ManagerContainer.CfgMgr:GetStoryNpcCfgByChatNpcId(tonumber(storyNpcId))
|
||||
contentStr = string.format("%s对您好感度+%d", I18N.T(storyNpcCfg.NameKey), tonumber(addHeart))
|
||||
local currContentNode = itemLua.centerNode.contentText
|
||||
currContentNode.chatText.symbolText.text = contentStr
|
||||
local length = 40 + StringUtil.GetTextLeng(currContentNode.chatText.symbolText, contentStr)
|
||||
|
||||
@ -874,12 +874,12 @@ function UIChatView:SetSearchTabItem(itemLua, idx, itemData)
|
||||
isUnlock = true
|
||||
end
|
||||
|
||||
itemLua.name.text.text = itemData['Name']
|
||||
itemLua.location.text.text = itemData['Location']
|
||||
itemLua.name.text.text = I18N.T(itemData['Name'])
|
||||
itemLua.location.text.text = I18N.T(itemData['Location'])
|
||||
itemLua.age.text.text = itemData['Age']
|
||||
itemLua.nation.text.text = itemData['Nation']
|
||||
itemLua.marry.text.text = itemData['Marry']
|
||||
itemLua.post.text.text = itemData['Post']
|
||||
itemLua.nation.text.text = I18N.T(itemData['Nation'])
|
||||
itemLua.marry.text.text = I18N.T(itemData['Marry'])
|
||||
itemLua.post.text.text = I18N.T(itemData['Post'])
|
||||
itemLua.upVote.text.text = itemData['Upvote']
|
||||
itemLua.commentNum.text.text = itemData['Comment']
|
||||
--itemLua.headItem.levelText:SetActive(false)
|
||||
@ -1131,6 +1131,9 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
|
||||
["uid"] = channelId
|
||||
}
|
||||
self.currChatData.chats = ManagerContainer.DataMgr.ChatData:GetWorldChatDatas()
|
||||
if self.currChatData.fromData then
|
||||
self.chatLayer2.titleBarText.text.text = self.currChatData.fromData.nickname
|
||||
end
|
||||
|
||||
-- guild chat
|
||||
elseif channelId == CONST_CHANNEL_GUILD then
|
||||
@ -1145,6 +1148,9 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
|
||||
["uid"] = channelId
|
||||
}
|
||||
self.currChatData.chats = ManagerContainer.DataMgr.ChatData:GetGuildChatDatas()
|
||||
if self.currChatData.fromData then
|
||||
self.chatLayer2.titleBarText.text.text = self.currChatData.fromData.nickname
|
||||
end
|
||||
|
||||
-- story chat
|
||||
elseif channelId == CONST_CHANNEL_STORY then
|
||||
@ -1178,6 +1184,9 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
|
||||
break
|
||||
end
|
||||
end
|
||||
if self.currChatData.fromData then
|
||||
self.chatLayer2.titleBarText.text.text = self.currChatData.fromData.nickname
|
||||
end
|
||||
end
|
||||
|
||||
-- table.insert(chatData.chats, {
|
||||
@ -1191,9 +1200,6 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
|
||||
-- subType = 7
|
||||
-- }
|
||||
-- })
|
||||
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
|
||||
@ -1214,8 +1220,10 @@ function UIChatView:PlayAddHeartAnimation(storyNpcId, heart, addHeart)
|
||||
end
|
||||
|
||||
function UIChatView:RefreshTitleForStoryNpc(storyNpcId)
|
||||
local storyNpcCfg = ManagerContainer.CfgMgr:GetStoryNpcCfgByChatNpcId(tonumber(storyNpcId))
|
||||
local heart = ManagerContainer.DataMgr.StoryData:GetStoryNpcHeart(storyNpcId)
|
||||
self.chatLayer2.heartNum.text.text = heart
|
||||
self.chatLayer2.titleBarText.text.text = I18N.T(storyNpcCfg.NameKey)
|
||||
end
|
||||
|
||||
-- itemData format:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user