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:
SL1900
2026-04-18 00:15:00 +09:00
parent 35fe1f046d
commit e0549005e1
1150 changed files with 941124 additions and 19847 deletions
@@ -15,7 +15,8 @@ JointDrillBattleMenuCtrl._mapEventConfig = {
InputEnable = "OnEvent_InputEnable",
LoadLevelRefresh = "OnEvent_LoadLevelRefresh",
JointDrill_StopTime = "OnEvent_JointDrill_StopTime",
JointDrill_ShowPauseBnt_Editor = "OnEvent_ShowPauseBntEditor"
JointDrill_ShowPauseBnt_Editor = "OnEvent_ShowPauseBntEditor",
JointDrill_Level_TimeOut = "OnEvent_LevelTimeOut"
}
function JointDrillBattleMenuCtrl:OnEnable()
self._mapNode.BtnBg.gameObject:SetActive(false)
@@ -38,6 +39,9 @@ end
function JointDrillBattleMenuCtrl:OnEvent_JointDrill_StopTime()
self._mapNode.BtnBg.gameObject:SetActive(false)
end
function JointDrillBattleMenuCtrl:OnEvent_LevelTimeOut()
self._mapNode.BtnBg.gameObject:SetActive(false)
end
function JointDrillBattleMenuCtrl:OnEvent_ShowPauseBntEditor()
self._mapNode.BtnBg.gameObject:SetActive(true)
self._mapNode.btnPause.gameObject:GetComponent("NaviButton").enabled = true
@@ -91,7 +91,8 @@ JointDrillPauseCtrl._mapNodeConfig = {
}
JointDrillPauseCtrl._mapEventConfig = {
OpenJointDrillPause = "OnEvent_OpenJointDrillPause",
RefreshChallengeTime = "OnEvent_RefreshChallengeTime"
RefreshChallengeTime = "OnEvent_RefreshChallengeTime",
CloseJointDrillPause = "OnEvent_CloseJointDrillPause"
}
JointDrillPauseCtrl._mapRedDotConfig = {}
function JointDrillPauseCtrl:PlayInAni()
@@ -114,11 +115,11 @@ function JointDrillPauseCtrl:RefreshChallengeTime()
NovaAPI.SetTMPText(self._mapNode.txtChallengeTime, string.format("%02d:%02d", nMin, nSec))
return nTime
end
local nTime = refreshTime()
if 0 < nTime then
self.nRemainTime = refreshTime()
if self.nRemainTime > 0 then
self.challengeTimer = self:AddTimer(0, 1, function()
local nTime = refreshTime()
if nTime <= 0 then
self.nRemainTime = refreshTime()
if self.nRemainTime <= 0 then
self.challengeTimer:Cancel()
self.challengeTimer = nil
end
@@ -144,6 +145,9 @@ function JointDrillPauseCtrl:Refresh(nTime)
NovaAPI.SetTMPText(self._mapNode.txtBattleTime, string.format("%02d:%02d:%03d", nMin, nSec, nMs))
end
function JointDrillPauseCtrl:PlayCloseAni(callback)
if self._mapNode == nil then
return
end
self._mapNode.aniWindow:Play("t_window_04_t_out")
self._mapNode.aniBlur:SetTrigger("tOut")
EventManager.Hit(EventId.TemporaryBlockInput, 0.2)
@@ -179,6 +183,7 @@ function JointDrillPauseCtrl:Awake()
end
function JointDrillPauseCtrl:OnEnable()
self.nOpenTime = 0
self.nRemainTime = 0
if self._panel.nType ~= nil then
if self._panel.nType == GameEnum.JointDrillMode.JointDrill_Mode_1 then
self.nOpenTime = PlayerData.JointDrill_1:GetJointDrillStartTime()
@@ -291,4 +296,10 @@ function JointDrillPauseCtrl:OnEvent_RefreshChallengeTime(nTime)
local nSec = math.fmod(nTime, 60)
NovaAPI.SetTMPText(self._mapNode.txtChallengeTime, string.format("%02d:%02d", nMin, nSec))
end
function JointDrillPauseCtrl:OnEvent_CloseJointDrillPause()
if self._mapNode == nil or not self.bShow then
return
end
self:OnPanelClose()
end
return JointDrillPauseCtrl
@@ -56,14 +56,35 @@ JointDrillBuildListCtrl._mapEventConfig = {
RefreshJointDrillActTime = "OnEvent_RefreshJointDrillActTime"
}
JointDrillBuildListCtrl._mapRedDotConfig = {}
function JointDrillBuildListCtrl:GetJointDrillPlayerData()
return PlayerData.JointDrill_1
end
function JointDrillBuildListCtrl:GetJointDrillBuildListPanelId()
return PanelId.JointDrillBuildList_1
end
function JointDrillBuildListCtrl:GetJointDrillLevelSelectPanelId()
return PanelId.JointDrillLevelSelect_1
end
function JointDrillBuildListCtrl:GetRegionBossFormationType()
return AllEnum.RegionBossFormationType.JointDrill
end
function JointDrillBuildListCtrl:GetBuildItemCtrlPath()
return "Game.UI.JointDrill.JointDrill_1.JointDrillBuildItemCtrl"
end
function JointDrillBuildListCtrl:GetJointDrillBuildListRaw()
return self:GetJointDrillPlayerData():GetJointDrillBuildList()
end
function JointDrillBuildListCtrl:GetJointDrillBuildList()
return self:GetJointDrillBuildListRaw()
end
function JointDrillBuildListCtrl:RefreshBuildList()
self.tbBuildItemCtrl = {}
local nAllChallengeCount = PlayerData.JointDrill_1:GetMaxChallengeCount(self.nLevelId)
local nAllChallengeCount = self:GetJointDrillPlayerData():GetMaxChallengeCount(self.nLevelId)
nAllChallengeCount = math.max(4, nAllChallengeCount)
self._mapNode.buildLSV:Init(nAllChallengeCount, self, self.OnGridRefresh)
end
function JointDrillBuildListCtrl:SetSelectBuildItem()
local nCurSelectBuildId = PlayerData.JointDrill_1:GetCachedBuild()
local nCurSelectBuildId = self:GetJointDrillPlayerData():GetCachedBuild()
if nCurSelectBuildId == 0 then
self._mapNode.btnSelectBuild.gameObject:SetActive(true)
self._mapNode.goBuild.gameObject:SetActive(false)
@@ -88,7 +109,7 @@ function JointDrillBuildListCtrl:OnGridRefresh(goGrid, gridIndex)
local nIndex = gridIndex + 1
local mapBuild = self.tbBuildList[nIndex]
if self.tbBuildItemCtrl[goGrid] == nil then
local itemCtrl = self:BindCtrlByNode(goGrid, "Game.UI.JointDrill.JointDrill_1.JointDrillBuildItemCtrl")
local itemCtrl = self:BindCtrlByNode(goGrid, self:GetBuildItemCtrlPath())
self.tbBuildItemCtrl[goGrid] = itemCtrl
end
self.tbBuildItemCtrl[goGrid]:SetItem(nIndex, mapBuild, self.nLevelId)
@@ -104,7 +125,7 @@ function JointDrillBuildListCtrl:SetChallengeTime(nRemainTime)
NovaAPI.SetTMPText(self._mapNode.txtChallengeTime, orderedFormat(ConfigTable.GetUIText("JointDrill_Challenge_Time_Left"), sTime))
end
function JointDrillBuildListCtrl:RefreshChallengeTime()
local nStartTime = PlayerData.JointDrill_1:GetJointDrillStartTime()
local nStartTime = self:GetJointDrillPlayerData():GetJointDrillStartTime()
local nCloseTime = math.floor(nStartTime + ConfigTable.GetConfigNumber("JointDrill_Challenge_Time_Max"))
local nCurTime = ClientManager.serverTimeStamp
local nRemainTime = nCloseTime - nCurTime
@@ -119,8 +140,8 @@ function JointDrillBuildListCtrl:OnEnable()
self.nLevelId = tbParam[1]
self.bSimulation = tbParam[2]
end
self.bInBattle = PlayerData.JointDrill_1:CheckJointDrillInBattle()
self.tbBuildList = PlayerData.JointDrill_1:GetJointDrillBuildList()
self.bInBattle = self:GetJointDrillPlayerData():CheckJointDrillInBattle()
self.tbBuildList = self:GetJointDrillBuildList()
if not self.bInBattle then
NovaAPI.SetTMPText(self._mapNode.txtBtnStart, ConfigTable.GetUIText("JointDrill_Btn_Start_Challenge"))
else
@@ -139,7 +160,7 @@ function JointDrillBuildListCtrl:OnEnable()
end
self:SetSelectBuildItem()
local nChallengeCount = #self.tbBuildList
self.nAllChallengeCount = PlayerData.JointDrill_1:GetMaxChallengeCount(self.nLevelId)
self.nAllChallengeCount = self:GetJointDrillPlayerData():GetMaxChallengeCount(self.nLevelId)
NovaAPI.SetTMPText(self._mapNode.txtChallengeCount, orderedFormat(ConfigTable.GetUIText("JointDrill_Challenge_Count"), self.nAllChallengeCount - nChallengeCount))
self._mapNode.goChallengeTime.gameObject:SetActive(self.bInBattle)
end
@@ -154,42 +175,42 @@ end
function JointDrillBuildListCtrl:OnDestroy()
end
function JointDrillBuildListCtrl:OnBtnClick_SelectBuild()
if not PlayerData.JointDrill_1:CheckChallengeCount() then
if not self:GetJointDrillPlayerData():CheckChallengeCount() then
return
end
EventManager.Hit(EventId.OpenPanel, PanelId.RogueBossBuildBrief, AllEnum.RegionBossFormationType.JointDrill)
EventManager.Hit(EventId.OpenPanel, PanelId.RogueBossBuildBrief, self:GetRegionBossFormationType())
end
function JointDrillBuildListCtrl:OnBtnClick_DelBuild()
PlayerData.JointDrill_1:SetSelBuildId(0)
self:GetJointDrillPlayerData():SetSelBuildId(0)
self:SetSelectBuildItem()
end
function JointDrillBuildListCtrl:OnBtnClick_Start()
local bInChallengeTime = PlayerData.JointDrill_1:CheckActChallengeTime()
local bInChallengeTime = self:GetJointDrillPlayerData():CheckActChallengeTime()
if not bInChallengeTime then
local gameOverCallback = function()
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_1)
EventManager.Hit(EventId.ClosePanel, self:GetJointDrillBuildListPanelId())
end
if self.bInBattle then
PlayerData.JointDrill_1:JointDrillGameOver(gameOverCallback, true)
self:GetJointDrillPlayerData():JointDrillGameOver(gameOverCallback, true)
else
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_Challenge_End_Tip"))
gameOverCallback()
end
return
end
if not PlayerData.JointDrill_1:CheckChallengeCount() then
if not self:GetJointDrillPlayerData():CheckChallengeCount() then
return
end
local nBuildId = PlayerData.JointDrill_1:GetCachedBuild()
local nBuildId = self:GetJointDrillPlayerData():GetCachedBuild()
if nBuildId == 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_SelectBuild_Tip"))
return
end
if self.bInBattle then
local nStartTime = PlayerData.JointDrill_1:GetJointDrillStartTime()
local nStartTime = self:GetJointDrillPlayerData():GetJointDrillStartTime()
local nCloseTime = math.floor(nStartTime + ConfigTable.GetConfigNumber("JointDrill_Challenge_Time_Max"))
if nCloseTime <= ClientManager.serverTimeStamp then
PlayerData.JointDrill_1:JointDrillGameOver(nil, true)
self:GetJointDrillPlayerData():JointDrillGameOver(nil, true)
return
end
end
@@ -197,7 +218,7 @@ function JointDrillBuildListCtrl:OnBtnClick_Start()
if self.bInBattle then
nType = AllEnum.JointDrillLevelStartType.Continue
end
PlayerData.JointDrill_1:EnterJointDrill(self.nLevelId, nBuildId, self.bSimulation, nType)
self:GetJointDrillPlayerData():EnterJointDrill(self.nLevelId, nBuildId, self.bSimulation, nType)
end
function JointDrillBuildListCtrl:OnEvent_RefreshChallengeTime(nRemainTime)
self:SetChallengeTime(nRemainTime)
@@ -205,8 +226,8 @@ end
function JointDrillBuildListCtrl:OnEvent_RefreshJointDrillActTime(nStatus, nRemainTime)
if nStatus == AllEnum.JointDrillActStatus.Closed then
local confirmCallback = function()
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_1)
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillLevelSelect_1)
EventManager.Hit(EventId.ClosePanel, self:GetJointDrillBuildListPanelId())
EventManager.Hit(EventId.ClosePanel, self:GetJointDrillLevelSelectPanelId())
end
local msg = {
nType = AllEnum.MessageBox.Alert,
@@ -5,10 +5,6 @@ JointDrillLevelSelectCtrl._mapNodeConfig = {
TopBarPanel = {
sCtrlName = "Game.UI.TopBarEx.TopBarCtrl"
},
animRoot = {
sNodeName = "----SafeAreaRoot----",
sComponentName = "Animator"
},
imgBg = {sComponentName = "Image"},
goMain = {sNodeName = "---Main---"},
btnAvg = {
@@ -35,7 +31,6 @@ JointDrillLevelSelectCtrl._mapNodeConfig = {
sComponentName = "TMP_Text",
sLanguageId = "JointDrill_Btn_Shop"
},
redDotQuest = {},
btnRank = {
sComponentName = "UIButton",
callback = "OnBtnClick_Rank"
@@ -44,10 +39,7 @@ JointDrillLevelSelectCtrl._mapNodeConfig = {
sComponentName = "TMP_Text",
sLanguageId = "JointDrill_Btn_Rank"
},
btnShop = {
sComponentName = "UIButton",
callback = "OnBtnClick_Shop"
},
redDotQuest = {},
goActTime = {},
txtActTimeCn = {sComponentName = "TMP_Text"},
txtActTime = {sComponentName = "TMP_Text"},
@@ -218,7 +210,7 @@ JointDrillLevelSelectCtrl._mapNodeConfig = {
goAvgRoot = {
sNodeName = "goMainLineAvgRoot"
},
animWindow = {sNodeName = "rtWindow", sComponentName = "Animator"},
animWindowAVG = {sNodeName = "rtWindow", sComponentName = "Animator"},
txtAvgTitle = {
sComponentName = "TMP_Text",
sLanguageId = "JointDrill_AVG_Title"
@@ -298,7 +290,7 @@ end
function JointDrillLevelSelectCtrl:RefreshLevelList()
self._mapNode.goMain.gameObject:SetActive(true)
self._mapNode.goLevelInfo.gameObject:SetActive(false)
self._mapNode.animRoot:Play("JointDrill_Main_in", 0, 0)
self.animRoot:Play("JointDrill_Main_in", 0, 0)
local nLocationIndex = 0
if self.bInBattle or self.nActStatus == AllEnum.JointDrillActStatus.Start then
self._mapNode.goLevelList.gameObject:SetActive(true)
@@ -366,7 +358,7 @@ function JointDrillLevelSelectCtrl:RefreshLevelInfo()
self._mapNode.goLevelInfo.gameObject:SetActive(true)
self._mapNode.goInBattle.gameObject:SetActive(self.bInBattle)
self._mapNode.goNormal.gameObject:SetActive(not self.bInBattle)
self._mapNode.animRoot:Play("JointDrill_LevelInfo_in", 0, 0)
self.animRoot:Play("JointDrill_LevelInfo_in", 0, 0)
if self.bInBattle then
self._mapNode.animatorContinue:Play("JointDrill_Btn_Continue", 0, 0)
self._mapNode.animatorCancel:Play("JointDrill_Btn_Cancel", 0, 0)
@@ -569,6 +561,7 @@ function JointDrillLevelSelectCtrl:Awake()
end
end
function JointDrillLevelSelectCtrl:OnEnable()
self.animRoot = self.gameObject:GetComponent("Animator")
local bReset = PlayerData.JointDrill_1:GetResetLevelSelect()
if bReset then
self.nPanelType = panelType_main
@@ -603,6 +596,9 @@ function JointDrillLevelSelectCtrl:OnEnable()
self:Refresh()
self:StartTicketsRefreshTimer()
self:RefreshAvgInfo()
if self.nActStatus == AllEnum.JointDrillActStatus.Start then
PlayerData.JointDrill_1:SendJointDrillRankMsg()
end
end
function JointDrillLevelSelectCtrl:OnDisable()
if self.ticketRefreshTimer ~= nil then
@@ -752,7 +748,9 @@ function JointDrillLevelSelectCtrl:OnBtnClick_FastBattle()
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_Tickets_NotEnough"))
return
end
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRaid_1, self.nSelectLevelId)
PlayerData.JointDrill_1:SendJointDrillRankMsg(function()
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRaid_1, self.nSelectLevelId)
end)
end
function JointDrillLevelSelectCtrl:OnEvent_RefreshJointDrillLevel()
self:Refresh()
@@ -773,10 +771,10 @@ function JointDrillLevelSelectCtrl:OnEvent_SelectJointDrillLevel(nLevelId)
end
return
end
local nAnimTime = NovaAPI.GetAnimClipLength(self._mapNode.animRoot, {
local nAnimTime = NovaAPI.GetAnimClipLength(self.animRoot, {
"JointDrill_Main_out"
})
self._mapNode.animRoot:Play("JointDrill_Main_out")
self.animRoot:Play("JointDrill_Main_out")
self._mapNode.goSmoke.gameObject:SetActive(false)
self._mapNode.goSmoke.gameObject:SetActive(true)
self:AddTimer(1, nAnimTime, function()
@@ -820,14 +818,14 @@ function JointDrillLevelSelectCtrl:OnBtnClick_Reward(btn, nIndex)
end
end
function JointDrillLevelSelectCtrl:OnBtnClick_CloseAvgWindow()
self._mapNode.animWindow:Play("t_window_04_t_out")
self._mapNode.animWindowAVG:Play("t_window_04_t_out")
local closeWindow = function()
self._mapNode.goAvgWindow.gameObject:SetActive(false)
end
self:AddTimer(1, 0.3, closeWindow, true, true, true, false)
end
function JointDrillLevelSelectCtrl:OnBtnClick_CancelAvgWindow()
self._mapNode.animWindow:Play("t_window_04_t_out")
self._mapNode.animWindowAVG:Play("t_window_04_t_out")
local closeWindow = function()
self._mapNode.goAvgWindow.gameObject:SetActive(false)
end
@@ -838,10 +836,10 @@ function JointDrillLevelSelectCtrl:OnBtnClick_StartAvg()
end
function JointDrillLevelSelectCtrl:OnEvent_Back()
if self.nPanelType == panelType_levelInfo then
local nAnimTime = NovaAPI.GetAnimClipLength(self._mapNode.animRoot, {
local nAnimTime = NovaAPI.GetAnimClipLength(self.animRoot, {
"JointDrill_LevelInfo_out"
})
self._mapNode.animRoot:Play("JointDrill_LevelInfo_out")
self.animRoot:Play("JointDrill_LevelInfo_out")
self._mapNode.goSmoke.gameObject:SetActive(false)
self._mapNode.goSmoke.gameObject:SetActive(true)
self:AddTimer(1, nAnimTime, function()
@@ -79,7 +79,10 @@ JointDrillRankingCtrl._mapNodeConfig = {
callback = "OnBtnClick_CloseReward"
}
}
JointDrillRankingCtrl._mapEventConfig = {}
JointDrillRankingCtrl._mapEventConfig = {
ShowTeamDetail = "OnEvent_ShowTeamDetail",
OpenRankBuildDetail = "OnEvent_OpenRankBuildDetail"
}
JointDrillRankingCtrl._mapRedDotConfig = {}
function JointDrillRankingCtrl:SetEndTime()
local actData = PlayerData.Activity:GetActivityDataById(self.nActId)
@@ -129,8 +132,19 @@ function JointDrillRankingCtrl:RefreshRankList()
else
self._mapNode.goLoading.gameObject:SetActive(false)
self._mapNode.goMainContent.gameObject:SetActive(true)
self._mapNode.svRankingInfo:SetAnim(0.1)
if self._panel.mapRankDetail == nil then
self._mapNode.svRankingInfo:SetAnim(0.1)
end
self._mapNode.svRankingInfo:Init(#self.mapRankList, self, self.RefreshRankGrid)
if self._panel.mapRankDetail ~= nil then
self._mapNode.svRankingInfo:SetScrollPos(self._panel.nGridPos)
self:AddTimer(1, 0.4, function()
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRankDetail_1, self._panel.mapRankDetail)
self._panel.mapRankDetail = nil
self._panel.nGridPos = 0
end, true, true, true)
EventManager.Hit(EventId.TemporaryBlockInput, 0.4)
end
end
end
function JointDrillRankingCtrl:RefreshSelfRank()
@@ -200,4 +214,11 @@ function JointDrillRankingCtrl:OnBtnClick_CloseReward()
self:AddTimer(1, 0.2, close, true, true, true)
EventManager.Hit(EventId.TemporaryBlockInput, 0.2)
end
function JointDrillRankingCtrl:OnEvent_ShowTeamDetail(rankData)
self.mapRankDetail = rankData
end
function JointDrillRankingCtrl:OnEvent_OpenRankBuildDetail()
self._panel.mapRankDetail = self.mapRankDetail
self._panel.nGridPos = self._mapNode.svRankingInfo:GetScrollPos()
end
return JointDrillRankingCtrl
@@ -7,6 +7,8 @@ JointDrillRankingPanel._tbDefine = {
}
}
function JointDrillRankingPanel:Awake()
self.mapRankDetail = nil
self.nGridPos = 0
end
function JointDrillRankingPanel:OnEnable()
end
@@ -183,6 +183,7 @@ function JointDrillRankItemCtrl:OnBtnClick_TeamDetail()
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_Rank_Detail_Empty"))
return
end
EventManager.Hit("ShowTeamDetail", self.mapRankData)
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRankDetail_1, self.mapRankData)
end
return JointDrillRankItemCtrl
@@ -172,7 +172,7 @@ function JointDrillResultCtrl:OpenReward()
self:ClosePanel()
end
local callback = function()
if self.nResultType == AllEnum.JointDrillResultType.Success or self.nResultType == AllEnum.JointDrillResultType.ChallengeEnd and self.mapScore ~= nil and next(self.mapScore) ~= nil then
if (self.nResultType == AllEnum.JointDrillResultType.Success or self.nResultType == AllEnum.JointDrillResultType.ChallengeEnd) and self.mapScore ~= nil and next(self.mapScore) ~= nil then
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRankUp_1, self.nOld, self.nNew, self.mapScore, self.nResultType, closeCallback)
else
closeCallback()
@@ -18,6 +18,10 @@ JointDrillTeamItemCtrl._mapNodeConfig = {
nCount = 2,
sComponentName = "TMP_Text",
sLanguageId = "Build_Sub"
},
btnDetail = {
sComponentName = "UIButton",
callback = "OnBtnClick_Detail"
}
}
JointDrillTeamItemCtrl._mapEventConfig = {}
@@ -36,6 +40,7 @@ function JointDrillTeamItemCtrl:GetBuildRank(nScore)
return curIdx
end
function JointDrillTeamItemCtrl:RefreshItem(mapTeam, nIndex)
self.mapTeam = mapTeam
local sIndex = ConfigTable.GetUIText("JointDrill_Battle_Time_" .. nIndex)
NovaAPI.SetTMPText(self._mapNode.txtTeam, orderedFormat(ConfigTable.GetUIText("JointDrill_Rank_Build_Count"), sIndex))
for i = 1, 3 do
@@ -54,6 +59,19 @@ function JointDrillTeamItemCtrl:RefreshItem(mapTeam, nIndex)
local nScore = self:GetBuildRank(mapTeam.BuildScore)
self:SetPngSprite(self._mapNode.imgScoreIcon, "Icon/BuildRank/BuildRank_" .. nScore)
end
function JointDrillTeamItemCtrl:OnBtnClick_Detail()
if self.mapTeam.Discs == nil or #self.mapTeam.Discs == 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Rank_Build_Detail_Unavailable"))
return
end
EventManager.Hit("OpenRankBuildDetail")
EventManager.Hit(EventId.OpenPanel, PanelId.RankBuildDetail, self.mapTeam)
local wait = function()
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillRankDetail_1)
end
cs_coroutine.start(wait)
end
function JointDrillTeamItemCtrl:Awake()
end
function JointDrillTeamItemCtrl:OnEnable()
@@ -56,14 +56,35 @@ JointDrillBuildListCtrl._mapEventConfig = {
RefreshJointDrillActTime = "OnEvent_RefreshJointDrillActTime"
}
JointDrillBuildListCtrl._mapRedDotConfig = {}
function JointDrillBuildListCtrl:GetJointDrillPlayerData()
return PlayerData.JointDrill_2
end
function JointDrillBuildListCtrl:GetJointDrillBuildListPanelId()
return PanelId.JointDrillBuildList_2
end
function JointDrillBuildListCtrl:GetJointDrillLevelSelectPanelId()
return PanelId.JointDrillLevelSelect_2
end
function JointDrillBuildListCtrl:GetRegionBossFormationType()
return AllEnum.RegionBossFormationType.JointDrill_2
end
function JointDrillBuildListCtrl:GetBuildItemCtrlPath()
return "Game.UI.JointDrill.JointDrill_2.JointDrillBuildItemCtrl"
end
function JointDrillBuildListCtrl:GetJointDrillBuildListRaw()
return self:GetJointDrillPlayerData():GetJointDrillBuildList()
end
function JointDrillBuildListCtrl:GetJointDrillBuildList()
return self:GetJointDrillBuildListRaw()
end
function JointDrillBuildListCtrl:RefreshBuildList()
self.tbBuildItemCtrl = {}
local nAllChallengeCount = PlayerData.JointDrill_2:GetMaxChallengeCount(self.nLevelId)
local nAllChallengeCount = self:GetJointDrillPlayerData():GetMaxChallengeCount(self.nLevelId)
nAllChallengeCount = math.max(4, nAllChallengeCount)
self._mapNode.buildLSV:Init(nAllChallengeCount, self, self.OnGridRefresh)
end
function JointDrillBuildListCtrl:SetSelectBuildItem()
local nCurSelectBuildId = PlayerData.JointDrill_2:GetCachedBuild()
local nCurSelectBuildId = self:GetJointDrillPlayerData():GetCachedBuild()
if nCurSelectBuildId == 0 then
self._mapNode.btnSelectBuild.gameObject:SetActive(true)
self._mapNode.goBuild.gameObject:SetActive(false)
@@ -88,7 +109,7 @@ function JointDrillBuildListCtrl:OnGridRefresh(goGrid, gridIndex)
local nIndex = gridIndex + 1
local mapBuild = self.tbBuildList[nIndex]
if self.tbBuildItemCtrl[goGrid] == nil then
local itemCtrl = self:BindCtrlByNode(goGrid, "Game.UI.JointDrill.JointDrill_2.JointDrillBuildItemCtrl")
local itemCtrl = self:BindCtrlByNode(goGrid, self:GetBuildItemCtrlPath())
self.tbBuildItemCtrl[goGrid] = itemCtrl
end
self.tbBuildItemCtrl[goGrid]:SetItem(nIndex, mapBuild, self.nLevelId)
@@ -104,7 +125,7 @@ function JointDrillBuildListCtrl:SetChallengeTime(nRemainTime)
NovaAPI.SetTMPText(self._mapNode.txtChallengeTime, orderedFormat(ConfigTable.GetUIText("JointDrill_Challenge_Time_Left"), sTime))
end
function JointDrillBuildListCtrl:RefreshChallengeTime()
local nStartTime = PlayerData.JointDrill_2:GetJointDrillStartTime()
local nStartTime = self:GetJointDrillPlayerData():GetJointDrillStartTime()
local nCloseTime = math.floor(nStartTime + ConfigTable.GetConfigNumber("JointDrill_Challenge_Time_Max"))
local nCurTime = ClientManager.serverTimeStamp
local nRemainTime = nCloseTime - nCurTime
@@ -119,8 +140,8 @@ function JointDrillBuildListCtrl:OnEnable()
self.nLevelId = tbParam[1]
self.bSimulation = tbParam[2]
end
self.bInBattle = PlayerData.JointDrill_2:CheckJointDrillInBattle()
self.tbBuildList = PlayerData.JointDrill_2:GetJointDrillBuildList()
self.bInBattle = self:GetJointDrillPlayerData():CheckJointDrillInBattle()
self.tbBuildList = self:GetJointDrillBuildList()
if not self.bInBattle then
NovaAPI.SetTMPText(self._mapNode.txtBtnStart, ConfigTable.GetUIText("JointDrill_Btn_Start_Challenge"))
else
@@ -139,7 +160,7 @@ function JointDrillBuildListCtrl:OnEnable()
end
self:SetSelectBuildItem()
local nChallengeCount = #self.tbBuildList
self.nAllChallengeCount = PlayerData.JointDrill_2:GetMaxChallengeCount(self.nLevelId)
self.nAllChallengeCount = self:GetJointDrillPlayerData():GetMaxChallengeCount(self.nLevelId)
NovaAPI.SetTMPText(self._mapNode.txtChallengeCount, orderedFormat(ConfigTable.GetUIText("JointDrill_Challenge_Count"), self.nAllChallengeCount - nChallengeCount))
self._mapNode.goChallengeTime.gameObject:SetActive(self.bInBattle)
end
@@ -154,42 +175,42 @@ end
function JointDrillBuildListCtrl:OnDestroy()
end
function JointDrillBuildListCtrl:OnBtnClick_SelectBuild()
if not PlayerData.JointDrill_2:CheckChallengeCount() then
if not self:GetJointDrillPlayerData():CheckChallengeCount() then
return
end
EventManager.Hit(EventId.OpenPanel, PanelId.RogueBossBuildBrief, AllEnum.RegionBossFormationType.JointDrill_2)
EventManager.Hit(EventId.OpenPanel, PanelId.RogueBossBuildBrief, self:GetRegionBossFormationType())
end
function JointDrillBuildListCtrl:OnBtnClick_DelBuild()
PlayerData.JointDrill_2:SetSelBuildId(0)
self:GetJointDrillPlayerData():SetSelBuildId(0)
self:SetSelectBuildItem()
end
function JointDrillBuildListCtrl:OnBtnClick_Start()
local bInChallengeTime = PlayerData.JointDrill_2:CheckActChallengeTime()
local bInChallengeTime = self:GetJointDrillPlayerData():CheckActChallengeTime()
if not bInChallengeTime then
local gameOverCallback = function()
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_2)
EventManager.Hit(EventId.ClosePanel, self:GetJointDrillBuildListPanelId())
end
if self.bInBattle then
PlayerData.JointDrill_2:JointDrillGameOver(gameOverCallback, true)
self:GetJointDrillPlayerData():JointDrillGameOver(gameOverCallback, true)
else
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_Challenge_End_Tip"))
gameOverCallback()
end
return
end
if not PlayerData.JointDrill_2:CheckChallengeCount() then
if not self:GetJointDrillPlayerData():CheckChallengeCount() then
return
end
local nBuildId = PlayerData.JointDrill_2:GetCachedBuild()
local nBuildId = self:GetJointDrillPlayerData():GetCachedBuild()
if nBuildId == 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_SelectBuild_Tip"))
return
end
if self.bInBattle then
local nStartTime = PlayerData.JointDrill_2:GetJointDrillStartTime()
local nStartTime = self:GetJointDrillPlayerData():GetJointDrillStartTime()
local nCloseTime = math.floor(nStartTime + ConfigTable.GetConfigNumber("JointDrill_Challenge_Time_Max"))
if nCloseTime <= ClientManager.serverTimeStamp then
PlayerData.JointDrill_2:JointDrillGameOver(nil, true)
self:GetJointDrillPlayerData():JointDrillGameOver(nil, true)
return
end
end
@@ -197,7 +218,7 @@ function JointDrillBuildListCtrl:OnBtnClick_Start()
if self.bInBattle then
nType = AllEnum.JointDrillLevelStartType.Continue
end
PlayerData.JointDrill_2:EnterJointDrill(self.nLevelId, nBuildId, self.bSimulation, nType)
self:GetJointDrillPlayerData():EnterJointDrill(self.nLevelId, nBuildId, self.bSimulation, nType)
end
function JointDrillBuildListCtrl:OnEvent_RefreshChallengeTime(nRemainTime)
self:SetChallengeTime(nRemainTime)
@@ -205,8 +226,8 @@ end
function JointDrillBuildListCtrl:OnEvent_RefreshJointDrillActTime(nStatus, nRemainTime)
if nStatus == AllEnum.JointDrillActStatus.Closed then
local confirmCallback = function()
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_2)
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillLevelSelect_2)
EventManager.Hit(EventId.ClosePanel, self:GetJointDrillBuildListPanelId())
EventManager.Hit(EventId.ClosePanel, self:GetJointDrillLevelSelectPanelId())
end
local msg = {
nType = AllEnum.MessageBox.Alert,
@@ -79,7 +79,10 @@ JointDrillRankingCtrl._mapNodeConfig = {
callback = "OnBtnClick_CloseReward"
}
}
JointDrillRankingCtrl._mapEventConfig = {}
JointDrillRankingCtrl._mapEventConfig = {
ShowTeamDetail = "OnEvent_ShowTeamDetail",
OpenRankBuildDetail = "OnEvent_OpenRankBuildDetail"
}
JointDrillRankingCtrl._mapRedDotConfig = {}
function JointDrillRankingCtrl:SetEndTime()
local actData = PlayerData.Activity:GetActivityDataById(self.nActId)
@@ -129,8 +132,19 @@ function JointDrillRankingCtrl:RefreshRankList()
else
self._mapNode.goLoading.gameObject:SetActive(false)
self._mapNode.goMainContent.gameObject:SetActive(true)
self._mapNode.svRankingInfo:SetAnim(0.1)
if self._panel.mapRankDetail == nil then
self._mapNode.svRankingInfo:SetAnim(0.1)
end
self._mapNode.svRankingInfo:Init(#self.mapRankList, self, self.RefreshRankGrid)
if self._panel.mapRankDetail ~= nil then
self._mapNode.svRankingInfo:SetScrollPos(self._panel.nGridPos)
self:AddTimer(1, 0.4, function()
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRankDetail_2, self._panel.mapRankDetail)
self._panel.mapRankDetail = nil
self._panel.nGridPos = 0
end, true, true, true)
EventManager.Hit(EventId.TemporaryBlockInput, 0.4)
end
end
end
function JointDrillRankingCtrl:RefreshSelfRank()
@@ -200,4 +214,11 @@ function JointDrillRankingCtrl:OnBtnClick_CloseReward()
self:AddTimer(1, 0.2, close, true, true, true)
EventManager.Hit(EventId.TemporaryBlockInput, 0.2)
end
function JointDrillRankingCtrl:OnEvent_ShowTeamDetail(rankData)
self.mapRankDetail = rankData
end
function JointDrillRankingCtrl:OnEvent_OpenRankBuildDetail()
self._panel.mapRankDetail = self.mapRankDetail
self._panel.nGridPos = self._mapNode.svRankingInfo:GetScrollPos()
end
return JointDrillRankingCtrl
@@ -7,6 +7,8 @@ JointDrillRankingPanel._tbDefine = {
}
}
function JointDrillRankingPanel:Awake()
self.mapRankDetail = nil
self.nGridPos = 0
end
function JointDrillRankingPanel:OnEnable()
end
@@ -183,6 +183,7 @@ function JointDrillRankItemCtrl:OnBtnClick_TeamDetail()
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("JointDrill_Rank_Detail_Empty"))
return
end
EventManager.Hit("ShowTeamDetail", self.mapRankData)
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRankDetail_2, self.mapRankData)
end
return JointDrillRankItemCtrl
@@ -200,7 +200,7 @@ function JointDrillResultCtrl:OpenReward()
self:ClosePanel()
end
local callback = function()
if self.nResultType == AllEnum.JointDrillResultType.Success or self.nResultType == AllEnum.JointDrillResultType.ChallengeEnd and self.mapScore ~= nil and next(self.mapScore) ~= nil then
if (self.nResultType == AllEnum.JointDrillResultType.Success or self.nResultType == AllEnum.JointDrillResultType.ChallengeEnd) and self.mapScore ~= nil and next(self.mapScore) ~= nil then
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillRankUp_2, self.nOld, self.nNew, self.mapScore, self.nResultType, closeCallback)
else
closeCallback()
@@ -18,6 +18,10 @@ JointDrillTeamItemCtrl._mapNodeConfig = {
nCount = 2,
sComponentName = "TMP_Text",
sLanguageId = "Build_Sub"
},
btnDetail = {
sComponentName = "UIButton",
callback = "OnBtnClick_Detail"
}
}
JointDrillTeamItemCtrl._mapEventConfig = {}
@@ -36,6 +40,7 @@ function JointDrillTeamItemCtrl:GetBuildRank(nScore)
return curIdx
end
function JointDrillTeamItemCtrl:RefreshItem(mapTeam, nIndex)
self.mapTeam = mapTeam
local sIndex = ConfigTable.GetUIText("JointDrill_Battle_Time_" .. nIndex)
NovaAPI.SetTMPText(self._mapNode.txtTeam, orderedFormat(ConfigTable.GetUIText("JointDrill_Rank_Build_Count"), sIndex))
for i = 1, 3 do
@@ -54,6 +59,19 @@ function JointDrillTeamItemCtrl:RefreshItem(mapTeam, nIndex)
local nScore = self:GetBuildRank(mapTeam.BuildScore)
self:SetPngSprite(self._mapNode.imgScoreIcon, "Icon/BuildRank/BuildRank_" .. nScore)
end
function JointDrillTeamItemCtrl:OnBtnClick_Detail()
if self.mapTeam.Discs == nil or #self.mapTeam.Discs == 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Rank_Build_Detail_Unavailable"))
return
end
EventManager.Hit("OpenRankBuildDetail")
EventManager.Hit(EventId.OpenPanel, PanelId.RankBuildDetail, self.mapTeam)
local wait = function()
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillRankDetail_2)
end
cs_coroutine.start(wait)
end
function JointDrillTeamItemCtrl:Awake()
end
function JointDrillTeamItemCtrl:OnEnable()