diff --git a/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua b/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua index f0ed45f10e..2321597c1a 100644 --- a/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua @@ -90,6 +90,7 @@ function TreasureStorePopup:RefreshPanel(isAni) local curActId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureStore) LogGreen("curActId:"..curActId) if not curActId then + self:ClosePanel() return end rechargeId = tonumber(GlobalActivity[curActId].ShowArt) @@ -214,11 +215,13 @@ function this.TimeCountDown() this.timer:Stop() this.timer = nil end - local endtime = ActivityGiftManager.GetTaskEndTime(ActivityTypeDef.TreasureStore) + local endtime = CalculateSecondsNowTo_N_OClock(24) local timeDown = endtime - GetTimeStamp() this.time.text = Language[10023]..TimeToHMS(timeDown) this.timer = Timer.New(function() + timeDown = timeDown - 1 if timeDown <= 0 then + timeDown = 0 this.timer:Stop() this.timer = nil this.timer = Timer.New(function() @@ -226,8 +229,7 @@ function this.TimeCountDown() this:TimeCountDown() end,1):Start() return - end - timeDown = timeDown - 1 + end this.time.text = Language[10023]..TimeToHMS(timeDown) end, 1, -1, true) this.timer:Start()