【ID1016422】

【无尽副本】自动恢复行动力倒计时结束后,行动力不增加
dev_chengFeng
jiaoyangna 2021-06-10 16:30:49 +08:00
parent 0458ee7bf7
commit 8115705d1a
1 changed files with 9 additions and 2 deletions

View File

@ -133,7 +133,6 @@ end
function this.InitActPowerShow()
local curEnergy = 0
curEnergy = BagManager.GetItemCountById(1)
local color = curEnergy <= 5 and "FF0014FF" or "A0B2B2FF"
local str = string.format("<color=#%s>%s</color>", color, tostring(curEnergy))
this.curValue.text = str
@ -214,12 +213,16 @@ function this.ShowCountTime()
this.timer = nil
this.actCountTime.text = ""
this.bgTime:SetActive(true)
local tempLeftTime = 0
-- 启动倒计时
this.timer = Timer.New(function ()
local leftTime = AutoRecoverManager.GetRecoverTime(1)
if leftTime >= tempLeftTime then
this.InitActPowerShow()
tempLeftTime = leftTime
end
if leftTime < 0 then
leftTime = 0
this.InitActPowerShow()
end
this.actCountTime.text = GetTimeMaoHaoStrBySeconds(math.floor(leftTime)).."后恢复1点"
end, 1, -1, true)
@ -257,6 +260,10 @@ function EndLessCarbonPanel:OnClose()
this.timer:Stop()
this.timer = nil
end
if this.timer1 then
this.timer1:Stop()
this.timer1 = nil
end
end
--界面销毁时调用(用于子类重写)