From 7bea1cf11ad7668e686f8012cd22361eba12a291 Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Fri, 2 Apr 2021 15:42:36 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B7=85=E5=B3=B0=E8=B5=9B=E3=80=91?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArenaTopMatch/ArenaTopMatchManager.lua | 40 ++++++++++++++++++- .../ArenaTopMatch/View/ATM_GuessView.lua | 4 +- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/ArenaTopMatchManager.lua b/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/ArenaTopMatchManager.lua index 0345c0ad34..f4a7812115 100644 --- a/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/ArenaTopMatchManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/ArenaTopMatchManager.lua @@ -105,7 +105,45 @@ end function this.UpdateTopMatchStage(msg) -- 没有数据或者未开启时重新获取数据 if not this.baseInfo or not this.baseInfo.progress or this.baseInfo.progress <= 0 then - this.RequestTopMatchBaseInfo() + + local fun = function() + -- 获取新的阶段信息 + this.baseInfo.progress = msg.progress + this.baseInfo.endTime = msg.endTime + this.BaseDataEndTimeCountDown() + Log(string.format("巅峰战阶段刷新 state = %s, progress = %s, endTime = %s, myrank = %s", + this.baseInfo.joinState, this.baseInfo.progress, this.baseInfo.endTime, this.baseInfo.myrank)) + + -- 刷新基础信息 + this.RefreshBaseInfo() + -- Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnTopMatchDataUpdate) + -- --刷新排行信息 + -- Game.GlobalEvent:DispatchEvent(GameEvent.ATM_RankView.OnRankChange) + LogGreen("this.baseInfo.battleState "..this.baseInfo.battleState) + + -- 切换到准备阶段刷新一遍数据 + -- if this.baseInfo.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_READY then + -- this.RequestTopMatchBaseInfo() + -- --this.RequestBetBaseInfo() + -- -- 竞猜阶段刷新竞猜数据 + -- else + if this.baseInfo.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_GUESS then + this.RequestTopMatchBaseInfo() + this.RequestBetBaseInfo() + -- 战斗阶段不刷新 + --elseif this.baseInfo.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_GUESS then + -- 切换到结算阶段刷新一遍所有数据 + elseif this.baseInfo.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_END then + this.RequestTopMatchBaseInfo() + this.RequestBetBaseInfo(nil,true) + end + + Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnTopMatchDataUpdate) + --刷新排行信息 + Game.GlobalEvent:DispatchEvent(GameEvent.ATM_RankView.OnRankChange) + end + + this.RequestTopMatchBaseInfo(fun) return end diff --git a/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/View/ATM_GuessView.lua b/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/View/ATM_GuessView.lua index 4e208c6740..35276dc5c0 100644 --- a/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/View/ATM_GuessView.lua +++ b/Assets/ManagedResources/~Lua/Modules/ArenaTopMatch/View/ATM_GuessView.lua @@ -196,12 +196,12 @@ function this.OnShowRefresh() isShow = isActive and (battleStage == TOP_MATCH_STAGE.ELIMINATION or battleStage == TOP_MATCH_STAGE.CHOOSE) and progress ~= -2 -- LogGreen("battleStage "..battleStage.." isActive "..tostring(isActive).." progress "..progress.." isShow "..tostring(isShow)) this.guessPanel:SetActive(isShow) - commonInfo.SetActive(isShow) + -- commonInfo.SetActive(isShow) this.emptyPanel:SetActive(not isShow) end function this.RefreshBaseShow() local IsCanBet = ArenaTopMatchManager.IsCanBet() - -- LogGreen("IsCanBet "..tostring(IsCanBet)) + LogGreen("IsCanBet "..tostring(IsCanBet)) if IsCanBet then -- 判断是否有竞猜信息 local betBattleInfo = ArenaTopMatchManager.GetBetBattleInfo() this.emptyPanel:SetActive(false)