Major Update - 2.0.0.143
EN: 2.0.0.143 CN: 2.0.0.142 JP: 2.0.0.145 KR: 2.0.0.150
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
local BaseCtrl = require("GameCore.UI.BaseCtrl")
|
||||
local LocalData = require("GameCore.Data.LocalData")
|
||||
local SpringFestivalStoryCtrl = class("SpringFestivalStoryCtrl", BaseCtrl)
|
||||
local ActivityAvgData = PlayerData.ActivityAvg
|
||||
SpringFestivalStoryCtrl._mapNodeConfig = {
|
||||
svStory = {
|
||||
sComponentName = "LoopScrollView"
|
||||
@@ -48,7 +47,9 @@ function SpringFestivalStoryCtrl:Awake()
|
||||
local param = self:GetPanelParam()
|
||||
if type(param) == "table" then
|
||||
self.nActId = param[1]
|
||||
self.bReview = param[2] == true
|
||||
end
|
||||
self.storyData = self.bReview and PlayerData.StoryReview or PlayerData.ActivityAvg
|
||||
self.storyNodePos = {27, -30}
|
||||
self.tbGridTimer = {}
|
||||
self.nScrollTime = 0.5
|
||||
@@ -63,13 +64,13 @@ function SpringFestivalStoryCtrl:RefreshPanel()
|
||||
self:RefreshStoryList()
|
||||
end
|
||||
function SpringFestivalStoryCtrl:RefreshStoryList()
|
||||
self.tbAllStory, self.nChapterId = ActivityAvgData:GetStoryIdListByActivityId(self.nActId)
|
||||
self.tbAllStory, self.nChapterId = self.storyData:GetStoryIdListByActivityId(self.nActId)
|
||||
if self.tbAllStory == nil or #self.tbAllStory <= 0 then
|
||||
return
|
||||
end
|
||||
self._mapNode.svStory:SetAnim(0.07)
|
||||
self._mapNode.svStory:Init(#self.tbAllStory, self, self.OnRefreshGrid)
|
||||
local recentStoryId = PlayerData.ActivityAvg:GetRecentStoryId(self.nChapterId)
|
||||
local recentStoryId = self.storyData:GetRecentStoryId(self.nChapterId)
|
||||
local recentIndex = 1
|
||||
for i = 1, #self.tbAllStory do
|
||||
if self.tbAllStory[i] == recentStoryId then
|
||||
@@ -106,9 +107,9 @@ function SpringFestivalStoryCtrl:OnRefreshGrid(grid, index)
|
||||
local goLockState = btnGridText.transform:Find("scale_on_click/goLockState").gameObject
|
||||
local goComplete = btnGridText.transform:Find("scale_on_click/goComplete").gameObject
|
||||
local txtComplete = goComplete.transform:Find("imgBg/txtComplete"):GetComponent("TMP_Text")
|
||||
local isUnlock, tbResult = PlayerData.ActivityAvg:IsUnlock(avgcfg.ConditionId)
|
||||
local isReaded = PlayerData.ActivityAvg:IsStoryReaded(storyId)
|
||||
local bOpen, nOpenTime = PlayerData.ActivityAvg:IsOpen(avgcfg.StoryId)
|
||||
local isUnlock, tbResult = self.storyData:IsUnlock(avgcfg.ConditionId)
|
||||
local isReaded = self.storyData:IsStoryReaded(storyId)
|
||||
local bOpen, nOpenTime = self.storyData:IsOpen(avgcfg.StoryId)
|
||||
self:SetPngSprite(imgStory, string.format("Icon/ActivityStory/ep_event03_%02d", gridIndex))
|
||||
imgStory.gameObject:SetActive(bOpen and isUnlock)
|
||||
NovaAPI.SetTMPText(txtTitle, avgcfg.Index)
|
||||
@@ -138,12 +139,16 @@ function SpringFestivalStoryCtrl:OnRefreshGrid(grid, index)
|
||||
end, true, true, true)
|
||||
NovaAPI.SetTMPText(txtTime, strTime)
|
||||
end
|
||||
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(self.nActId)
|
||||
RedDotManager.RegisterNode(RedDotDefine.Activity_GroupNew_Avg_Group, {
|
||||
nActGroupId,
|
||||
self.nActId,
|
||||
avgcfg.Id
|
||||
}, RedDot, nil, nil, true)
|
||||
if self.bReview then
|
||||
RedDot:SetActive(false)
|
||||
else
|
||||
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(self.nActId)
|
||||
RedDotManager.RegisterNode(RedDotDefine.Activity_GroupNew_Avg_Group, {
|
||||
nActGroupId,
|
||||
self.nActId,
|
||||
avgcfg.Id
|
||||
}, RedDot, nil, nil, true)
|
||||
end
|
||||
local clickFuc = function()
|
||||
if not bOpen or self.bCantClick then
|
||||
return
|
||||
@@ -152,10 +157,10 @@ function SpringFestivalStoryCtrl:OnRefreshGrid(grid, index)
|
||||
local bNew = not isReaded
|
||||
self.avgId = avgcfg.StoryId
|
||||
self._mapNode.ctlAvgRoot.gameObject:SetActive(true)
|
||||
self._mapNode.ctlAvgRoot:OpenLevelInfo(avgcfg.StoryId, self.nActId, bNew)
|
||||
self._mapNode.ctlAvgRoot:OpenLevelInfo(avgcfg.StoryId, self.nActId, bNew, self.bReview)
|
||||
self.curIndex = gridIndex
|
||||
LocalData.SetPlayerLocalData("Act_Story_New" .. self.nActId .. avgcfg.Id, true)
|
||||
PlayerData.ActivityAvg:RefreshAvgRedDot()
|
||||
LocalData.SetPlayerLocalData(self.storyData:_GetLocalReadKey(self.nActId, avgcfg.Id), true)
|
||||
self.storyData:RefreshAvgRedDot()
|
||||
elseif tbResult ~= nil then
|
||||
local lockTxt = ""
|
||||
for i = 1, #tbResult do
|
||||
@@ -180,7 +185,7 @@ function SpringFestivalStoryCtrl:OnRefreshGrid(grid, index)
|
||||
for k, v in pairs(tbStoryIds) do
|
||||
if v == false then
|
||||
local storyData = ConfigTable.GetData("ActivityStory", k)
|
||||
if ActivityAvgData:IsUnlock(storyData.ConditionId) then
|
||||
if self.storyData:IsUnlock(storyData.ConditionId) then
|
||||
lockTxt = orderedFormat(ConfigTable.GetUIText("Story_UnlockPreId") or "", storyData.Title)
|
||||
break
|
||||
end
|
||||
@@ -272,6 +277,7 @@ function SpringFestivalStoryCtrl:OnBtn_ClickCloseLevelInfoPanel()
|
||||
self._mapNode.t_fullscreen_blur_black:SetActive(false)
|
||||
self._mapNode.ctlAvgRoot.gameObject:SetActive(false)
|
||||
self._mapNode.goChapterComplete:SetActive(false)
|
||||
EventManager.Hit("ActivityStoryReceive_SetVisible", true)
|
||||
end
|
||||
function SpringFestivalStoryCtrl:OnEvent_Story_Done(bHasReward)
|
||||
self:RefreshPanel()
|
||||
@@ -281,7 +287,7 @@ function SpringFestivalStoryCtrl:OnEvent_Story_Done(bHasReward)
|
||||
end
|
||||
function SpringFestivalStoryCtrl:OnEvent_SelectMainlineBattle(bConfirm)
|
||||
local OpenPanel = function()
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.RegionBossFormation, AllEnum.RegionBossFormationType.ActivityStory, 0, self.avgId, self.nActId)
|
||||
EventManager.Hit(EventId.OpenPanel, PanelId.RegionBossFormation, AllEnum.RegionBossFormationType.ActivityStory, 0, self.avgId, self.nActId, self.bReview)
|
||||
end
|
||||
if bConfirm then
|
||||
EventManager.Hit(EventId.SetTransition, 2, OpenPanel)
|
||||
@@ -291,9 +297,11 @@ function SpringFestivalStoryCtrl:OnEvent_Activity_Story_RewardClosed()
|
||||
self.bCantClick = false
|
||||
if self.curIndex == #self.tbAllStory then
|
||||
self._mapNode.goChapterComplete:SetActive(true)
|
||||
EventManager.Hit("ActivityStoryReceive_SetVisible", false)
|
||||
end
|
||||
end
|
||||
function SpringFestivalStoryCtrl:OnBtn_ClickCloseCompete()
|
||||
self._mapNode.goChapterComplete:SetActive(false)
|
||||
EventManager.Hit("ActivityStoryReceive_SetVisible", true)
|
||||
end
|
||||
return SpringFestivalStoryCtrl
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
local BasePanel = require("GameCore.UI.BasePanel")
|
||||
local SpringFestivalStoryPanel = class("SpringFestivalStoryPanel", BasePanel)
|
||||
SpringFestivalStoryPanel._sUIResRootPath = "UI_Activity/"
|
||||
SpringFestivalStoryPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "10104/Story/SpringThemeStoryPanel.prefab",
|
||||
sPrefabPath = "ActivityStoryReview/10104/SpringThemeStoryPanel.prefab",
|
||||
sCtrlName = "Game.UI.ActivityTheme.10104.Story.SpringFestivalStoryCtrl"
|
||||
},
|
||||
{
|
||||
sPrefabPath = "ActivityStoryReview/ActivityStoryReceivePanel.prefab",
|
||||
sCtrlName = "Game.UI.ActivityStoryReview.ActivityStoryReceiveCtrl"
|
||||
}
|
||||
}
|
||||
function SpringFestivalStoryPanel:Awake()
|
||||
if self._tbParam[2] ~= true then
|
||||
self._tbDefine = {
|
||||
self._tbDefine[1]
|
||||
}
|
||||
end
|
||||
end
|
||||
function SpringFestivalStoryPanel:OnEnable()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user