Initial version - 1.2.0.60

EN: 1.2.0.60
CN: 1.2.0.61
JP: 1.2.0.63
KR: 1.2.0.67
This commit is contained in:
SL1900
2025-12-03 01:00:00 +09:00
commit 5e0d58cfad
3595 changed files with 9373562 additions and 0 deletions
@@ -0,0 +1,156 @@
local ActivityDream_10102PopUpCtrl = class("ActivityDream_10102PopUpCtrl", BaseCtrl)
local TimerManager = require("GameCore.Timer.TimerManager")
local LocalData = require("GameCore.Data.LocalData")
local ClientManager = CS.ClientManager.Instance
ActivityDream_10102PopUpCtrl._mapNodeConfig = {
goContent = {
sNodeName = "---Common---"
},
btnGo = {
sComponentName = "UIButton",
callback = "OnBtnClick_Goto"
},
txtBtnGo = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_PopUp_Goto"
},
btnClose = {
sComponentName = "UIButton",
callback = "OnBtnClick_Close"
},
txtDate = {sComponentName = "TMP_Text"},
txtTime = {sComponentName = "TMP_Text"},
btnDontShow = {
sComponentName = "UIButton",
callback = "OnBtnClick_DontShowAgain"
},
imgDontShow1 = {},
imgDontShow2 = {},
txtDontShow = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_DontShow_PopUp_Again"
}
}
ActivityDream_10102PopUpCtrl._mapEventConfig = {}
function ActivityDream_10102PopUpCtrl:ShowPopUp(actId, callback, index)
self.popUpIndex = index
self.dontShowAgain = false
self.nCurActId = actId
self.callback = callback
self.actGroupCfg = ConfigTable.GetData("ActivityGroup", self.nCurActId)
self.nOpenTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actGroupCfg.StartTime)
self.nEndTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actGroupCfg.EndTime)
self:RefreshTimeout()
self:RefreshDate()
if nil == self.remainTimer then
self.remainTimer = self:AddTimer(0, 1, "RefreshTimeout", true, true, true)
end
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
self.anim = self.gameObject:GetComponent("Animator")
self:PlayOpenAnim()
end
function ActivityDream_10102PopUpCtrl:PlayOpenAnim()
if self.anim then
self.anim:Play("open", 0, 0)
end
end
function ActivityDream_10102PopUpCtrl:RefreshDate()
local nOpenMonth = tonumber(os.date("%m", self.nOpenTime))
local nOpenDay = tonumber(os.date("%d", self.nOpenTime))
local nEndMonth = tonumber(os.date("%m", self.nEndTime))
local nEndDay = tonumber(os.date("%d", self.nEndTime))
local strOpenDay = string.format("%02d", nOpenDay)
local strEndDay = string.format("%02d", nEndDay)
local dateStr = string.format("%s/%s ~ %s/%s", nOpenMonth, strOpenDay, nEndMonth, strEndDay)
NovaAPI.SetTMPText(self._mapNode.txtDate, dateStr)
end
function ActivityDream_10102PopUpCtrl:RefreshTimeout()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime < 0 then
if self.remainTimer ~= nil then
self.remainTimer:Cancel()
self.remainTimer = nil
end
return
end
local sTimeStr = ""
if remainTime <= 60 then
local sec = math.floor(remainTime)
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Sec") or "", sec)
elseif 60 < remainTime and remainTime <= 3600 then
local min = math.floor(remainTime / 60)
local sec = math.floor(remainTime - min * 60)
if sec == 0 then
min = min - 1
sec = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Min") or "", min, sec)
elseif 3600 < remainTime and remainTime <= 86400 then
local hour = math.floor(remainTime / 3600)
local min = math.floor((remainTime - hour * 3600) / 60)
if min == 0 then
hour = hour - 1
min = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Hour") or "", hour, min)
elseif 86400 < remainTime then
local day = math.floor(remainTime / 86400)
local hour = math.floor((remainTime - day * 86400) / 3600)
if hour == 0 then
day = day - 1
hour = 24
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Day") or "", day, hour)
end
NovaAPI.SetTMPText(self._mapNode.txtTime, sTimeStr)
end
function ActivityDream_10102PopUpCtrl:OnBtnClick_DontShowAgain()
self.dontShowAgain = not self.dontShowAgain
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
LocalData.SetPlayerLocalData("Act_PopUp_DontShow" .. self.nCurActId, self.dontShowAgain)
end
function ActivityDream_10102PopUpCtrl:OnBtnClick_Close()
if self.callback ~= nil then
if self.anim then
self.anim:Play("close")
self:AddTimer(1, 0.2, function()
self.callback()
end, true, true, true)
else
self.callback()
end
end
end
function ActivityDream_10102PopUpCtrl:OnBtnClick_Goto()
if nil ~= self.nCurActId then
PopUpManager.InterruptPopUp(self.popUpIndex)
PlayerData.Activity:SendActivityDetailMsg()
self.anim:Play("close")
self:AddTimer(1, 0.2, function()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime <= 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Activity_Invalid_Tip_3"))
if self.callback ~= nil then
self.callback()
end
return
end
EventManager.Hit(EventId.ClosePanel, PanelId.ActivityPopUp)
if self.actGroupCfg.TransitionId ~= nil and 0 < self.actGroupCfg.TransitionId then
local callback = function()
EventManager.Hit(EventId.OpenPanel, self.actGroupCfg.PanelId, self.actGroupCfg.Id)
end
EventManager.Hit(EventId.SetTransition, self.actGroupCfg.TransitionId, callback)
else
EventManager.Hit(EventId.OpenPanel, self.actGroupCfg.PanelId, self.actGroupCfg.Id)
end
end, true, true, true)
end
end
return ActivityDream_10102PopUpCtrl
@@ -0,0 +1,157 @@
local ActivityJointDrillPopUpCtrl = class("ActivityJointDrillPopUpCtrl", BaseCtrl)
local TimerManager = require("GameCore.Timer.TimerManager")
local LocalData = require("GameCore.Data.LocalData")
local ClientManager = CS.ClientManager.Instance
ActivityJointDrillPopUpCtrl._mapNodeConfig = {
goContent = {
sNodeName = "---Common---"
},
btnGo = {
sComponentName = "UIButton",
callback = "OnBtnClick_Goto"
},
txtBtnGo = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_PopUp_Goto_1"
},
btnClose = {
sComponentName = "UIButton",
callback = "OnBtnClick_Close"
},
txtDate = {sComponentName = "TMP_Text"},
txtTime = {sComponentName = "TMP_Text"},
btnDontShow = {
sComponentName = "UIButton",
callback = "OnBtnClick_DontShowAgain"
},
imgDontShow1 = {},
imgDontShow2 = {},
txtDontShow = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_DontShow_PopUp_Again"
},
txtBeta = {
sComponentName = "TMP_Text",
sLanguageId = "JointDrill_Beta_Tip"
}
}
ActivityJointDrillPopUpCtrl._mapEventConfig = {}
function ActivityJointDrillPopUpCtrl:ShowPopUp(actId, callback, index)
self.popUpIndex = index
self.dontShowAgain = false
self.nCurActId = actId
self.callback = callback
self.actCfg = ConfigTable.GetData("Activity", self.nCurActId)
self.nOpenTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actCfg.StartTime)
self.nEndTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actCfg.EndTime)
self:RefreshTimeout()
self:RefreshDate()
if nil == self.remainTimer then
self.remainTimer = self:AddTimer(0, 1, "RefreshTimeout", true, true, true)
end
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
self.anim = self.gameObject:GetComponent("Animator")
self:PlayOpenAnim()
end
function ActivityJointDrillPopUpCtrl:PlayOpenAnim()
if self.anim then
self.anim:Play("open", 0, 0)
end
end
function ActivityJointDrillPopUpCtrl:RefreshDate()
local nOpenMonth = tonumber(os.date("%m", self.nOpenTime))
local nOpenDay = tonumber(os.date("%d", self.nOpenTime))
local nEndMonth = tonumber(os.date("%m", self.nEndTime))
local nEndDay = tonumber(os.date("%d", self.nEndTime))
local strOpenDay = string.format("%02d", nOpenDay)
local strEndDay = string.format("%02d", nEndDay)
local dateStr = string.format("%s/%s ~ %s/%s", nOpenMonth, strOpenDay, nEndMonth, strEndDay)
NovaAPI.SetTMPText(self._mapNode.txtDate, dateStr)
end
function ActivityJointDrillPopUpCtrl:RefreshTimeout()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime < 0 then
if self.remainTimer ~= nil then
self.remainTimer:Cancel()
self.remainTimer = nil
end
return
end
local sTimeStr = ""
if remainTime <= 60 then
local sec = math.floor(remainTime)
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Sec") or "", sec)
elseif 60 < remainTime and remainTime <= 3600 then
local min = math.floor(remainTime / 60)
local sec = math.floor(remainTime - min * 60)
if sec == 0 then
min = min - 1
sec = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Min") or "", min, sec)
elseif 3600 < remainTime and remainTime <= 86400 then
local hour = math.floor(remainTime / 3600)
local min = math.floor((remainTime - hour * 3600) / 60)
if min == 0 then
hour = hour - 1
min = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Hour") or "", hour, min)
elseif 86400 < remainTime then
local day = math.floor(remainTime / 86400)
local hour = math.floor((remainTime - day * 86400) / 3600)
if hour == 0 then
day = day - 1
hour = 24
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Day") or "", day, hour)
end
NovaAPI.SetTMPText(self._mapNode.txtTime, sTimeStr)
end
function ActivityJointDrillPopUpCtrl:ClosePopUp(callback)
if self.anim ~= nil then
self.anim:Play("close", 0, 0)
self:AddTimer(1, 0.1, function()
if callback ~= nil then
callback()
end
end, true, true, true)
EventManager.Hit(EventId.TemporaryBlockInput, 0.1)
elseif callback ~= nil then
callback()
end
end
function ActivityJointDrillPopUpCtrl:OnBtnClick_DontShowAgain()
self.dontShowAgain = not self.dontShowAgain
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
LocalData.SetPlayerLocalData("Act_PopUp_DontShow" .. self.nCurActId, self.dontShowAgain)
end
function ActivityJointDrillPopUpCtrl:OnBtnClick_Close()
self:ClosePopUp(self.callback)
end
function ActivityJointDrillPopUpCtrl:OnBtnClick_Goto()
local callback = function()
if nil ~= self.nCurActId then
PopUpManager.InterruptPopUp(self.popUpIndex)
PlayerData.Activity:SendActivityDetailMsg()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime <= 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Activity_Invalid_Tip_3"))
if self.callback ~= nil then
self.callback()
end
return
end
EventManager.Hit(EventId.ClosePanel, PanelId.ActivityPopUp)
EventManager.Hit(EventId.OpenPanel, PanelId.ActivityList, self.nCurActId)
end
end
self:ClosePopUp(callback)
end
return ActivityJointDrillPopUpCtrl
@@ -0,0 +1,156 @@
local ActivityOurRegiment_10101PopUpCtrl = class("ActivityOurRegiment_10101PopUpCtrl", BaseCtrl)
local TimerManager = require("GameCore.Timer.TimerManager")
local LocalData = require("GameCore.Data.LocalData")
local ClientManager = CS.ClientManager.Instance
ActivityOurRegiment_10101PopUpCtrl._mapNodeConfig = {
goContent = {
sNodeName = "---Common---"
},
btnGo = {
sComponentName = "UIButton",
callback = "OnBtnClick_Goto"
},
txtBtnGo = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_PopUp_Goto"
},
btnClose = {
sComponentName = "UIButton",
callback = "OnBtnClick_Close"
},
txtDate = {sComponentName = "TMP_Text"},
txtTime = {sComponentName = "TMP_Text"},
btnDontShow = {
sComponentName = "UIButton",
callback = "OnBtnClick_DontShowAgain"
},
imgDontShow1 = {},
imgDontShow2 = {},
txtDontShow = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_DontShow_PopUp_Again"
}
}
ActivityOurRegiment_10101PopUpCtrl._mapEventConfig = {}
function ActivityOurRegiment_10101PopUpCtrl:ShowPopUp(actId, callback, index)
self.popUpIndex = index
self.dontShowAgain = false
self.nCurActId = actId
self.callback = callback
self.actGroupCfg = ConfigTable.GetData("ActivityGroup", self.nCurActId)
self.nOpenTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actGroupCfg.StartTime)
self.nEndTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actGroupCfg.EndTime)
self:RefreshTimeout()
self:RefreshDate()
if nil == self.remainTimer then
self.remainTimer = self:AddTimer(0, 1, "RefreshTimeout", true, true, true)
end
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
self.anim = self.gameObject:GetComponent("Animator")
self:PlayOpenAnim()
end
function ActivityOurRegiment_10101PopUpCtrl:PlayOpenAnim()
if self.anim then
self.anim:Play("open", 0, 0)
end
end
function ActivityOurRegiment_10101PopUpCtrl:RefreshDate()
local nOpenMonth = tonumber(os.date("%m", self.nOpenTime))
local nOpenDay = tonumber(os.date("%d", self.nOpenTime))
local nEndMonth = tonumber(os.date("%m", self.nEndTime))
local nEndDay = tonumber(os.date("%d", self.nEndTime))
local strOpenDay = string.format("%02d", nOpenDay)
local strEndDay = string.format("%02d", nEndDay)
local dateStr = string.format("%s/%s ~ %s/%s", nOpenMonth, strOpenDay, nEndMonth, strEndDay)
NovaAPI.SetTMPText(self._mapNode.txtDate, dateStr)
end
function ActivityOurRegiment_10101PopUpCtrl:RefreshTimeout()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime < 0 then
if self.remainTimer ~= nil then
self.remainTimer:Cancel()
self.remainTimer = nil
end
return
end
local sTimeStr = ""
if remainTime <= 60 then
local sec = math.floor(remainTime)
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Sec") or "", sec)
elseif 60 < remainTime and remainTime <= 3600 then
local min = math.floor(remainTime / 60)
local sec = math.floor(remainTime - min * 60)
if sec == 0 then
min = min - 1
sec = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Min") or "", min, sec)
elseif 3600 < remainTime and remainTime <= 86400 then
local hour = math.floor(remainTime / 3600)
local min = math.floor((remainTime - hour * 3600) / 60)
if min == 0 then
hour = hour - 1
min = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Hour") or "", hour, min)
elseif 86400 < remainTime then
local day = math.floor(remainTime / 86400)
local hour = math.floor((remainTime - day * 86400) / 3600)
if hour == 0 then
day = day - 1
hour = 24
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Day") or "", day, hour)
end
NovaAPI.SetTMPText(self._mapNode.txtTime, sTimeStr)
end
function ActivityOurRegiment_10101PopUpCtrl:OnBtnClick_DontShowAgain()
self.dontShowAgain = not self.dontShowAgain
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
LocalData.SetPlayerLocalData("Act_PopUp_DontShow" .. self.nCurActId, self.dontShowAgain)
end
function ActivityOurRegiment_10101PopUpCtrl:OnBtnClick_Close()
if self.callback ~= nil then
if self.anim then
self.anim:Play("close")
self:AddTimer(1, 0.2, function()
self.callback()
end, true, true, true)
else
self.callback()
end
end
end
function ActivityOurRegiment_10101PopUpCtrl:OnBtnClick_Goto()
if nil ~= self.nCurActId then
PopUpManager.InterruptPopUp(self.popUpIndex)
PlayerData.Activity:SendActivityDetailMsg()
self.anim:Play("close")
self:AddTimer(1, 0.2, function()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime <= 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Activity_Invalid_Tip_3"))
if self.callback ~= nil then
self.callback()
end
return
end
EventManager.Hit(EventId.ClosePanel, PanelId.ActivityPopUp)
if self.actGroupCfg.TransitionId ~= nil and 0 < self.actGroupCfg.TransitionId then
local callback = function()
EventManager.Hit(EventId.OpenPanel, self.actGroupCfg.PanelId, self.actGroupCfg.Id)
end
EventManager.Hit(EventId.SetTransition, self.actGroupCfg.TransitionId, callback)
else
EventManager.Hit(EventId.OpenPanel, self.actGroupCfg.PanelId, self.actGroupCfg.Id)
end
end, true, true, true)
end
end
return ActivityOurRegiment_10101PopUpCtrl
@@ -0,0 +1,156 @@
local ActivitySwimPopUpCtrl = class("ActivitySwimPopUpCtrl", BaseCtrl)
local TimerManager = require("GameCore.Timer.TimerManager")
local LocalData = require("GameCore.Data.LocalData")
local ClientManager = CS.ClientManager.Instance
ActivitySwimPopUpCtrl._mapNodeConfig = {
goContent = {
sNodeName = "---Common---"
},
btnGo = {
sComponentName = "UIButton",
callback = "OnBtnClick_Goto"
},
txtBtnGo = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_PopUp_Goto"
},
btnClose = {
sComponentName = "UIButton",
callback = "OnBtnClick_Close"
},
txtDate = {sComponentName = "TMP_Text"},
txtTime = {sComponentName = "TMP_Text"},
btnDontShow = {
sComponentName = "UIButton",
callback = "OnBtnClick_DontShowAgain"
},
imgDontShow1 = {},
imgDontShow2 = {},
txtDontShow = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_DontShow_PopUp_Again"
}
}
ActivitySwimPopUpCtrl._mapEventConfig = {}
function ActivitySwimPopUpCtrl:ShowPopUp(actId, callback, index)
self.popUpIndex = index
self.dontShowAgain = false
self.nCurActId = actId
self.callback = callback
self.actGroupCfg = ConfigTable.GetData("ActivityGroup", self.nCurActId)
self.nOpenTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actGroupCfg.StartTime)
self.nEndTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actGroupCfg.EndTime)
self:RefreshTimeout()
self:RefreshDate()
if nil == self.remainTimer then
self.remainTimer = self:AddTimer(0, 1, "RefreshTimeout", true, true, true)
end
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
self.anim = self.gameObject:GetComponent("Animator")
self:PlayOpenAnim()
end
function ActivitySwimPopUpCtrl:PlayOpenAnim()
if self.anim then
self.anim:Play("open", 0, 0)
end
end
function ActivitySwimPopUpCtrl:RefreshDate()
local nOpenMonth = tonumber(os.date("%m", self.nOpenTime))
local nOpenDay = tonumber(os.date("%d", self.nOpenTime))
local nEndMonth = tonumber(os.date("%m", self.nEndTime))
local nEndDay = tonumber(os.date("%d", self.nEndTime))
local strOpenDay = string.format("%02d", nOpenDay)
local strEndDay = string.format("%02d", nEndDay)
local dateStr = string.format("%s/%s ~ %s/%s", nOpenMonth, strOpenDay, nEndMonth, strEndDay)
NovaAPI.SetTMPText(self._mapNode.txtDate, dateStr)
end
function ActivitySwimPopUpCtrl:RefreshTimeout()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime < 0 then
if self.remainTimer ~= nil then
self.remainTimer:Cancel()
self.remainTimer = nil
end
return
end
local sTimeStr = ""
if remainTime <= 60 then
local sec = math.floor(remainTime)
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Sec") or "", sec)
elseif 60 < remainTime and remainTime <= 3600 then
local min = math.floor(remainTime / 60)
local sec = math.floor(remainTime - min * 60)
if sec == 0 then
min = min - 1
sec = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Min") or "", min, sec)
elseif 3600 < remainTime and remainTime <= 86400 then
local hour = math.floor(remainTime / 3600)
local min = math.floor((remainTime - hour * 3600) / 60)
if min == 0 then
hour = hour - 1
min = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Hour") or "", hour, min)
elseif 86400 < remainTime then
local day = math.floor(remainTime / 86400)
local hour = math.floor((remainTime - day * 86400) / 3600)
if hour == 0 then
day = day - 1
hour = 24
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Day") or "", day, hour)
end
NovaAPI.SetTMPText(self._mapNode.txtTime, sTimeStr)
end
function ActivitySwimPopUpCtrl:OnBtnClick_DontShowAgain()
self.dontShowAgain = not self.dontShowAgain
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
LocalData.SetPlayerLocalData("Act_PopUp_DontShow" .. self.nCurActId, self.dontShowAgain)
end
function ActivitySwimPopUpCtrl:OnBtnClick_Close()
if self.callback ~= nil then
if self.anim then
self.anim:Play("close")
self:AddTimer(1, 0.2, function()
self.callback()
end, true, true, true)
else
self.callback()
end
end
end
function ActivitySwimPopUpCtrl:OnBtnClick_Goto()
if nil ~= self.nCurActId then
PopUpManager.InterruptPopUp(self.popUpIndex)
PlayerData.Activity:SendActivityDetailMsg()
self.anim:Play("close")
self:AddTimer(1, 0.2, function()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime <= 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Activity_Invalid_Tip_3"))
if self.callback ~= nil then
self.callback()
end
return
end
EventManager.Hit(EventId.ClosePanel, PanelId.ActivityPopUp)
if self.actGroupCfg.TransitionId ~= nil and 0 < self.actGroupCfg.TransitionId then
local callback = function()
EventManager.Hit(EventId.OpenPanel, self.actGroupCfg.PanelId, self.actGroupCfg.Id)
end
EventManager.Hit(EventId.SetTransition, self.actGroupCfg.TransitionId, callback)
else
EventManager.Hit(EventId.OpenPanel, self.actGroupCfg.PanelId, self.actGroupCfg.Id)
end
end, true, true, true)
end
end
return ActivitySwimPopUpCtrl
@@ -0,0 +1,164 @@
local ActivityTaskPopUpCtrl_01 = class("ActivityTaskPopUpCtrl_01", BaseCtrl)
local GameResourceLoader = require("Game.Common.Resource.GameResourceLoader")
ActivityTaskPopUpCtrl_01._mapNodeConfig = {
imgActivity = {sComponentName = "Image"},
goTaskList = {},
goTaskItem = {
nCount = 7,
sCtrlName = "Game.UI.Activity.ActivityTask.ActivityTaskItemCtrl_01"
},
btnItem = {
nCount = 7,
sComponentName = "UIButton",
callback = "OnBtnClick_Item"
},
btnTask = {
nCount = 7,
sComponentName = "UIButton",
callback = "OnBtnClick_Task"
},
txtTips = {
sComponentName = "TMP_Text",
sLanguageId = "LoginReward_PopUp_Tip"
},
btnReceive = {
sComponentName = "UIButton",
callback = "OnBtnClick_Receive"
},
txtActivityTime = {
sComponentName = "TMP_Text",
sLanguageId = "Energy_Item_Permanent_Time"
}
}
ActivityTaskPopUpCtrl_01._mapEventConfig = {
RefreshActivityTask = "OnEvent_RefreshActivityTask"
}
ActivityTaskPopUpCtrl_01._mapRedDotConfig = {}
function ActivityTaskPopUpCtrl_01:ShowPopUp(actId, callback, index)
self.popUpIndex = index
self.nCurActId = actId
self.callback = callback
self.actData = PlayerData.Activity:GetActivityDataById(self.nCurActId)
self:RefreshTaskList()
self.anim = self.gameObject:GetComponent("Animator")
self:PlayOpenAnim()
end
function ActivityTaskPopUpCtrl_01:RefreshTaskList()
self.tbTaskList = {}
self.tbRewardList = {}
self.nGroupId = 0
local tbTaskGroup, tbTaskList = self.actData:GetAllTaskList()
for nGroupId, tbTask in pairs(tbTaskGroup) do
self.nGroupId = nGroupId
for _, nId in ipairs(tbTask) do
local mapQuest = tbTaskList[nId]
if mapQuest ~= nil then
local mapData = {
nId = nId,
nStatus = mapQuest.nStatus,
nExpire = mapQuest.nExpire,
nCur = mapQuest.nCur,
nMax = mapQuest.nMax
}
table.insert(self.tbTaskList, mapData)
end
local mapCfg = ConfigTable.GetData("ActivityTask", nId)
if mapCfg ~= nil and mapCfg.Tid1 ~= 0 then
table.insert(self.tbRewardList, mapCfg.Tid1)
end
end
end
table.sort(self.tbTaskList, function(a, b)
return a.nId < b.nId
end)
for k, v in ipairs(self._mapNode.goTaskItem) do
local mapQuestData = self.tbTaskList[k]
v.gameObject:SetActive(mapQuestData ~= nil)
if mapQuestData ~= nil then
v:SetTaskItem(mapQuestData)
if self._mapNode.btnItem[k] ~= nil then
NovaAPI.SetRaycastTarget(self._mapNode.btnItem[k].gameObject, mapQuestData.nStatus ~= AllEnum.ActQuestStatus.Complete)
end
end
end
end
function ActivityTaskPopUpCtrl_01:PlayOpenAnim()
if self.animRoot ~= nil then
local nAnimLength = NovaAPI.GetAnimClipLength(self.animRoot, {
"ActivityContent_2_in"
})
self.animRoot:Play("ActivityContent_2_in")
EventManager.Hit(EventId.TemporaryBlockInput, nAnimLength)
end
end
function ActivityTaskPopUpCtrl_01:Close()
if self.callback ~= nil then
if self.anim then
local nAnimLength = NovaAPI.GetAnimClipLength(self.anim, {
"ActivityTask_01_out"
})
self.anim:Play("ActivityTask_01_out")
EventManager.Hit(EventId.TemporaryBlockInput, nAnimLength)
self:AddTimer(1, nAnimLength, function()
self.callback()
end, true, true, true)
else
self.callback()
end
end
end
function ActivityTaskPopUpCtrl_01:Awake()
end
function ActivityTaskPopUpCtrl_01:OnEnable()
end
function ActivityTaskPopUpCtrl_01:OnDisable()
end
function ActivityTaskPopUpCtrl_01:OnDestroy()
end
function ActivityTaskPopUpCtrl_01:OnBtnClick_Item(btn, nIndex)
if self.tbRewardList[nIndex] ~= nil then
UTILS.ClickItemGridWithTips(self.tbRewardList[nIndex], btn.gameObject.transform, true, true, false)
end
end
function ActivityTaskPopUpCtrl_01:OnBtnClick_Task(btn, nIndex)
if self.tbTaskList ~= nil and self.tbTaskList[nIndex] ~= nil then
local mapQuest = self.tbTaskList[nIndex]
if mapQuest.nStatus == AllEnum.ActQuestStatus.Complete then
local mapGroupCfg = ConfigTable.GetData("ActivityTaskGroup", self.nGroupId)
if self.actData ~= nil and mapGroupCfg ~= nil then
local callback = function()
self:RefreshTaskList()
RedDotManager.SetValid(RedDotDefine.Activity_Tab, self.nCurActId, false)
end
self.actData:SendMsg_ActivityTaskRewardReceiveReq(self.nGroupId, mapQuest.nId, mapGroupCfg.TaskTabType, callback)
end
elseif mapQuest.nStatus == AllEnum.ActQuestStatus.UnComplete then
end
end
end
function ActivityTaskPopUpCtrl_01:OnBtnClick_Receive()
local bCanReceive = false
for _, v in ipairs(self.tbTaskList) do
if v.nStatus == AllEnum.ActQuestStatus.Complete then
bCanReceive = true
break
end
end
if bCanReceive then
local mapGroupCfg = ConfigTable.GetData("ActivityTaskGroup", self.nGroupId)
if self.actData ~= nil and mapGroupCfg ~= nil then
local callback = function()
self:RefreshTaskList()
RedDotManager.SetValid(RedDotDefine.Activity_Tab, self.nCurActId, false)
self:Close()
end
self.actData:SendMsg_ActivityTaskRewardReceiveReq(self.nGroupId, 0, mapGroupCfg.TaskTabType, callback)
end
else
self:Close()
end
end
function ActivityTaskPopUpCtrl_01:OnEvent_RefreshActivityTask()
self:RefreshTaskList()
end
return ActivityTaskPopUpCtrl_01
@@ -0,0 +1,153 @@
local ActivityTowerDefensePopUpCtrl = class("ActivityTowerDefensePopUpCtrl", BaseCtrl)
local TimerManager = require("GameCore.Timer.TimerManager")
local LocalData = require("GameCore.Data.LocalData")
local ClientManager = CS.ClientManager.Instance
ActivityTowerDefensePopUpCtrl._mapNodeConfig = {
goContent = {
sNodeName = "---Common---"
},
btnGo = {
sComponentName = "UIButton",
callback = "OnBtnClick_Goto"
},
txtBtnGo = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_PopUp_Goto_1"
},
btnClose = {
sComponentName = "UIButton",
callback = "OnBtnClick_Close"
},
txtDate = {sComponentName = "TMP_Text"},
txtTime = {sComponentName = "TMP_Text"},
btnDontShow = {
sComponentName = "UIButton",
callback = "OnBtnClick_DontShowAgain"
},
imgDontShow1 = {},
imgDontShow2 = {},
txtDontShow = {
sComponentName = "TMP_Text",
sLanguageId = "Activity_DontShow_PopUp_Again"
}
}
ActivityTowerDefensePopUpCtrl._mapEventConfig = {}
function ActivityTowerDefensePopUpCtrl:ShowPopUp(actId, callback, index)
self.popUpIndex = index
self.dontShowAgain = false
self.nCurActId = actId
self.callback = callback
self.actCfg = ConfigTable.GetData("Activity", self.nCurActId)
self.nOpenTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actCfg.StartTime)
self.nEndTime = CS.ClientManager.Instance:ISO8601StrToTimeStamp(self.actCfg.EndTime)
self:RefreshTimeout()
self:RefreshDate()
if nil == self.remainTimer then
self.remainTimer = self:AddTimer(0, 1, "RefreshTimeout", true, true, true)
end
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
self.anim = self.gameObject:GetComponent("Animator")
self:PlayOpenAnim()
end
function ActivityTowerDefensePopUpCtrl:PlayOpenAnim()
if self.anim then
self.anim:Play("open", 0, 0)
end
end
function ActivityTowerDefensePopUpCtrl:RefreshDate()
local nOpenMonth = tonumber(os.date("%m", self.nOpenTime))
local nOpenDay = tonumber(os.date("%d", self.nOpenTime))
local nEndMonth = tonumber(os.date("%m", self.nEndTime))
local nEndDay = tonumber(os.date("%d", self.nEndTime))
local strOpenDay = string.format("%02d", nOpenDay)
local strEndDay = string.format("%02d", nEndDay)
local dateStr = string.format("%s/%s ~ %s/%s", nOpenMonth, strOpenDay, nEndMonth, strEndDay)
NovaAPI.SetTMPText(self._mapNode.txtDate, dateStr)
end
function ActivityTowerDefensePopUpCtrl:RefreshTimeout()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime < 0 then
if self.remainTimer ~= nil then
self.remainTimer:Cancel()
self.remainTimer = nil
end
return
end
local sTimeStr = ""
if remainTime <= 60 then
local sec = math.floor(remainTime)
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Sec") or "", sec)
elseif 60 < remainTime and remainTime <= 3600 then
local min = math.floor(remainTime / 60)
local sec = math.floor(remainTime - min * 60)
if sec == 0 then
min = min - 1
sec = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Min") or "", min, sec)
elseif 3600 < remainTime and remainTime <= 86400 then
local hour = math.floor(remainTime / 3600)
local min = math.floor((remainTime - hour * 3600) / 60)
if min == 0 then
hour = hour - 1
min = 60
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Hour") or "", hour, min)
elseif 86400 < remainTime then
local day = math.floor(remainTime / 86400)
local hour = math.floor((remainTime - day * 86400) / 3600)
if hour == 0 then
day = day - 1
hour = 24
end
sTimeStr = orderedFormat(ConfigTable.GetUIText("Activity_Remain_Time_Day") or "", day, hour)
end
NovaAPI.SetTMPText(self._mapNode.txtTime, sTimeStr)
end
function ActivityTowerDefensePopUpCtrl:ClosePopUp(callback)
if self.anim ~= nil then
self.anim:Play("close", 0, 0)
self:AddTimer(1, 0.1, function()
if callback ~= nil then
callback()
end
end, true, true, true)
EventManager.Hit(EventId.TemporaryBlockInput, 0.1)
elseif callback ~= nil then
callback()
end
end
function ActivityTowerDefensePopUpCtrl:OnBtnClick_DontShowAgain()
self.dontShowAgain = not self.dontShowAgain
self._mapNode.imgDontShow1:SetActive(not self.dontShowAgain)
self._mapNode.imgDontShow2:SetActive(self.dontShowAgain)
LocalData.SetPlayerLocalData("Act_PopUp_DontShow" .. self.nCurActId, self.dontShowAgain)
end
function ActivityTowerDefensePopUpCtrl:OnBtnClick_Close()
self:ClosePopUp(self.callback)
end
function ActivityTowerDefensePopUpCtrl:OnBtnClick_Goto()
local callback = function()
if nil ~= self.nCurActId then
PopUpManager.InterruptPopUp(self.popUpIndex)
PlayerData.Activity:SendActivityDetailMsg()
local endTime = self.nEndTime
local curTime = ClientManager.serverTimeStamp
local remainTime = endTime - curTime
if remainTime <= 0 then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Activity_Invalid_Tip_3"))
if self.callback ~= nil then
self.callback()
end
return
end
EventManager.Hit(EventId.ClosePanel, PanelId.ActivityPopUp)
EventManager.Hit(EventId.OpenPanel, PanelId.ActivityList, self.nCurActId)
end
end
self:ClosePopUp(callback)
end
return ActivityTowerDefensePopUpCtrl