巅峰战提交

dev_chengFeng
zhangqiang 2020-07-10 13:38:50 +08:00
parent 6bdc5a1db8
commit 13283fe135
12 changed files with 190 additions and 74 deletions

View File

@ -351,6 +351,7 @@ GameEvent = {
OnTopMatchDataUpdate = "TopMatch.OnTopMatchDataUpdate",
OnGuessDataUpdate = "TopMatch.OnGuessDataUpdate",
OnGuessRateUpdate = "TopMatch.OnGuessRateUpdate",
OnGuessDataUpdateShowTip = "TopMatch.OnGuessDataUpdateShowTip",
},
FindFairy={
RefreshRedPoint="FindFairy.RefreshRedPoint",

View File

@ -40,6 +40,7 @@ CHAMPIONGETINFORESPONSE_MAXRANK_FIELD = protobuf.FieldDescriptor();
CHAMPIONGETINFORESPONSE_CHAMPIONBATTLEINFO_FIELD = protobuf.FieldDescriptor();
CHAMPIONGETINFORESPONSE_MYSCORE_FIELD = protobuf.FieldDescriptor();
CHAMPIONGETINFORESPONSE_PROCESS_FIELD = protobuf.FieldDescriptor();
CHAMPIONGETINFORESPONSE_LOSER_FIELD = protobuf.FieldDescriptor();
CHAMPIONPROGRESSUPDATEINDICATION = protobuf.Descriptor();
CHAMPIONPROGRESSUPDATEINDICATION_PROGRESS_FIELD = protobuf.FieldDescriptor();
CHAMPIONPROGRESSUPDATEINDICATION_ENDTIME_FIELD = protobuf.FieldDescriptor();
@ -76,6 +77,7 @@ CHAMPIONGETALLMYBETINFORESPONSE = protobuf.Descriptor();
CHAMPIONGETALLMYBETINFORESPONSE_CHAMPIONMYBETDETAILS_FIELD = protobuf.FieldDescriptor();
CHAMPIONVIEWFINALREQUEST = protobuf.Descriptor();
CHAMPIONVIEWFINALREQUEST_TYPE_FIELD = protobuf.FieldDescriptor();
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD = protobuf.FieldDescriptor();
CHAMPIONVIEWFINALRESPONSE = protobuf.Descriptor();
CHAMPIONVIEWFINALRESPONSE_CHAMPIONBATTLEPAIRINFO_FIELD = protobuf.FieldDescriptor();
CHAMPIONGUESSSUCCESSINDICATION = protobuf.Descriptor();
@ -418,11 +420,21 @@ CHAMPIONGETINFORESPONSE_PROCESS_FIELD.default_value = 0
CHAMPIONGETINFORESPONSE_PROCESS_FIELD.type = 5
CHAMPIONGETINFORESPONSE_PROCESS_FIELD.cpp_type = 1
CHAMPIONGETINFORESPONSE_LOSER_FIELD.name = "loser"
CHAMPIONGETINFORESPONSE_LOSER_FIELD.full_name = ".com.ljsd.jieling.protocols.ChampionGetInfoResponse.loser"
CHAMPIONGETINFORESPONSE_LOSER_FIELD.number = 9
CHAMPIONGETINFORESPONSE_LOSER_FIELD.index = 8
CHAMPIONGETINFORESPONSE_LOSER_FIELD.label = 1
CHAMPIONGETINFORESPONSE_LOSER_FIELD.has_default_value = false
CHAMPIONGETINFORESPONSE_LOSER_FIELD.default_value = false
CHAMPIONGETINFORESPONSE_LOSER_FIELD.type = 8
CHAMPIONGETINFORESPONSE_LOSER_FIELD.cpp_type = 7
CHAMPIONGETINFORESPONSE.name = "ChampionGetInfoResponse"
CHAMPIONGETINFORESPONSE.full_name = ".com.ljsd.jieling.protocols.ChampionGetInfoResponse"
CHAMPIONGETINFORESPONSE.nested_types = {}
CHAMPIONGETINFORESPONSE.enum_types = {}
CHAMPIONGETINFORESPONSE.fields = {CHAMPIONGETINFORESPONSE_JOINSTATE_FIELD, CHAMPIONGETINFORESPONSE_PROGRESS_FIELD, CHAMPIONGETINFORESPONSE_ENDTIME_FIELD, CHAMPIONGETINFORESPONSE_MYRANK_FIELD, CHAMPIONGETINFORESPONSE_MAXRANK_FIELD, CHAMPIONGETINFORESPONSE_CHAMPIONBATTLEINFO_FIELD, CHAMPIONGETINFORESPONSE_MYSCORE_FIELD, CHAMPIONGETINFORESPONSE_PROCESS_FIELD}
CHAMPIONGETINFORESPONSE.fields = {CHAMPIONGETINFORESPONSE_JOINSTATE_FIELD, CHAMPIONGETINFORESPONSE_PROGRESS_FIELD, CHAMPIONGETINFORESPONSE_ENDTIME_FIELD, CHAMPIONGETINFORESPONSE_MYRANK_FIELD, CHAMPIONGETINFORESPONSE_MAXRANK_FIELD, CHAMPIONGETINFORESPONSE_CHAMPIONBATTLEINFO_FIELD, CHAMPIONGETINFORESPONSE_MYSCORE_FIELD, CHAMPIONGETINFORESPONSE_PROCESS_FIELD, CHAMPIONGETINFORESPONSE_LOSER_FIELD}
CHAMPIONGETINFORESPONSE.is_extendable = false
CHAMPIONGETINFORESPONSE.extensions = {}
CHAMPIONPROGRESSUPDATEINDICATION_PROGRESS_FIELD.name = "progress"
@ -754,11 +766,21 @@ CHAMPIONVIEWFINALREQUEST_TYPE_FIELD.default_value = 0
CHAMPIONVIEWFINALREQUEST_TYPE_FIELD.type = 5
CHAMPIONVIEWFINALREQUEST_TYPE_FIELD.cpp_type = 1
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.name = "page"
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.full_name = ".com.ljsd.jieling.protocols.ChampionViewFinalRequest.page"
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.number = 2
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.index = 1
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.label = 1
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.has_default_value = false
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.default_value = 0
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.type = 5
CHAMPIONVIEWFINALREQUEST_PAGE_FIELD.cpp_type = 1
CHAMPIONVIEWFINALREQUEST.name = "ChampionViewFinalRequest"
CHAMPIONVIEWFINALREQUEST.full_name = ".com.ljsd.jieling.protocols.ChampionViewFinalRequest"
CHAMPIONVIEWFINALREQUEST.nested_types = {}
CHAMPIONVIEWFINALREQUEST.enum_types = {}
CHAMPIONVIEWFINALREQUEST.fields = {CHAMPIONVIEWFINALREQUEST_TYPE_FIELD}
CHAMPIONVIEWFINALREQUEST.fields = {CHAMPIONVIEWFINALREQUEST_TYPE_FIELD, CHAMPIONVIEWFINALREQUEST_PAGE_FIELD}
CHAMPIONVIEWFINALREQUEST.is_extendable = false
CHAMPIONVIEWFINALREQUEST.extensions = {}
CHAMPIONVIEWFINALRESPONSE_CHAMPIONBATTLEPAIRINFO_FIELD.name = "championBattlePairInfo"

View File

@ -3,6 +3,7 @@ require("Base/BasePanel")
local ArenaResultPopup = Inherit(BasePanel)
local this = ArenaResultPopup
local orginLayer
local fun = nil
--初始化组件(用于子类重写)
function ArenaResultPopup:InitComponent()
orginLayer = 0
@ -42,11 +43,10 @@ function ArenaResultPopup:OnSortingOrderChange()
end
--界面打开时调用(用于子类重写)
function ArenaResultPopup:OnOpen(...)
function ArenaResultPopup:OnOpen(_args,_fun)
SoundManager.PlaySound(SoundConfig.Sound_Arena_Result)
local pack = {...}
local args = pack[1]
local args = _args
fun = _fun
if not args then return end
this.realResult = args.result
@ -134,6 +134,10 @@ end
--界面关闭时调用(用于子类重写)
function ArenaResultPopup:OnClose()
if fun then
fun()
fun = nil
end
end
--界面销毁时调用(用于子类重写)

View File

@ -95,6 +95,7 @@ function this.RefreshData(go, itemData)
blueName.text = personInfo[1].name
redName.text = personInfo[2].name
match.text = ArenaTopMatchManager.GetTurnNameByRoundTimes(battleInfo.roundTimes)
LogPink("battleInfo.roundTimes "..battleInfo.roundTimes.." "..ArenaTopMatchManager.GetTurnNameByRoundTimes(battleInfo.roundTimes))
zhan:SetActive(true)--battleInfo.fightResult == -1
bai:SetActive(battleInfo.fightResult ~= -1)--battleInfo.fightResult == 0
sheng:SetActive(battleInfo.fightResult ~= -1)--battleInfo.fightResult == 1

View File

@ -1,6 +1,7 @@
ArenaTopMatchManager = {};
local this = ArenaTopMatchManager
this.CurTabIndex = 1
this.curIsShowDoGuessPopup = false
function this.Initialize()
this.baseInfo = {}
this.myBattleInfo = {}
@ -71,6 +72,7 @@ function this.RequestTopMatchBaseInfo(func)
this.baseInfo.maxRank = msg.maxRank
this.baseInfo.myscore = msg.myscore
this.baseInfo.process = msg.process--2 胜 3 负 4 胜负 5 负胜
this.baseInfo.loser = msg.loser--是否被淘汰
this.myBattleInfo = msg.championBattleInfo
this.RefreshBaseInfo()
@ -164,6 +166,7 @@ function this.RefreshBaseInfo()
this.baseInfo.battleStage = tonumber(string.sub(this.baseInfo.progress, 1, 1))
this.baseInfo.battleTurn = tonumber(string.sub(this.baseInfo.progress, 2, 2))
this.baseInfo.battleState = tonumber(string.sub(this.baseInfo.progress, 3, 3))
LogPink("this.baseInfo.battleStage "..this.baseInfo.battleStage.." "..this.baseInfo.progress)
-- 判断阶段切换,并检测是否需要弹窗提示
if UIManager.IsOpen(UIName.ArenaTopMatchPanel) then return end
@ -235,12 +238,13 @@ function this.RequestBetBaseInfo(func,isPlayBattle)
-- 获取巅峰战信息
NetManager.GetBetMatchInfo(0, function(msg)
this.betBattleInfo = msg.championBattleInfo
LogGreen("竞猜双方uid "..msg.championBattleInfo.myInfo.uid.." "..msg.championBattleInfo.enemyInfo.uid)
this.betRateInfo = msg.championBetInfo
this.myBetTarget = msg.winUid
LogGreen("this.myBetTarget = msg.winUid "..this.myBetTarget.." "..msg.winUid)
this.process = msg.process
LogGreen("竞猜msg.process "..msg.process)
Log(string.format(Language[10114], msg.winUid, msg.championBetInfo.id, msg.championBetInfo.redCoins, msg.championBetInfo.blueCoins))
LogGreen("this.isCanBet = true ")
-- 可以竞猜了
this.isCanBet = true
@ -334,8 +338,9 @@ end
-- 竞猜成功回调
function this.OnGuessSuccess(msg)
LogGreen("竞猜成功回调")
if this.isLogin then return end--上来就弹新关卡界面 所以不弹
if MapManager.isInMap or UIManager.IsOpen(UIName.BattlePanel) then return end--在关卡里 副本里不弹
if MapManager.isInMap and UIManager.IsOpen(UIName.BattlePanel) or UIManager.IsOpen(UIName.ArenaTopMatchPanel) then return end--在关卡里 副本里不弹 新加巅峰赛界面不弹
UIManager.OpenPanel(UIName.GuessCoinDropPopup, msg.roundTimes, msg.itemId, msg.itemNum)
end
@ -444,29 +449,41 @@ function this.RequestReplayRecord(isWin, fightData, nameStr, doneFunc)
battlePanel:ShowNameShow(isWin, nameStr)
end
local stageNameTable = {
[0] = 32 .. Language[10097],--强
[1] = 16 .. Language[10097],--强
[2] = 8 .. Language[10097],--强
[3] = 4 .. Language[10097],--强
[4] = Language[10126],
}
-- 获取当前阶段名称
function this.GetCurTopMatchName()
local titleName = Language[10121]
LogPink("```````````````````````````````````````````````````")
LogPink("this.baseInfo.progress "..this.baseInfo.progress)
local titleName = Language[10121]--逐胜之巅
local stageName = ""
if this.baseInfo.progress == -1 then
return titleName, Language[10122], Language[10123]
return titleName, Language[10122], Language[10123]--未开始 即将开始
elseif this.baseInfo.progress == -2 then
return titleName, Language[10124], Language[10124]
return titleName, Language[10124], Language[10124]--已结束
end
if this.baseInfo.battleStage == TOP_MATCH_STAGE.CHOOSE then
stageName = Language[10125]..NumToSimplenessFont[this.baseInfo.battleTurn]
stageName = Language[10125]..NumToSimplenessFont[this.baseInfo.battleTurn]--选拔赛
else
local maxTurn = this.GetEliminationMaxRound()
local curTurn = this.baseInfo.battleTurn
local opTurn = maxTurn - curTurn + 1 --- 将服务器发过来的轮数倒序,方便计算
if opTurn == 1 then
stageName = Language[10126]
else
stageName = math.pow(2, opTurn) .. Language[10097]
end
-- local maxTurn = this.GetEliminationMaxRound()
-- local curTurn = this.baseInfo.battleTurn
-- LogPink("this.baseInfo.battleTurn "..this.baseInfo.battleTurn.." maxTurn "..maxTurn)
-- local opTurn = maxTurn - curTurn + 1 --- 将服务器发过来的轮数倒序,方便计算
-- LogPink("opTurn "..opTurn.." math.pow(2, opTurn) "..math.pow(2, opTurn))
-- if opTurn == 1 then
-- stageName = Language[10126]--决赛
-- else
-- stageName = math.pow(2, opTurn) .. Language[10097]--强
-- end
stageName = stageNameTable[this.baseInfo.battleTurn]
end
local stateName = TOP_MATCH_STATE_NAME[this.baseInfo.battleState] or Language[10127]
local stateName = TOP_MATCH_STATE_NAME[this.baseInfo.battleState] or Language[10127]--未知
return titleName, stageName, stateName
end
@ -481,9 +498,11 @@ function this.GetTurnNameByRoundTimes(roundTimes)
return Language[10125]..NumToSimplenessFont[roundTimes]
end
-- 淘汰赛
LogGreen("roundTimes "..roundTimes)
local curTurn = roundTimes - maxRound -- 当前淘汰赛轮数
local maxTurn = this.GetEliminationMaxRound()
local opTurn = maxTurn - curTurn + 1 --- 将服务器发过来的轮数倒序,方便计算
LogGreen("opTurn "..opTurn.." maxTurn "..maxTurn.." curTurn "..curTurn)
if opTurn == 1 then
return Language[10126]
else
@ -519,7 +538,8 @@ end
-- 通过排名获取相应的排名位置
function this.GetRankNameByRank(rank)
--
if rank <= 0 then return Language[10041] end
LogPink("rank "..rank)
if rank <= 0 then return Language[10041] end--未上榜
local curStage = this.baseInfo.battleStage
local curTurn = this.baseInfo.battleTurn
local curState = this.baseInfo.battleState
@ -531,42 +551,59 @@ function this.GetRankNameByRank(rank)
if curStage == 1 then
local config = ConfigManager.GetConfigData(ConfigName.ChampionshipSetting, 1)
return config.ChampionshipPlayer..Language[10097]
end
--- 判断淘汰赛阶段的轮数
local maxTurn = this.GetEliminationMaxRound()
if curTurn <= 0 then curTurn = maxTurn end
local opTurn = maxTurn - curTurn + 1 --- 将服务器发过来的轮数倒序,方便计算
--- 如果是结算状态,按下一轮处理
if curState == TOP_MATCH_TIME_STATE.OPEN_IN_END or curState == TOP_MATCH_TIME_STATE.OVER then
opTurn = opTurn - 1
end
--- 轮数为0表示决赛的结算阶段
if opTurn == 0 then
-- 判断淘汰赛阶段的轮数
elseif curStage == 2 or curStage == -2 then
-- if curState == TOP_MATCH_TIME_STATE.OPEN_IN_END or curState == TOP_MATCH_TIME_STATE.OVER then
if rank == 1 then
return Language[10095]
return Language[10095]--冠军
elseif rank == 2 then
return Language[10096]
return Language[10096]--亚军
end
return rank..Language[10097]--几强
elseif curStage == -1 then
return Language[10041]
end
--- 如果大于淘汰赛最大轮数的最大名次
if rank > math.pow(2, maxTurn) then
local config = ConfigManager.GetConfigData(ConfigName.ChampionshipSetting, 1)
return config.ChampionshipPlayer..Language[10097]
end
--- 如果小于当前轮数的最大排名,则返回当前轮数的名称
local opTurnMaxRank = math.pow(2, opTurn)
if rank <= opTurnMaxRank then
return opTurnMaxRank..Language[10097]
end
--- 如果大于当前的轮数,则可能已被淘汰,返回相应的被淘汰轮数的名称
for turn = opTurn + 1, maxTurn do
local turnMaxRank = math.pow(2, turn)
if rank <= turnMaxRank then
return turnMaxRank..Language[10097]
end
end
-- 数据没错的情况下不会出现这种情况
return Language[10041]
-- --- 判断淘汰赛阶段的轮数
-- local maxTurn = this.GetEliminationMaxRound()
-- LogPink("maxTurn "..maxTurn)
-- if curTurn <= 0 then curTurn = maxTurn end
-- local opTurn = maxTurn - curTurn + 1 --- 将服务器发过来的轮数倒序,方便计算
-- --- 如果是结算状态,按下一轮处理
-- LogPink("opTurn "..opTurn)
-- if curState == TOP_MATCH_TIME_STATE.OPEN_IN_END or curState == TOP_MATCH_TIME_STATE.OVER then
-- opTurn = opTurn - 1
-- end
-- LogPink("opTurn "..opTurn)
-- --- 轮数为0表示决赛的结算阶段
-- if opTurn == 0 then
-- if rank == 1 then
-- return Language[10095]--冠军
-- elseif rank == 2 then
-- return Language[10096]--亚军
-- end
-- end
-- --- 如果大于淘汰赛最大轮数的最大名次
-- if rank > math.pow(2, maxTurn) then
-- local config = ConfigManager.GetConfigData(ConfigName.ChampionshipSetting, 1)
-- LogPink(config.ChampionshipPlayer..Language[10097])
-- return config.ChampionshipPlayer..Language[10097]--几强
-- end
-- --- 如果小于当前轮数的最大排名,则返回当前轮数的名称
-- local opTurnMaxRank = math.pow(2, opTurn)
-- if rank <= opTurnMaxRank then
-- LogPink(opTurnMaxRank..Language[10097])
-- return opTurnMaxRank..Language[10097]
-- end
-- --- 如果大于当前的轮数,则可能已被淘汰,返回相应的被淘汰轮数的名称
-- for turn = opTurn + 1, maxTurn do
-- local turnMaxRank = math.pow(2, turn)
-- if rank <= turnMaxRank then
-- LogPink(turnMaxRank..Language[10097])
-- return turnMaxRank..Language[10097]
-- end
-- end
-- -- 数据没错的情况下不会出现这种情况
-- return Language[10041]
end
-- 竞猜币ID
@ -629,6 +666,7 @@ function this.RequestRankData(page,func)
local length=#this.rankData
for i, v in ipairs(msg.rankInfos) do
if v.personInfo.rank<=8 then
LogGreen("前八名数据 "..length+i)
this.rankData[length+i]=v.personInfo
end
end
@ -769,5 +807,17 @@ function this.GetTwoOutOfThreeInfo(type)
return 2,0
end
end
function this.SetCurTabIndex(index)
this.CurTabIndex = index
end
function this.GetCurTabIndex()
return this.CurTabIndex
end
function this.SetcurIsShowDoGuessPopup(isShow)
this.curIsShowDoGuessPopup = isShow
end
function this.GetcurIsShowDoGuessPopup()
return this.curIsShowDoGuessPopup
end
----------------------
return this

View File

@ -89,7 +89,8 @@ function ArenaTopMatchPanel:OnOpen(...)
-- 参数保存
local args = {...}
this._CurTabIndex = args[1] or 1
ArenaTopMatchManager.SetCurTabIndex(this._CurTabIndex)
LogGreen("``````````````````````````````````````this._CurTabIndex "..this._CurTabIndex)
ArenaTopMatchManager.RequestTopMatchBaseInfo()
end
@ -97,7 +98,12 @@ end
function ArenaTopMatchPanel:OnShow()
commonTitle:OnShow()
if this.TabCtrl then
LogBlue("this._CurTabIndex "..this._CurTabIndex)
LogBlue("this._CurTabIndex1 "..this._CurTabIndex)
if this._CurTabIndex > 5 then
ArenaTopMatchManager.SetCurTabIndex(2)
end
this._CurTabIndex = ArenaTopMatchManager.GetCurTabIndex()
LogBlue("this._CurTabIndex2 "..this._CurTabIndex)
this.TabCtrl:ChangeTab(this._CurTabIndex)
end
SoundManager.PlayMusic(SoundConfig.BGM_Arena)
@ -160,6 +166,8 @@ end
--
function this.OpenView(index)
this._CurLogicIndex = index
LogGreen("``````````````````````````````````````index "..index)
ArenaTopMatchManager.SetCurTabIndex(index)
this._CurTabIndex = index
local logic = this.ViewLogicList[index]
@ -198,7 +206,8 @@ function this.OpenView(index)
end
function this.CloseView(index)
if this._CurLogicIndex ~= index then return end
LogGreen(this._CurLogicIndex.." "..index)
-- if this._CurLogicIndex ~= index then return end
local logic = this.ViewLogicList[index]
if logic then
if logic.RemoveListener then

View File

@ -1,7 +1,7 @@
require("Base/BasePanel")
local DoGuessPopup = Inherit(BasePanel)
local this = DoGuessPopup
local GUESS_COIN = ArenaTopMatchManager.GetGuessCoinID()
--初始化组件(用于子类重写)
function DoGuessPopup:InitComponent()
this.btnBack = Util.GetGameObject(this.transform, "tipImage/btnReturn")
@ -30,8 +30,11 @@ function DoGuessPopup:BindEvent()
local uid = this.panelType == 1 and betBattleInfo.myInfo.uid or betBattleInfo.enemyInfo.uid
local num = this.slider.value
ArenaTopMatchManager.RequestBet(uid, num, function()
ArenaTopMatchManager.SetcurIsShowDoGuessPopup(true)
this:ClosePanel()
PopupTipPanel.ShowTip(Language[10133])
LogPink("BagManager.GetItemCountById(GUESS_COIN "..BagManager.GetItemCountById(GUESS_COIN))
ArenaTopMatchManager.SetCoinNum(BagManager.GetItemCountById(GUESS_COIN))
end)
end)
Util.AddClick(this.sliderLeftBtn, function()

View File

@ -97,6 +97,7 @@ function this.RefreshData(go, itemData)
lv_name.text = "lv" .. personInfo.level .. " " .. personInfo.name
power.text = personInfo.totalForce
match.text = ArenaTopMatchManager.GetTurnNameByRoundTimes(itemData.roundTimes)
LogPink("itemData.roundTimes "..itemData.roundTimes.." "..ArenaTopMatchManager.GetTurnNameByRoundTimes(itemData.roundTimes))
if not _PlayerHeadList[go] then
_PlayerHeadList[go] = SubUIManager.Open(SubUIConfig.PlayerHeadView, head.transform)

View File

@ -69,6 +69,7 @@ function ATM_GuessTipView:OnOpen(...)
this.TimeCountDown()
local IsCanBet = ArenaTopMatchManager.IsCanBet()
LogGreen("IsCanBet "..tostring(IsCanBet))
if IsCanBet then
local betBattleInfo = ArenaTopMatchManager.GetBetBattleInfo()
local myBetTarget = ArenaTopMatchManager.GetMyBetTarget()
@ -173,9 +174,10 @@ end
--设置竞猜币
function this.SetCoin()
local oldNum= ArenaTopMatchManager.GetCoinNum()
local newNum= BagManager.GetItemCountById(GUESS_COIN)
local newNum= (BagManager.GetItemCountById(GUESS_COIN) - oldNum) * ArenaTopMatchManager.rate + oldNum --BagManager.GetItemCountById(GUESS_COIN)
local tempNum=oldNum
LogGreen("oldNum "..oldNum.." newNum "..newNum)
if this.coinTimer then
this.coinTimer:Stop()
this.coinTimer=nil
@ -187,6 +189,7 @@ function this.SetCoin()
oldNum=newNum
this.coinTimer:Stop()
end
LogGreen("oldNum "..oldNum)
this.coinNum.text=string.format(Language[10164],oldNum)
end,interval,-1,true)
this.coinTimer:Start()

View File

@ -80,10 +80,10 @@ function ATM_GuessView:BindEvent()
end)
end)
Util.AddClick(this.battleDetailBtn, function()
this.battleDetailBtnClick()
this.battleDetailBtnClick(false)
end)
end
function this.battleDetailBtnClick()
function this.battleDetailBtnClick(isShowTip)
local betBattleInfo = ArenaTopMatchManager.GetBetBattleInfo()
LogGreen("sssssssssssss "..betBattleInfo.result)
if betBattleInfo.result == -1 then
@ -108,14 +108,16 @@ function this.battleDetailBtnClick()
arg.red.name = betBattleInfo.enemyInfo.name
arg.red.head = betBattleInfo.enemyInfo.head
arg.red.frame = betBattleInfo.enemyInfo.headFrame
UIManager.OpenPanel(UIName.ArenaResultPopup, arg)
UIManager.OpenPanel(UIName.ArenaResultPopup, arg,function()
Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnGuessDataUpdate)
end)
end)
end
--添加事件监听(用于子类重写)
function ATM_GuessView:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.TopMatch.OnTopMatchDataUpdate, this.RefreshBaseShow)
Game.GlobalEvent:AddEvent(GameEvent.TopMatch.OnGuessDataUpdate, this.RefreshBaseShow)
Game.GlobalEvent:AddEvent(GameEvent.TopMatch.OnGuessDataUpdate, this.RefreshGuessTipView)
Game.GlobalEvent:AddEvent(GameEvent.TopMatch.OnGuessDataUpdateShowTip, this.RefreshGuessTipView)
Game.GlobalEvent:AddEvent(GameEvent.TopMatch.OnGuessRateUpdate, this.RefreshBetRateShow)
Game.GlobalEvent:AddEvent(GameEvent.ATM_RankView.OnOpenBattle, this.battleDetailBtnClick)
@ -125,7 +127,7 @@ end
function ATM_GuessView:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.TopMatch.OnTopMatchDataUpdate, this.RefreshBaseShow)
Game.GlobalEvent:RemoveEvent(GameEvent.TopMatch.OnGuessDataUpdate, this.RefreshBaseShow)
Game.GlobalEvent:RemoveEvent(GameEvent.TopMatch.OnGuessDataUpdate, this.RefreshGuessTipView)
Game.GlobalEvent:RemoveEvent(GameEvent.TopMatch.OnGuessDataUpdateShowTip, this.RefreshGuessTipView)
Game.GlobalEvent:RemoveEvent(GameEvent.TopMatch.OnGuessRateUpdate, this.RefreshBetRateShow)
Game.GlobalEvent:RemoveEvent(GameEvent.ATM_RankView.OnOpenBattle, this.battleDetailBtnClick)
end
@ -162,6 +164,7 @@ function ATM_GuessView:OnOpen(...)
local isActive = ArenaTopMatchManager.IsTopMatchActive()
battleStage = ArenaTopMatchManager.GetBaseData().battleStage
LogGreen("battleStage "..battleStage.." "..tostring(isActive))
local isShow = isActive and (battleStage == TOP_MATCH_STAGE.ELIMINATION or battleStage == TOP_MATCH_STAGE.CHOOSE)
this.guessPanel:SetActive(isShow)
this.emptyPanel:SetActive(not isShow)
@ -181,6 +184,7 @@ function ATM_GuessView:OnOpen(...)
this.timer = Timer.New(_TimeUpdate, 1 , -1, true)
this.timer:Start()
end
this.RefreshGuessTipView()
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
@ -204,6 +208,9 @@ function this.RefreshBaseShow()
this.battleDetailBtn:SetActive(betBattleInfo.result ~= -1)
local myBetTarget = ArenaTopMatchManager.GetMyBetTarget()
LogGreen(" 本地保存的竞猜uid myBetTarget "..myBetTarget)
LogGreen("betBattleInfo.enemyInfo.uid "..betBattleInfo.enemyInfo.uid)
LogGreen("betBattleInfo.myInfo.uid "..betBattleInfo.myInfo.uid)
local IsBeted = myBetTarget and myBetTarget ~= 0
if IsBeted then
local isBetRed = myBetTarget == betBattleInfo.enemyInfo.uid
@ -254,8 +261,8 @@ function this.RefreshBetRateShow()
local battleState = ArenaTopMatchManager.GetBaseData().battleState
--当处于战斗时 记下当前竞猜币
if battleState==TOP_MATCH_TIME_STATE.OPEN_IN_BATTLE then
ArenaTopMatchManager.SetCoinNum(BagManager.GetItemCountById(GUESS_COIN))
if battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END then
-- ArenaTopMatchManager.SetCoinNum(BagManager.GetItemCountById(GUESS_COIN))
-- Log("<color=yellow>处于战斗时 存储的临时竞猜币数量 "..BagManager.GetItemCountById(GUESS_COIN).."</color>")
end
end
@ -266,10 +273,14 @@ function this.RefreshGuessTipView()
if IsCanBet then -- 判断是否有竞猜信息
local myBetTarget = ArenaTopMatchManager.GetMyBetTarget()
local IsBeted = myBetTarget and myBetTarget ~= 0
local isShow = ArenaTopMatchManager.GetcurIsShowDoGuessPopup()
LogGreen("isShow "..tostring(isShow))
--打开竞猜提示(处于秋后算账)
if IsBeted then
if IsBeted and isShow then
local baseInfo = ArenaTopMatchManager.GetBaseData()
if baseInfo.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_END then
LogGreen("开始弹竞猜结果")
ArenaTopMatchManager.SetcurIsShowDoGuessPopup(false)
matchPanel.OpenView(6)
end
end

View File

@ -77,18 +77,21 @@ function ATM_MainMatchView:OnOpen(...)
end
-- 状态切换
local isJoin = nil
local isOver = nil
function this.StateChange(isOpen)
local baseData = ArenaTopMatchManager.GetBaseData()
-- 没开启或者开启没参赛都属于未参赛
local isJoin = baseData.joinState == 1
local isOver = baseData.progress == -2
isJoin = baseData.joinState == 1
isOver = baseData.progress == -2
LogGreen("isOpen "..tostring(isOpen).." "..tostring(isJoin).." "..tostring(isOver).." "..baseData.joinState)
local battleInfo = ArenaTopMatchManager.GetBattleInfo()
LogGreen("battleInfo.result "..battleInfo.result.." baseData.battleState "..baseData.battleState)
LogGreen("baseData.loser "..tostring(baseData.loser))
if isOpen then
if isJoin then
this.SetPlayerInfo()
if battleInfo.result == 0 then
if baseData.loser then
this.SetWeedOutRootInfo()
end
else
@ -115,6 +118,9 @@ function this.battleDetailBtnClick()
local battleInfo = ArenaTopMatchManager.GetBattleInfo()
LogGreen("sssssssssssss "..battleInfo.result)
if not isJoin or (isJoin and isOver) then
return
end
if battleInfo.result == -1 then
Log(Language[10168])
return

View File

@ -124,6 +124,11 @@ function this.RefreshRankInfo()
elseif battleStage==TOP_MATCH_STAGE.CHOOSE then --当处于选拔赛 显示尚未决出8强
this.emptyText.text=EmptyTip[2]
end
--后加的结束了 也要显示八强数据
if battleStage == TOP_MATCH_STAGE.OVER and battleTurn==-2 and battleState==TOP_MATCH_TIME_STATE.OVER then
this.panel:SetActive(true)
this.empty:SetActive(false)
end
LogGreen("isShowRank "..tostring(isShowRank))
-- if not isShowRank then return end
ArenaTopMatchManager.RequestRankData(1,function()
@ -134,7 +139,7 @@ function this.RefreshRankInfo()
this.RefreshRankData(rankData,showTip.Two)
elseif battleStage == TOP_MATCH_STAGE.ELIMINATION and battleTurn==5 and battleState==TOP_MATCH_TIME_STATE.OPEN_IN_END and isShowRank then
this.RefreshRankData(rankData,showTip.One)
elseif battleStage == TOP_MATCH_STAGE.OVER and battleTurn==-2 and battleState==TOP_MATCH_TIME_STATE.OVER then
elseif battleStage == TOP_MATCH_STAGE.OVER and battleTurn==-2 and battleState==TOP_MATCH_TIME_STATE.OVER then--后加的结束了 也要显示八强数据
this.RefreshRankData(rankData,showTip.Four)
this.RefreshRankData(rankData,showTip.Two)
this.RefreshRankData(rankData,showTip.One)
@ -187,8 +192,8 @@ function this.RefreshRankData(data,type)
if type~=ShowType.One then
for i=1,type-1 do
this.SetItemData(i)
end
end
end
--输的玩家
for i=type,8 do
this.SetItemData(i,data[i])