为聊天剧情添加New红点提示

This commit is contained in:
fatiao 2026-02-12 15:10:49 +08:00
parent e5abf78435
commit ac60fc0d0a
8 changed files with 199 additions and 27 deletions

View File

@ -291,6 +291,61 @@ MonoBehaviour:
values: 00000100
depObjs: []
activeType: 0
--- !u!1 &2218810838454234261
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3123060890699439175}
- component: {fileID: 2093640082550837014}
m_Layer: 5
m_Name: RedPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3123060890699439175
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2218810838454234261}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6687152719982386823}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 373, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2093640082550837014
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2218810838454234261}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8759edc0b8b4b3d4aa8ffef2482e17ee, type: 3}
m_Name:
m_EditorClassIdentifier:
UIName:
keys:
- UnityEngine.RectTransform
- UINode
values: 0000
depObjs: []
activeType: 0
--- !u!1 &2257550954439659513
GameObject:
m_ObjectHideFlags: 0
@ -329,6 +384,7 @@ RectTransform:
- {fileID: 6209801716956461866}
- {fileID: 2733650791499288426}
- {fileID: 4400980047675270508}
- {fileID: 3123060890699439175}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}

View File

@ -293,7 +293,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE170',
['Type']=0,
['StoryNpcId']=0,
['MapLevel']=30001,
['MapLevel']=20031,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11},
['NeedBg']=false,
['HideUi']=false,
@ -311,7 +311,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE180',
['Type']=1,
['StoryNpcId']=202,
['MapLevel']=30006,
['MapLevel']=30001,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18},
['NeedBg']=false,
['HideUi']=false,
@ -329,7 +329,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE190',
['Type']=0,
['StoryNpcId']=0,
['MapLevel']=30011,
['MapLevel']=30006,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11},
['NeedBg']=false,
['HideUi']=false,
@ -347,7 +347,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE200',
['Type']=1,
['StoryNpcId']=203,
['MapLevel']=30016,
['MapLevel']=30011,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
['NeedBg']=false,
['HideUi']=false,
@ -365,7 +365,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE210',
['Type']=0,
['StoryNpcId']=0,
['MapLevel']=30021,
['MapLevel']=30016,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11,12,13},
['NeedBg']=false,
['HideUi']=false,
@ -383,7 +383,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE220',
['Type']=1,
['StoryNpcId']=203,
['MapLevel']=30026,
['MapLevel']=30021,
['StoryIntro']={1,2,3,4,5,6,7,8},
['NeedBg']=false,
['HideUi']=false,
@ -401,7 +401,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE230',
['Type']=0,
['StoryNpcId']=0,
['MapLevel']=30031,
['MapLevel']=30026,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11},
['NeedBg']=false,
['HideUi']=false,
@ -419,7 +419,7 @@ local StoryCfgV2 = {
['StoryTitle']='STITLE240',
['Type']=1,
['StoryNpcId']=201,
['MapLevel']=30036,
['MapLevel']=30031,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34},
['NeedBg']=false,
['HideUi']=false,
@ -436,7 +436,7 @@ local StoryCfgV2 = {
['StoryId']=250,
['Type']=0,
['StoryNpcId']=0,
['MapLevel']=40001,
['MapLevel']=30036,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11},
['NeedBg']=false,
['HideUi']=false,
@ -453,7 +453,7 @@ local StoryCfgV2 = {
['StoryId']=260,
['Type']=1,
['StoryNpcId']=201,
['MapLevel']=40006,
['MapLevel']=40001,
['StoryIntro']={1,2},
['NeedBg']=false,
['HideUi']=false,
@ -470,7 +470,7 @@ local StoryCfgV2 = {
['StoryId']=270,
['Type']=0,
['StoryNpcId']=0,
['MapLevel']=40011,
['MapLevel']=40006,
['StoryIntro']={1,2,3,4,5,6,7,8,9,10,11,12},
['NeedBg']=false,
['HideUi']=false,

View File

@ -726,56 +726,56 @@ local StoryRewardCfg = {
[18001]={
['Id']=18001,
['StoryId']=180,
['MapLevel']=30006,
['MapLevel']=30001,
['RewardType']=1,
['HeartReward']='202:5',
},
[18002]={
['Id']=18002,
['StoryId']=180,
['MapLevel']=30006,
['MapLevel']=30001,
['RewardType']=2,
['GiftReward']={{681,4}},
},
[20001]={
['Id']=20001,
['StoryId']=200,
['MapLevel']=30016,
['MapLevel']=30011,
['RewardType']=1,
['HeartReward']='203:8',
},
[20002]={
['Id']=20002,
['StoryId']=200,
['MapLevel']=30016,
['MapLevel']=30011,
['RewardType']=2,
['GiftReward']={{681,4}},
},
[22001]={
['Id']=22001,
['StoryId']=220,
['MapLevel']=30026,
['MapLevel']=30021,
['RewardType']=1,
['HeartReward']='203:8',
},
[22002]={
['Id']=22002,
['StoryId']=220,
['MapLevel']=30026,
['MapLevel']=30021,
['RewardType']=2,
['GiftReward']={{681,4}},
},
[24001]={
['Id']=24001,
['StoryId']=240,
['MapLevel']=30036,
['MapLevel']=30031,
['RewardType']=1,
['HeartReward']='201:5',
},
[24002]={
['Id']=24002,
['StoryId']=240,
['MapLevel']=30036,
['MapLevel']=30031,
['RewardType']=2,
['GiftReward']={{682,5}},
},

View File

@ -52,17 +52,17 @@ local StoryTaskCfgV2 = {
[11]={
['Id']=11,
['StoryId']=110,
['SubTasks']={{1,10028},{1,10029},{1,10030},},
['SubTasks']={{4,201},{1,10028},{1,10029},{1,10030},},
},
[12]={
['Id']=12,
['StoryId']=120,
['SubTasks']={{1,20001},{1,20002},{1,20003},{1,20004},{1,20005},{3,203}},
['SubTasks']={{1,20001},{1,20002},{1,20003},{1,20004},{1,20005},},
},
[13]={
['Id']=13,
['StoryId']=130,
['SubTasks']={{1,20006},{1,20007},{1,20008},{1,20009},{1,20010},},
['SubTasks']={{3,203},{1,20006},{1,20007},{1,20008},{1,20009},{1,20010},},
},
[14]={
['Id']=14,
@ -72,7 +72,7 @@ local StoryTaskCfgV2 = {
[15]={
['Id']=15,
['StoryId']=150,
['SubTasks']={{1,20016},{1,20017},{1,20018},{1,20019},{1,20020},},
['SubTasks']={{4,202},{1,20016},{1,20017},{1,20018},{1,20019},{1,20020},},
},
[16]={
['Id']=16,
@ -82,7 +82,62 @@ local StoryTaskCfgV2 = {
[17]={
['Id']=17,
['StoryId']=170,
['SubTasks']={{1,20026},{1,20027},{1,20028},{1,20029},{1,20030},},
['SubTasks']={{4,201},{1,20026},{1,20027},{1,20028},{1,20029},{1,20030},},
},
[18]={
['Id']=18,
['StoryId']=180,
['SubTasks']={{1,20031},{1,20032},{1,20033},{1,20034},{1,20035},},
},
[19]={
['Id']=19,
['StoryId']=190,
['SubTasks']={{4,202},{1,30001},{1,30002},{1,30003},{1,30004},{1,30005},},
},
[20]={
['Id']=20,
['StoryId']=200,
['SubTasks']={{1,30006},{1,30007},{1,30008},{1,30009},{1,30010},},
},
[21]={
['Id']=21,
['StoryId']=210,
['SubTasks']={{4,203},{1,30011},{1,30012},{1,30013},{1,30014},{1,30015},},
},
[22]={
['Id']=22,
['StoryId']=220,
['SubTasks']={{1,30016},{1,30017},{1,30018},{1,30019},{1,30020},},
},
[23]={
['Id']=23,
['StoryId']=230,
['SubTasks']={{4,203},{1,30021},{1,30022},{1,30023},{1,30024},{1,30025},},
},
[24]={
['Id']=24,
['StoryId']=240,
['SubTasks']={{1,30026},{1,30027},{1,30028},{1,30029},{1,30030},},
},
[25]={
['Id']=25,
['StoryId']=250,
['SubTasks']={{4,201},{1,30031},{1,30032},{1,30033},{1,30034},{1,30035},},
},
[26]={
['Id']=26,
['StoryId']=260,
['SubTasks']={{1,30036},{1,30037},{1,30038},{1,30039},{1,30040},},
},
[27]={
['Id']=27,
['StoryId']=270,
['SubTasks']={{4,201},{1,40001},{1,40002},{1,40003},{1,40004},{1,40005},},
},
[28]={
['Id']=28,
['StoryId']=280,
['SubTasks']={{1,40006},{1,40007},{1,40008},{1,40009},{1,40010},},
},
}
return StoryTaskCfgV2

View File

@ -63,6 +63,7 @@
---@field private c9 ChatTabItem__Generate_c9
---@field private title ChatTabItem__Generate_title
---@field private subTitle ChatTabItem__Generate_subTitle
---@field private redPoint UnityEngine.GameObject
local ChatTabItemView = class("ChatTabItemView")
function ChatTabItemView:ctor()
@ -92,6 +93,7 @@ function ChatTabItemView:InitGenerate(Root, data)
self:InitGenerate__11(Root,data)
self:InitGenerate__12(Root,data)
self:InitGenerate__13(Root,data)
self:InitGenerate__14(Root,data)
end
@ -275,6 +277,18 @@ function ChatTabItemView:InitGenerate__13(Root, data)
tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
end
---@private
function ChatTabItemView:InitGenerate__14(Root, data)
--[[
RedPoint
--]]
local tmp = Root:Find("RedPoint").gameObject
if tolua.getpeer(tmp) == nil then
tolua.setpeer(tmp, {})
end
self.redPoint = tmp
end
---@private
function ChatTabItemView:GenerateDestroy()
if tolua.getpeer(self.headIcons) ~= nil then
@ -325,6 +339,10 @@ function ChatTabItemView:GenerateDestroy()
tolua.setpeer(self.subTitle, nil)
end
self.subTitle = nil
if tolua.getpeer(self.redPoint) ~= nil then
tolua.setpeer(self.redPoint, nil)
end
self.redPoint = nil
self.transform = nil
self.gameObject = nil
self.inited = false

View File

@ -423,7 +423,6 @@ function UIBattleView:InitMinimapGoes()
end
function UIBattleView:RefreshStoryTaskInfo()
-- 先获取当前关卡再查找当前关卡对应的StoryId通过StoryId分析出当前Story和接下来2个Story
-- 获取到了当前Story再分析出当前Story的进度信息
local curMapId, curLevelId = ManagerContainer.LuaBattleMgr:GetCurMapAndLevel()
@ -503,8 +502,13 @@ function UIBattleView:RefreshStoryTaskInfo()
isFinish = true
end
elseif t == 4 then
local curLv = ManagerContainer.DataMgr.UserData:GetRoleLv()
if curLv > val then
local storyNpcId = val
local storyNpcCfg = ManagerContainer.CfgMgr:GetStoryNpcCfgByChatNpcId(tonumber(storyNpcId))
txt = string.format("回复【%s】发来的消息", I18N.T(storyNpcCfg.NameKey))
local currLevelData = ManagerContainer.CfgMgr:GetLevelDataById(mapLevel)
local storyId = currLevelData.DlgId
LogError("[RefreshStoryTaskInfo] mapLevel="..mapLevel..", storyId="..storyId)
if ManagerContainer.DataMgr.StoryData:IsStoryPlay(storyId) then
isFinish = true
end
elseif t == 5 then

View File

@ -921,6 +921,9 @@ function UIChatView:SetChatTabItem(itemLua, idx, itemData)
itemLua.headIcons.gridLayoutGroup.cellSize = Vector2(40, 40)
end
self.uiBase:AddButtonUniqueEventListener(itemLua.button, self, self.OnClickChatItem, itemLua, itemData)
if itemData.channelId == CONST_CHANNEL_STORY then
CommonUtil.CreateNewRedPoint(itemLua.redPoint, function(rp) end)
end
end

View File

@ -3121,3 +3121,39 @@ function CurrLevelHasStory()
return false
end
end
function CreateNormalRedPoint(parent, cb)
if parent.transform.childCount >= 1 then
cb(parent.transform:GetChild(0))
return
end
AW.async(function()
local redPoint = AW.await(ManagerContainer.ResMgr:LuaGetGoFromPoolAsync(Constants.UICommonPath, "UIRedPointRP"))
if redPoint then
redPoint.transform:SetParent(parent.transform)
redPoint.transform.localPosition = Vector3.zero
redPoint.transform.localRotation = Quaternion.identity
redPoint.transform.localScale = Vector3.one
redPoint:SetActive(true)
cb(redPoint)
end
end)
end
function CreateNewRedPoint(parent, cb)
if parent.transform.childCount >= 1 then
cb(parent.transform:GetChild(0))
return
end
AW.async(function()
local redPoint = AW.await(ManagerContainer.ResMgr:LuaGetGoFromPoolAsync(Constants.UICommonPath, "UINewRP"))
if redPoint then
redPoint.transform:SetParent(parent.transform)
redPoint.transform.localPosition = Vector3.zero
redPoint.transform.localRotation = Quaternion.identity
redPoint.transform.localScale = Vector3.one
redPoint:SetActive(true)
cb(redPoint)
end
end)
end