|
|
@@ -23,12 +23,23 @@ function UIClimbingTowerBattleWinView:FillContent(data, uiBase)
|
|
|
end
|
|
|
|
|
|
function UIClimbingTowerBattleWinView:Init()
|
|
|
- self:SetRewardInfo(self.controller:GetLevelRewards())
|
|
|
+ self.curTime = 0
|
|
|
+ self.maxTime = 0
|
|
|
+ self:SetRewardInfo(self.controller:GetLevelRewards())
|
|
|
+
|
|
|
+ local type = self.controller:GetLastUITowerType()
|
|
|
+ self.btnNextTower:SetActive(type == Enum.UnlimitTowerType.ClimbingTower)
|
|
|
+ LogError("ClimbingTower = "..tostring(type))
|
|
|
+ if type == Enum.UnlimitTowerType.ClimbingTower then
|
|
|
+ self:AutoPlayTimer()
|
|
|
+ LogError("ClimbingTower = ClimbingTower")
|
|
|
+ else
|
|
|
+ self.autoPlay:SetActive(false)
|
|
|
+ end
|
|
|
|
|
|
- local type = self.controller:GetLastUITowerType()
|
|
|
- self.btnNextTower:SetActive(type == Enum.UnlimitTowerType.ClimbingTower)
|
|
|
end
|
|
|
|
|
|
+
|
|
|
function UIClimbingTowerBattleWinView:SetRewardInfo(rewardData)
|
|
|
if rewardData~= nil then
|
|
|
self.ItemScrollView:SetActive(true)
|
|
|
@@ -84,6 +95,12 @@ function UIClimbingTowerBattleWinView:OnClickClose()
|
|
|
ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.EID_SHUT_TIMEBATTLE,self.controller:BackPageId())
|
|
|
end
|
|
|
ManagerContainer.LuaUIMgr:ClosePage(self.uiBase.PageId)
|
|
|
+
|
|
|
+ if self.curTimer ~= nil then
|
|
|
+ ManagerContainer.LuaTimerMgr:RemoveTimer(self.curTimer)
|
|
|
+ self.curTimer = nil
|
|
|
+ end
|
|
|
+
|
|
|
end
|
|
|
|
|
|
function UIClimbingTowerBattleWinView:OnClickItem(btn,params)
|
|
|
@@ -91,5 +108,32 @@ function UIClimbingTowerBattleWinView:OnClickItem(btn,params)
|
|
|
ManagerContainer.LuaUIMgr:OpenTips(logicData)
|
|
|
end
|
|
|
|
|
|
+function UIClimbingTowerBattleWinView:AutoPlayTimer()
|
|
|
+ self.autoPlay:SetActive(true)
|
|
|
+ self.maxTime = GlobalConfig.Instance:GetConfigIntValue(365)
|
|
|
+ self.curTime =0
|
|
|
+ self.curTimer = nil
|
|
|
+ self:StartTimer()
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+function UIClimbingTowerBattleWinView:StartTimer()
|
|
|
+
|
|
|
+ self.timersTxt.text.text = tostring(self.maxTime)
|
|
|
+ self.curTimer = ManagerContainer.LuaTimerMgr:AddTimer(1000, self.maxTime, self, self.UpdateTimer, nil)
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+function UIClimbingTowerBattleWinView:UpdateTimer()
|
|
|
+ self.curTime = self.curTime + 1
|
|
|
+ self.timersTxt.text.text = tostring(self.maxTime - self.curTime)
|
|
|
+ if (self.maxTime == self.curTime) then
|
|
|
+ ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.EID_SHUT_TIMEBATTLE, self.controller:BackPageId())
|
|
|
+ self.controller:EnterNextBattle()
|
|
|
+ self.curTimer = nil
|
|
|
+ --ManagerContainer.LuaUIMgr:ClosePage(self.uiBase.PageId)
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
return UIClimbingTowerBattleWinView
|
|
|
|