Update - 1.9.0.103
EN: 1.9.0.103 CN: 1.9.0.104 JP: 1.9.0.106 KR: 1.9.0.108
This commit is contained in:
@@ -292,7 +292,9 @@ function ChapterLineCtrl:RefreshBranchGrid(root, avgId, depth, isNeedPlayUnlockA
|
||||
if bUnlock then
|
||||
bHasUnlockBranch = true
|
||||
end
|
||||
table.insert(self.tbLockedBranchGrid, avgId)
|
||||
if table.indexof(self.tbLockedBranchGrid, avgId) <= 0 then
|
||||
table.insert(self.tbLockedBranchGrid, avgId)
|
||||
end
|
||||
if bUnlock and table.indexof(self.tbLockedBranchGrid, avgId) > 0 then
|
||||
table.removebyvalue(self.tbLockedBranchGrid, avgId)
|
||||
end
|
||||
@@ -350,6 +352,13 @@ function ChapterLineCtrl:RefreshBranchGrid(root, avgId, depth, isNeedPlayUnlockA
|
||||
index = index + 1
|
||||
end
|
||||
root.gameObject:SetActive(bHasUnlockBranch)
|
||||
if bHasUnlockBranch then
|
||||
if not isNeedPlayUnlockAnim then
|
||||
self:PlayUnlockAnim(root, "BranchRoot_loop" .. #self.tbBranch[avgId])
|
||||
else
|
||||
self:PlayUnlockAnim(root, "BranchRoot_Empty")
|
||||
end
|
||||
end
|
||||
end
|
||||
function ChapterLineCtrl:RefreshTimeStamp(goTimeStamp, index)
|
||||
local timeStampName
|
||||
@@ -528,11 +537,7 @@ function ChapterLineCtrl:PlayNormalNodeUnlockAnim(nodeInfo, depth)
|
||||
end, true, true, true)
|
||||
end
|
||||
function ChapterLineCtrl:PlayBranchNodeUnlockAnim(nodeInfo, depth)
|
||||
if nodeInfo.totalCount > 1 then
|
||||
self:PlayUnlockAnim(nodeInfo.grid, "BranchRoot_in3")
|
||||
else
|
||||
self:PlayUnlockAnim(nodeInfo.grid, "BranchRoot_in" .. nodeInfo.index)
|
||||
end
|
||||
self:PlayUnlockAnim(nodeInfo.grid, "BranchRoot_in" .. nodeInfo.totalCount)
|
||||
WwiseAudioMgr:PostEvent("ui_mainline_newending")
|
||||
local storyConfig = AvgData:GetStoryCfgData(nodeInfo.avgId)
|
||||
LocalData.SetPlayerLocalData("MainlineUnlock_" .. storyConfig.Id, 1)
|
||||
|
||||
@@ -107,31 +107,21 @@ function StoryChapterCtrl:OnEnable()
|
||||
end
|
||||
function StoryChapterCtrl:OnDisable()
|
||||
end
|
||||
function StoryChapterCtrl:RefreshChapterList(grid, index)
|
||||
index = index + 1
|
||||
function StoryChapterCtrl:RefreshChapterGrid(grid, index)
|
||||
local chapterData = self.tbAllChapter[index]
|
||||
if chapterData == nil then
|
||||
return
|
||||
end
|
||||
local trans = grid.transform:Find("btn/AnimRoot")
|
||||
local trans = grid.transform:Find("AnimRoot")
|
||||
local imgBg = trans:Find("imgBg"):GetComponent("Image")
|
||||
local txtIndex = trans:Find("txtIndex"):GetComponent("TMP_Text")
|
||||
if chapterData.Type == GameEnum.chapterType.Mainline then
|
||||
local txtIndex = trans:Find("txtIndex"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(txtIndex, chapterData.Index)
|
||||
end
|
||||
local txtChapterIndex = trans:Find("imgTitle1/txtChapterIndex"):GetComponent("TMP_Text")
|
||||
local goUnlock = trans:Find("goUnlock")
|
||||
local goLock = trans:Find("goLock")
|
||||
local txtTitle = goUnlock:Find("txtTitle"):GetComponent("TMP_Text")
|
||||
local txtIndexTitle = goUnlock:Find("txtIndexTitle"):GetComponent("TMP_Text")
|
||||
local aniTrans = trans:GetComponent("Animator")
|
||||
local ChapterRedDot = trans:Find("ChapterRedDot")
|
||||
local goFXChapterList = trans:Find("FXChapterList")
|
||||
local nInstanceID = grid:GetInstanceID()
|
||||
if not self.tbGridCtrl[nInstanceID] then
|
||||
self.tbGridCtrl[nInstanceID] = {
|
||||
Id = chapterData.Id,
|
||||
aniTrans = aniTrans
|
||||
}
|
||||
end
|
||||
RedDotManager.RegisterNode(RedDotDefine.Map_MainLine_Chapter, chapterData.Id, ChapterRedDot, nil, nil, true)
|
||||
if self.bInitLoop and self.nCompletedChapter < 0 and self.nRecentChapterId <= 3 then
|
||||
if index <= 5 then
|
||||
if index == 1 then
|
||||
@@ -147,7 +137,6 @@ function StoryChapterCtrl:RefreshChapterList(grid, index)
|
||||
else
|
||||
aniTrans:Play("StoryChapter_chapter_defaut")
|
||||
end
|
||||
NovaAPI.SetTMPText(txtIndex, chapterData.Index)
|
||||
NovaAPI.SetTMPText(txtChapterIndex, chapterData.Name)
|
||||
self:SetPngSprite(imgBg, chapterData.ChapterIcon)
|
||||
local isUnlock, lockText = PlayerData.Avg:IsStoryChapterUnlock(chapterData.Id)
|
||||
@@ -170,7 +159,7 @@ function StoryChapterCtrl:RefreshChapterList(grid, index)
|
||||
local txtLock = goLock:Find("txtLock"):GetComponent("TMP_Text")
|
||||
NovaAPI.SetTMPText(txtLock, lockText)
|
||||
end
|
||||
local btn = grid.transform:Find("btn"):GetComponent("UIButton")
|
||||
local btn = grid.transform:GetComponent("UIButton")
|
||||
btn.onClick:RemoveAllListeners()
|
||||
btn.onClick:AddListener(function()
|
||||
if isUnlock then
|
||||
@@ -182,6 +171,33 @@ function StoryChapterCtrl:RefreshChapterList(grid, index)
|
||||
end
|
||||
end)
|
||||
end
|
||||
function StoryChapterCtrl:RefreshChapterList(grid, index)
|
||||
index = index + 1
|
||||
local chapterData = self.tbAllChapter[index]
|
||||
if chapterData == nil then
|
||||
return
|
||||
end
|
||||
local chapterType = chapterData.Type
|
||||
local gridTrans = grid.transform
|
||||
local mainlineTrans = gridTrans:Find("btn")
|
||||
local branchlineTrans = gridTrans:Find("Branch")
|
||||
if chapterType == GameEnum.chapterType.Mainline then
|
||||
gridTrans = mainlineTrans
|
||||
elseif chapterType == GameEnum.chapterType.Branchline then
|
||||
gridTrans = branchlineTrans
|
||||
end
|
||||
mainlineTrans.gameObject:SetActive(chapterType == GameEnum.chapterType.Mainline)
|
||||
branchlineTrans.gameObject:SetActive(chapterType == GameEnum.chapterType.Branchline)
|
||||
self:RefreshChapterGrid(gridTrans, index)
|
||||
local ChapterRedDot = gridTrans:Find("AnimRoot/ChapterRedDot")
|
||||
local aniTrans = gridTrans:Find("AnimRoot"):GetComponent("Animator")
|
||||
local nInstanceID = grid:GetInstanceID()
|
||||
self.tbGridCtrl[nInstanceID] = {
|
||||
Id = chapterData.Id,
|
||||
aniTrans = aniTrans
|
||||
}
|
||||
RedDotManager.RegisterNode(RedDotDefine.Map_MainLine_Chapter, chapterData.Id, ChapterRedDot, nil, nil, true)
|
||||
end
|
||||
function StoryChapterCtrl:RefreshPersonality()
|
||||
local tbPersonality, sTitle = PlayerData.Avg:CalcPersonality(1)
|
||||
NovaAPI.SetPersonalityRing(self._mapNode.goPersonality, tbPersonality)
|
||||
@@ -221,13 +237,21 @@ end
|
||||
function StoryChapterCtrl:OnBtn_ClickChapterGrid(index, grid)
|
||||
EventManager.Hit(EventId.TemporaryBlockInput, 1)
|
||||
for k, v in pairs(self.tbGridCtrl) do
|
||||
if k ~= grid:GetInstanceID() then
|
||||
if v.Id ~= index then
|
||||
v.aniTrans:Play("StoryChapter_chapter_unsetout")
|
||||
end
|
||||
end
|
||||
local time = self:PlayAnimOut()
|
||||
self:AddTimer(1, time, function()
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MainlineEx, index, PanelId.StoryChapter)
|
||||
local chapterData = self.tbAllChapter[index]
|
||||
if chapterData == nil then
|
||||
return
|
||||
end
|
||||
if chapterData.Type == GameEnum.chapterType.Mainline then
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MainlineEx, index, PanelId.StoryChapter)
|
||||
elseif chapterData.Type == GameEnum.chapterType.Branchline then
|
||||
EventManager.Hit(EventId.OpenPanel, chapterData.StoryPanelId, index)
|
||||
end
|
||||
end, true, true, true)
|
||||
end
|
||||
function StoryChapterCtrl:OnBtn_ClickChangeInfo()
|
||||
|
||||
@@ -189,7 +189,7 @@ function StoryEntranceCtrl:RefreshMainlineQuickEntranceState()
|
||||
local storyConfig = ConfigTable.GetData_Story(curStoryId)
|
||||
local title = chapterConfig.Name .. " " .. storyConfig.Index
|
||||
NovaAPI.SetTMPText(self._mapNode.txtMainlineChapter, title)
|
||||
self:SetPngSprite(self._mapNode.imgMainlinceChapterBg, "UI/big_sprites/banner_avg_chapter" .. curChapter)
|
||||
self:SetPngSprite(self._mapNode.imgMainlinceChapterBg, chapterConfig.BannerIcon)
|
||||
self.curChapter = curChapter
|
||||
self.curStoryId = curStoryId
|
||||
end
|
||||
@@ -279,7 +279,12 @@ function StoryEntranceCtrl:OnBtn_ClickMainlineQuickEntrance()
|
||||
if not isUnlock then
|
||||
EventManager.Hit(EventId.OpenMessageBox, lockText)
|
||||
else
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MainlineEx, self.curChapter)
|
||||
local chapterData = ConfigTable.GetData("StoryChapter", self.curChapter, "")
|
||||
if chapterData.Type == GameEnum.chapterType.Mainline then
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MainlineEx, self.curChapter)
|
||||
else
|
||||
EventManager.Hit(EventId.OpenPanel, chapterData.StoryPanelId, self.curChapter)
|
||||
end
|
||||
end
|
||||
end
|
||||
function StoryEntranceCtrl:OnBtn_ClickRecentStoryQuickEntrance()
|
||||
@@ -303,7 +308,12 @@ function StoryEntranceCtrl:OnBtn_ClickActivityQuickEntrance()
|
||||
local chapterId = previewConfig.StoryId
|
||||
local isUnlock = AvgData:IsStoryChapterUnlock(chapterId)
|
||||
if isUnlock then
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MainlineEx, chapterId)
|
||||
local chapterData = ConfigTable.GetData("StoryChapter", chapterId, "")
|
||||
if chapterData.Type == GameEnum.chapterType.Mainline then
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.MainlineEx, chapterId)
|
||||
else
|
||||
EventManager.Hit(EventId.OpenPanel, chapterData.StoryPanelId, chapterId)
|
||||
end
|
||||
else
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.StoryChapter)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user