主题活动修改
parent
2b6705f176
commit
97bb590c24
|
|
@ -105,6 +105,7 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function DynamicActivityPanel:AddListener()
|
function DynamicActivityPanel:AddListener()
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, this.RefreshActivityBtn)
|
||||||
for i = 1, #this.PageList do
|
for i = 1, #this.PageList do
|
||||||
if this.PageList[i] then
|
if this.PageList[i] then
|
||||||
this.PageList[i]:AddListener()
|
this.PageList[i]:AddListener()
|
||||||
|
|
@ -114,6 +115,7 @@ end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function DynamicActivityPanel:RemoveListener()
|
function DynamicActivityPanel:RemoveListener()
|
||||||
|
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.RefreshActivityBtn)
|
||||||
for i = 1, #this.PageList do
|
for i = 1, #this.PageList do
|
||||||
if this.PageList[i] then
|
if this.PageList[i] then
|
||||||
this.PageList[i]:RemoveListener()
|
this.PageList[i]:RemoveListener()
|
||||||
|
|
@ -121,6 +123,12 @@ function DynamicActivityPanel:RemoveListener()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
this.RefreshActivityBtn = function()
|
||||||
|
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.DynamicAct) then
|
||||||
|
this:ClosePanel()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function DynamicActivityPanel:OnOpen(chooseIndex)
|
function DynamicActivityPanel:OnOpen(chooseIndex)
|
||||||
-- 初始化tab数据
|
-- 初始化tab数据
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,6 @@ function DynamicTaskPage:SetTime()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if week_timeDown <= 0 then
|
if week_timeDown <= 0 then
|
||||||
parent:ClosePanel()
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
for k,v in pairs(singleTaskPre) do
|
for k,v in pairs(singleTaskPre) do
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,9 @@ function LeiJiChongZhiPage:SetTime()
|
||||||
self.timer = Timer.New(function()
|
self.timer = Timer.New(function()
|
||||||
timeDown = timeDown - 1
|
timeDown = timeDown - 1
|
||||||
if timeDown < 1 then
|
if timeDown < 1 then
|
||||||
parent:ClosePanel()
|
self.timer:Stop()
|
||||||
|
self.timer = nil
|
||||||
|
this.time.text = Language[10028]..TimeToDHMS(0)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
this.time.text = Language[10028]..TimeToDHMS(timeDown)
|
this.time.text = Language[10028]..TimeToDHMS(timeDown)
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,6 @@ function QianKunBox:timeCountDown()
|
||||||
if timeDown < 1 then
|
if timeDown < 1 then
|
||||||
self.timer:Stop()
|
self.timer:Stop()
|
||||||
self.timer = nil
|
self.timer = nil
|
||||||
parent:ClosePanel()
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
timeDown = timeDown -1
|
timeDown = timeDown -1
|
||||||
|
|
@ -266,7 +265,7 @@ end
|
||||||
function QianKunBox:TimeToDHMS(second)
|
function QianKunBox:TimeToDHMS(second)
|
||||||
local day = math.floor(second / (24 * 3600))
|
local day = math.floor(second / (24 * 3600))
|
||||||
local minute = math.floor(second / 60) % 60
|
local minute = math.floor(second / 60) % 60
|
||||||
local sec = second % 60
|
local sec = math.floor(second % 60)
|
||||||
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
||||||
if day <= 0 and hour <= 0 then
|
if day <= 0 and hour <= 0 then
|
||||||
return string.format(Language[12231],minute, sec)
|
return string.format(Language[12231],minute, sec)
|
||||||
|
|
|
||||||
|
|
@ -248,15 +248,22 @@ function TimeLimitedCall:RefreshNextLevelReward()
|
||||||
|
|
||||||
self.recruitTimesUpdate.text = string.format(Language[12229],reMaintimes)
|
self.recruitTimesUpdate.text = string.format(Language[12229],reMaintimes)
|
||||||
|
|
||||||
info = info.endTime - PlayerManager.serverTime
|
local timeDown = info.endTime - PlayerManager.serverTime
|
||||||
info = self:TimeToDHMS(info)
|
self.recruitTimeUpdate.text = string.format(Language[12230]..self:TimeToDHMS(timeDown))
|
||||||
self.recruitTimeUpdate.text = string.format(Language[12230]..info)
|
Timer.New(function()
|
||||||
|
if timeDown < 1 then
|
||||||
|
self.recruitTimeUpdate.text = string.format(Language[12230]..self:TimeToDHMS(0))
|
||||||
|
else
|
||||||
|
timeDown = timeDown - 1
|
||||||
|
self.recruitTimeUpdate.text = string.format(Language[12230]..self:TimeToDHMS(timeDown))
|
||||||
|
end
|
||||||
|
end, 1, -1, true):Start()
|
||||||
end
|
end
|
||||||
--- 将一段时间转换为天时分秒
|
--- 将一段时间转换为天时分秒
|
||||||
function TimeLimitedCall:TimeToDHMS(second)
|
function TimeLimitedCall:TimeToDHMS(second)
|
||||||
local day = math.floor(second / (24 * 3600))
|
local day = math.floor(second / (24 * 3600))
|
||||||
local minute = math.floor(second / 60) % 60
|
local minute = math.floor(second / 60) % 60
|
||||||
local sec = second % 60
|
local sec = math.floor(second % 60)
|
||||||
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
||||||
if day <= 0 and hour <= 0 then
|
if day <= 0 and hour <= 0 then
|
||||||
return string.format(Language[12231],minute, sec)
|
return string.format(Language[12231],minute, sec)
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,9 @@ function XianShiShangShi:SetTime()
|
||||||
self.timer = Timer.New(function()
|
self.timer = Timer.New(function()
|
||||||
timeDown = timeDown - 1
|
timeDown = timeDown - 1
|
||||||
if timeDown < 1 then
|
if timeDown < 1 then
|
||||||
parent:ClosePanel()
|
self.timer:Stop()
|
||||||
|
self.timer = nil
|
||||||
|
this.time.text = Language[12321]..TimeToDHMS(0)
|
||||||
end
|
end
|
||||||
this.time.text = Language[12321]..TimeToDHMS(timeDown)
|
this.time.text = Language[12321]..TimeToDHMS(timeDown)
|
||||||
end, 1, -1, true)
|
end, 1, -1, true)
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,9 @@ function ZhenQiYiBaoPage:SetTime()
|
||||||
self.timer = Timer.New(function()
|
self.timer = Timer.New(function()
|
||||||
timeDown = timeDown - 1
|
timeDown = timeDown - 1
|
||||||
if timeDown < 1 then
|
if timeDown < 1 then
|
||||||
parent:ClosePanel()
|
self.timer:Stop()
|
||||||
|
self.timer = nil
|
||||||
|
this.time.text = Language[12321]..TimeToDHMS(0)
|
||||||
end
|
end
|
||||||
this.time.text = Language[12321]..TimeToDHMS(timeDown)
|
this.time.text = Language[12321]..TimeToDHMS(timeDown)
|
||||||
end, 1, -1, true)
|
end, 1, -1, true)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue