93 lines
2.5 KiB
Lua
93 lines
2.5 KiB
Lua
|
|
local uiCtrl = require_ex('UI/Panels/Base/UICtrl')
|
|
local PANEL_ID = PanelId.ActivityHighDifficulty
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ActivityHighDifficultyCtrl = HL.Class('ActivityHighDifficultyCtrl', uiCtrl.UICtrl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ActivityHighDifficultyCtrl.s_messages = HL.StaticField(HL.Table) << {
|
|
|
|
}
|
|
|
|
|
|
ActivityHighDifficultyCtrl.m_activityId = HL.Field(HL.String) << ''
|
|
|
|
|
|
ActivityHighDifficultyCtrl.m_activity = HL.Field(HL.Any)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ActivityHighDifficultyCtrl.OnCreate = HL.Override(HL.Any) << function(self, args)
|
|
|
|
self.m_activityId = args.activityId
|
|
self.view.activityCommonInfo:InitActivityCommonInfo(args)
|
|
self.view.activityCommonInfo.view.gotoNode.btnDetailRedDot:InitRedDot("ActivityHighDifficultyChallenge", self.m_activityId)
|
|
self.view.completeProgressNode.gameObject:SetActive(ActivityUtils.hasIntroMissionAndComplete(self.m_activityId))
|
|
|
|
|
|
local completeIntroMission = ActivityUtils.hasIntroMissionAndComplete(self.m_activityId)
|
|
self.m_activity = GameInstance.player.activitySystem:GetActivity(self.m_activityId)
|
|
self.view.infoNodeState:SetState(completeIntroMission and "Unlocked" or "Locked")
|
|
if not completeIntroMission or self.m_activity.seriesDataMap.Count == 0 then
|
|
return
|
|
end
|
|
|
|
|
|
local mostRecentSeries = {
|
|
seriesId = -1,
|
|
openTime = 0,
|
|
}
|
|
local totalNum = 0
|
|
local completeNum = 0
|
|
for id, seriesInfo in pairs(self.m_activity.seriesDataMap) do
|
|
|
|
if seriesInfo.OpenTime > mostRecentSeries.openTime then
|
|
mostRecentSeries = {
|
|
seriesId = seriesInfo.SeriesId,
|
|
openTime = seriesInfo.OpenTime
|
|
}
|
|
end
|
|
|
|
|
|
totalNum = totalNum + 1
|
|
|
|
|
|
local gameList = Tables.ActivityGameEntranceGameTable[seriesInfo.SeriesId].gameList
|
|
local allPassed = true
|
|
for i = 1,#gameList do
|
|
local dungeonId = gameList[CSIndex(i)].gameId
|
|
if not GameInstance.dungeonManager:IsDungeonPassed(dungeonId) then
|
|
allPassed = false
|
|
end
|
|
end
|
|
if allPassed then
|
|
completeNum = completeNum + 1
|
|
end
|
|
end
|
|
|
|
|
|
local _, seriesCfg = Tables.activityGameEntranceSeriesTable:TryGetValue(self.m_activityId)
|
|
local seriesName = seriesCfg.seriesMap[mostRecentSeries.seriesId].name
|
|
self.view.regionTxt.text = string.format(Language.LUA_ACTIVITY_HIGH_DIFFICULTY_CHALLENGE_OPEN, seriesName)
|
|
self.view.completeNumTxt.text = completeNum
|
|
self.view.totalNumTxt.text = "/" .. totalNum
|
|
end
|
|
|
|
HL.Commit(ActivityHighDifficultyCtrl)
|