巅峰战提交
parent
f3048c9904
commit
bdf9331b79
|
|
@ -87,8 +87,10 @@ function this.RequestTopMatchBaseInfo(func)
|
|||
this.baseInfo.loser = msg.loser--是否被淘汰
|
||||
|
||||
this.myBattleInfo = msg.championBattleInfo
|
||||
LogGreen("我的战斗双方uid "..this.myBattleInfo.myInfo.uid.." "..this.myBattleInfo.enemyInfo.uid)
|
||||
this.RefreshBaseInfo()
|
||||
-- 发送更新事件
|
||||
LogRed("GameEvent.TopMatch.OnTopMatchDataUpdate 93")
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnTopMatchDataUpdate)
|
||||
Log(string.format(Language[10108], msg.joinState, msg.progress, msg.endTime, msg.myrank))
|
||||
if func then func() end
|
||||
|
|
@ -108,19 +110,23 @@ function this.UpdateTopMatchStage(msg)
|
|||
this.baseInfo.endTime = msg.endTime
|
||||
Log(string.format(Language[10109],
|
||||
this.baseInfo.joinState, this.baseInfo.progress, this.baseInfo.endTime, this.baseInfo.myrank))
|
||||
|
||||
-- 刷新基础信息
|
||||
this.RefreshBaseInfo()
|
||||
LogRed("GameEvent.TopMatch.OnTopMatchDataUpdate 115")
|
||||
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
|
||||
-- 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
|
||||
this.RequestBetBaseInfo()
|
||||
-- 战斗阶段不刷新
|
||||
--elseif this.baseInfo.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_GUESS then
|
||||
|
|
|
|||
|
|
@ -101,12 +101,13 @@ end
|
|||
--- @ panelType -- 1 --> 我的 ; 2 -- > 竞猜
|
||||
--- @ textType -- 需要显示的文字类型 -1 --> 战 ; 1 -- > 胜; 0 --> 败
|
||||
--- @ showScore -- 是否显示积分
|
||||
function this.SetInfoData(panelType, blueData, redData, textType, showScore)
|
||||
function this.SetInfoData(panelType, blueData, redData, textType, showScore,battleEndResultSortState)
|
||||
this.panelType = panelType
|
||||
this.blueData = blueData
|
||||
this.redData = redData
|
||||
this.rootPanel.transform.localPosition = panelPos[panelType]
|
||||
this.rootPanel:SetActive(true)
|
||||
this.battleEndResultSortState = battleEndResultSortState
|
||||
|
||||
|
||||
this.RefreshData(showScore, textType)
|
||||
|
|
@ -204,16 +205,30 @@ function this.RefreshTwoOutOfThreeData()
|
|||
this.RightWinNumGo:SetActive(ArenaTopMatchManager.GetBaseData().battleStage == TOP_MATCH_STAGE.ELIMINATION)
|
||||
if ArenaTopMatchManager.GetBaseData().battleStage == TOP_MATCH_STAGE.ELIMINATION then
|
||||
local upWinNum,downWinNum = ArenaTopMatchManager.GetTwoOutOfThreeInfo(this.panelType)
|
||||
|
||||
for i = 1, 3 do
|
||||
if upWinNum >= i then
|
||||
this.LeftWinNum[i]:SetActive(true)
|
||||
if this.battleEndResultSortState then
|
||||
if upWinNum >= i then
|
||||
this.LeftWinNum[i]:SetActive(true)
|
||||
else
|
||||
this.LeftWinNum[i]:SetActive(false)
|
||||
end
|
||||
if downWinNum >= i then
|
||||
this.RightWinNum[i]:SetActive(true)
|
||||
else
|
||||
this.RightWinNum[i]:SetActive(false)
|
||||
end
|
||||
else
|
||||
this.LeftWinNum[i]:SetActive(false)
|
||||
end
|
||||
if downWinNum >= i then
|
||||
this.RightWinNum[i]:SetActive(true)
|
||||
else
|
||||
this.RightWinNum[i]:SetActive(false)
|
||||
if upWinNum >= i then
|
||||
this.RightWinNum[i]:SetActive(true)
|
||||
else
|
||||
this.RightWinNum[i]:SetActive(false)
|
||||
end
|
||||
if downWinNum >= i then
|
||||
this.LeftWinNum[i]:SetActive(true)
|
||||
else
|
||||
this.LeftWinNum[i]:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -326,6 +326,8 @@ function this.Set4Group()
|
|||
local guessBtn=Util.GetGameObject(this.fourPre,"Pos3/box/GuessBtn")
|
||||
this.SetPlayerState(item1,item2,v.attackInfo.name,v.defInfo.name,v.fightResult)
|
||||
this.SetPlayBack(playBackBtn,v.fightResult,v.id,v.defInfo,v.attackInfo)
|
||||
LogRed("决赛 是否显示竞猜按钮 v.isGUess "..v.isGUess.." battleStage == TOP_MATCH_STAGE.ELIMINATION and isGUess==1")
|
||||
LogRed("决赛 是否显示竞猜按钮 v.fightResult "..v.fightResult)
|
||||
this.SetGuessBtn(guessBtn,v.isGUess)
|
||||
this.SetChampionHead(cHead, v.fightResult, v.defInfo, v.attackInfo)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ local function _CheckGuess()
|
|||
PopupTipPanel.ShowTip(Language[10166])
|
||||
return false
|
||||
end
|
||||
|
||||
LogRed("isCanGuessByBattleEndState "..tostring(isCanGuessByBattleEndState))
|
||||
if baseInfo.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_GUESS and isCanGuessByBattleEndState then
|
||||
return true
|
||||
end
|
||||
|
|
@ -199,7 +199,7 @@ function this.RefreshBaseShow()
|
|||
LogGreen("sssssssssssss "..tostring(IsCanBet))
|
||||
this.guessPanel:SetActive(true)
|
||||
commonInfo.SetActive(true)
|
||||
commonInfo.SetInfoData(2, betBattleInfo.myInfo, betBattleInfo.enemyInfo, betBattleInfo.result, false)
|
||||
commonInfo.SetInfoData(2, betBattleInfo.myInfo, betBattleInfo.enemyInfo, betBattleInfo.result, false,true)
|
||||
this.blueName.text = betBattleInfo.myInfo.name
|
||||
this.redName.text = betBattleInfo.enemyInfo.name
|
||||
-- 刷新赔率显示
|
||||
|
|
@ -215,9 +215,13 @@ function this.RefreshBaseShow()
|
|||
local IsBeted = myBetTarget and myBetTarget ~= 0
|
||||
local upWinNum,downWinNum = ArenaTopMatchManager.GetTwoOutOfThreeInfo(battleStage)
|
||||
isCanGuessByBattleEndState = true
|
||||
if battleStage == TOP_MATCH_STAGE.ELIMINATION then
|
||||
if upWinNum ~= -1 or downWinNum ~= -1 then isCanGuessByBattleEndState = false end
|
||||
end
|
||||
LogRed("isCanGuessByBattleEndState "..tostring(isCanGuessByBattleEndState))
|
||||
if battleStage == TOP_MATCH_STAGE.ELIMINATION then
|
||||
if upWinNum ~= 0 or downWinNum ~= 0 then
|
||||
isCanGuessByBattleEndState = false
|
||||
LogRed("isCanGuessByBattleEndState "..tostring(isCanGuessByBattleEndState))
|
||||
end
|
||||
end
|
||||
if IsBeted or not isCanGuessByBattleEndState then
|
||||
local isBetRed = myBetTarget == betBattleInfo.enemyInfo.uid
|
||||
local isBetBlue = myBetTarget == betBattleInfo.myInfo.uid
|
||||
|
|
|
|||
|
|
@ -159,16 +159,19 @@ function this.SetPlayerInfo()
|
|||
local blueInfo = nil
|
||||
local redInfo = nil
|
||||
LogRed("battleInfo.result "..battleInfo.result)
|
||||
local battleEndResultSortState = true --true 战斗最终直接赋值 false 颠倒赋值
|
||||
if attInfo.uid == PlayerManager.uid then
|
||||
blueInfo = attInfo
|
||||
redInfo = defInfo
|
||||
myResult = battleInfo.result
|
||||
battleEndResultSortState = true
|
||||
elseif defInfo.uid == PlayerManager.uid then
|
||||
blueInfo = defInfo
|
||||
redInfo = attInfo
|
||||
if battleInfo.result ~= -1 then
|
||||
myResult = (battleInfo.result + 1) % 2
|
||||
end
|
||||
battleEndResultSortState = false
|
||||
end
|
||||
LogRed("myResult "..myResult)
|
||||
--if battleInfo.result == 0 then -- 如果进攻方失败,则如果我是进攻方则我失败,反之胜利
|
||||
|
|
@ -179,7 +182,7 @@ function this.SetPlayerInfo()
|
|||
|
||||
local baseData = ArenaTopMatchManager.GetBaseData()
|
||||
commonInfo.SetActive(true)
|
||||
commonInfo.SetInfoData(1, blueInfo, redInfo, myResult, baseData == TOP_MATCH_STAGE.CHOOSE)
|
||||
commonInfo.SetInfoData(1, blueInfo, redInfo, myResult, baseData == TOP_MATCH_STAGE.CHOOSE,battleEndResultSortState)
|
||||
end
|
||||
|
||||
function this.SetLockInfo()
|
||||
|
|
|
|||
Loading…
Reference in New Issue