fix
This commit is contained in:
parent
3f4f62903d
commit
83f6a11b03
File diff suppressed because it is too large
Load Diff
@ -153,6 +153,9 @@ end
|
||||
|
||||
-- 更新赛季信息
|
||||
function ArenaManager:reqArenaInfo()
|
||||
if not DataManager.ArenaData:isOpen() then
|
||||
return
|
||||
end
|
||||
self.isResetting = true
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.PVPInfoReq, {}, {}, self.rspArenaInfo, nil)
|
||||
end
|
||||
|
||||
@ -216,9 +216,9 @@ local _addSkillEffect = function(skillId, skillInfo, battleBaseData, battleContr
|
||||
if skillInfo.obj == BattleConst.SIDE_DEF then
|
||||
target = battleController:getOtherSideTeam(side):getMainUnit()
|
||||
elseif skillInfo.obj == BattleConst.SIDE_ATK then
|
||||
target = actionTeam
|
||||
target = actionTeam:getMainUnit()
|
||||
elseif skillInfo.obj == BattleConst.SIDE_ATK_ALL then
|
||||
for matchtype, comp in pairs(actionTeam) do
|
||||
for matchtype, comp in pairs(actionTeam:getUnitComp()) do
|
||||
local buffEntity = BattleBuffEntity:create()
|
||||
buffEntity:init(effect, comp.unitEntity)
|
||||
buffEntity:setTargetSide(skillInfo.obj)
|
||||
|
||||
@ -116,6 +116,8 @@ function ChapterManager:endFightFinish(result)
|
||||
DataManager:tryOpenModules()
|
||||
-- 更新每日挑战数据
|
||||
ModuleManager.DailyChallengeManager:onResetState()
|
||||
-- 更新竞技场数据
|
||||
ModuleManager.ArenaManager:reqArenaInfo()
|
||||
-- 更新副本活动
|
||||
DataManager.DungeonData:setDirty()
|
||||
-- 章节通关 标记可弹出章节礼包
|
||||
|
||||
@ -47,7 +47,13 @@ function CommerceManager:showBuyArenaTicketUI()
|
||||
end
|
||||
|
||||
function CommerceManager:onBuyArenaTicket(isAd)
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.BuyTicketReq, {ad = isAd}, {}, self.onBuyArenaTicketFinish, nil)
|
||||
local report = nil
|
||||
if isAd then
|
||||
report = BIReport.ITEM_GET_TYPE.ADS_BUY_ARENA_TICKET
|
||||
else
|
||||
report = BIReport.ITEM_GET_TYPE.GEM_BUY_ARENA_TICKET
|
||||
end
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.BuyTicketReq, {ad = isAd}, {}, self.onBuyArenaTicketFinish, report)
|
||||
end
|
||||
|
||||
function CommerceManager:onBuyArenaTicketFinish(data)
|
||||
@ -55,12 +61,12 @@ function CommerceManager:onBuyArenaTicketFinish(data)
|
||||
return
|
||||
end
|
||||
|
||||
if data.costs then
|
||||
-- 钻石购买
|
||||
DataManager.PlayerData:addArenaTicketGemBuyCount()
|
||||
else
|
||||
if data.reqData.ad then
|
||||
-- 激励视频
|
||||
DataManager.PlayerData:addArenaTicketAdBuyCount()
|
||||
else
|
||||
-- 钻石购买
|
||||
DataManager.PlayerData:addArenaTicketGemBuyCount()
|
||||
end
|
||||
if data.rewards then
|
||||
GFunc.showRewardBox(data.rewards)
|
||||
|
||||
@ -127,6 +127,9 @@ function DailyChallengeManager:endChallengeFinish(result)
|
||||
end
|
||||
|
||||
function DailyChallengeManager:onResetState()
|
||||
if not DataManager.DailyChallengeData:isOpen() then
|
||||
return
|
||||
end
|
||||
if DataManager.DailyChallengeData:getIsInReset() then
|
||||
return
|
||||
end
|
||||
|
||||
@ -17,19 +17,19 @@ function ArenaFormationUI:onPressBackspace()
|
||||
self:closeUI()
|
||||
end
|
||||
|
||||
function ArenaFormationUI:getCurrencyParams()
|
||||
if self.currencyParams == nil then
|
||||
self.currencyParams = {
|
||||
itemIds = {
|
||||
GConst.ItemConst.ITEM_ID_GEM,
|
||||
GConst.ItemConst.ITEM_ID_ARENA_TICKET
|
||||
},
|
||||
showType = GConst.CURRENCY_TYPE.HORIZONTAL
|
||||
}
|
||||
end
|
||||
-- function ArenaFormationUI:getCurrencyParams()
|
||||
-- if self.currencyParams == nil then
|
||||
-- self.currencyParams = {
|
||||
-- itemIds = {
|
||||
-- GConst.ItemConst.ITEM_ID_GEM,
|
||||
-- GConst.ItemConst.ITEM_ID_ARENA_TICKET
|
||||
-- },
|
||||
-- showType = GConst.CURRENCY_TYPE.HORIZONTAL
|
||||
-- }
|
||||
-- end
|
||||
|
||||
return self.currencyParams
|
||||
end
|
||||
-- return self.currencyParams
|
||||
-- end
|
||||
|
||||
function ArenaFormationUI:ctor(params)
|
||||
self.formationType = params
|
||||
|
||||
@ -18,10 +18,6 @@ function ArenaMatchUI:onPressBackspace()
|
||||
end
|
||||
|
||||
function ArenaMatchUI:getCurrencyParams()
|
||||
if not self.showResult then
|
||||
return nil
|
||||
end
|
||||
|
||||
if self.currencyParams == nil then
|
||||
self.currencyParams = {
|
||||
itemIds = {
|
||||
@ -137,7 +133,7 @@ end
|
||||
function ArenaMatchUI:showMatchLoading()
|
||||
self.matchLoading:setActive(true)
|
||||
self.matchResult:setActive(false)
|
||||
self.showResult = false
|
||||
UIManager:setBarsVisible(self, false)
|
||||
|
||||
self.txSeason:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_21, DataManager.ArenaData:getSeason()))
|
||||
self.txLoading:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_22))
|
||||
@ -150,20 +146,19 @@ function ArenaMatchUI:showMatchLoading()
|
||||
self.waitSid = self:performWithDelayGlobal(function()
|
||||
self:showMatchResult()
|
||||
end, 1.5)
|
||||
UIManager:updateBarsState(self)
|
||||
end
|
||||
|
||||
-- 展示匹配结果页
|
||||
function ArenaMatchUI:showMatchResult()
|
||||
local matchInfo = DataManager.ArenaData:getMatchInfo()
|
||||
if not matchInfo then
|
||||
Logger.logError("没有匹配对象却进入了匹配结果页,检查是否是网络慢了等情况")
|
||||
Logger.logError("没有匹配对象却进入了匹配结果页,有问题@.#")
|
||||
return
|
||||
end
|
||||
|
||||
self.matchLoading:setActive(false)
|
||||
self.matchResult:setActive(true)
|
||||
self.showResult = true
|
||||
UIManager:setBarsVisible(self, true)
|
||||
|
||||
self.spineVS:playAnimComplete("born", false, true, function()
|
||||
self.spineVS:playAnim("idle", true, true)
|
||||
@ -223,7 +218,6 @@ function ArenaMatchUI:showMatchResult()
|
||||
self:refreshCountdown()
|
||||
end, 1)
|
||||
self:refreshCountdown()
|
||||
UIManager:updateBarsState(self)
|
||||
end
|
||||
|
||||
function ArenaMatchUI:refreshCountdown()
|
||||
@ -231,6 +225,7 @@ function ArenaMatchUI:refreshCountdown()
|
||||
if self.freeRematchCD <= 0 then
|
||||
-- 冷却已好
|
||||
self.txFreeCountdown:setActive(false)
|
||||
self.imgAd:setActive(false)
|
||||
|
||||
self:unscheduleGlobal(self.countdownSid)
|
||||
else
|
||||
|
||||
@ -216,6 +216,7 @@ end
|
||||
function BattleResultUI:refreshArenaNode()
|
||||
if self.battleType ~= GConst.BattleConst.BATTLE_TYPE.ARENA then
|
||||
self.arenaNode:setVisible(false)
|
||||
self.arenaBoxNode:setVisible(false)
|
||||
return
|
||||
end
|
||||
|
||||
@ -254,7 +255,6 @@ function BattleResultUI:refreshArenaNode()
|
||||
end
|
||||
|
||||
-- 检查ad宝箱显示
|
||||
self.arenaBoxNode:setVisible(false)
|
||||
if self.isWin then
|
||||
if (self.arenaTotalCount % GFunc.getConstIntValue("arena_win_adbox")) == 0 then
|
||||
self.arenaBoxNode:setVisible(true)
|
||||
@ -270,6 +270,8 @@ end
|
||||
function BattleResultUI:refreshRewards()
|
||||
self.animRewards = {}
|
||||
self.rewardNode:setVisible(true)
|
||||
self.goldPigNode:setVisible(false)
|
||||
|
||||
self.rewardTxTitle:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_DESC))
|
||||
self.continue:setText(I18N:getGlobalText(I18N.GlobalConst.CONTINUE_DESC))
|
||||
self.rewardScrollRectComp:addInitCallback(function()
|
||||
|
||||
@ -2,7 +2,7 @@ local MainCompBaseCell = require "app/ui/main_city/component/main_comp_base_cell
|
||||
local ArenaComp = class("ArenaComp", MainCompBaseCell)
|
||||
|
||||
function ArenaComp:getIsOpen()
|
||||
return DataManager.ArenaData:isOpen()
|
||||
return DataManager.ArenaData:isOpen(true)
|
||||
end
|
||||
|
||||
function ArenaComp:getEntranceName()
|
||||
@ -120,7 +120,7 @@ function ArenaComp:refreshBounty()
|
||||
end
|
||||
|
||||
function ArenaComp:refreshShow()
|
||||
if not DataManager.ArenaData:isOpen() then
|
||||
if not DataManager.ArenaData:isOpen(true) then
|
||||
return
|
||||
end
|
||||
|
||||
@ -137,7 +137,7 @@ function ArenaComp:refreshShow()
|
||||
end
|
||||
|
||||
function ArenaComp:updateTimer()
|
||||
if not DataManager.ArenaData:isOpen() then
|
||||
if not DataManager.ArenaData:isOpen(true) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@ -299,6 +299,7 @@ function MainComp:refresh()
|
||||
self:refreshStageFormaion()
|
||||
self:refreshChallenge()
|
||||
self:refreshDungeon()
|
||||
self:refreshArena()
|
||||
end
|
||||
|
||||
function MainComp:getCurModuleType()
|
||||
|
||||
@ -267,6 +267,13 @@ function MainCityUI:_bind()
|
||||
end
|
||||
end
|
||||
end)
|
||||
self:bind(DataManager.ArenaData, "isDirty", function()
|
||||
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
|
||||
if self.subComps[self.selectedIndex] then
|
||||
self.subComps[self.selectedIndex]:refreshArena()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function MainCityUI:initBottomUI()
|
||||
|
||||
@ -29,7 +29,12 @@ function ArenaData:init(data)
|
||||
|
||||
self.curGradingId = self:getGradingIdFromScore(self.score) -- 当前所在段位id
|
||||
DataManager.FormationData:initArena(data.attack_array_heroes, data.defend_array_heroes)
|
||||
DataManager.PlayerData:initArena(data.today_ticket_buy_count, data.today_ticket_ad_count)
|
||||
|
||||
-- 未找到相应赛季数据
|
||||
if not self:hasServerData() then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_30))
|
||||
end
|
||||
self:setDirty()
|
||||
end
|
||||
|
||||
@ -58,18 +63,22 @@ function ArenaData:getTimeCfg(season)
|
||||
return result
|
||||
end
|
||||
|
||||
-- 是否开启
|
||||
function ArenaData:isOpen()
|
||||
-- 是否开启,checkData:是否判断数据
|
||||
function ArenaData:isOpen(checkData)
|
||||
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.ARENA, true) then
|
||||
return false
|
||||
end
|
||||
if self.cfgRank == nil or self.cfgTime == nil then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_30))
|
||||
if checkData and not self:hasServerData() then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- 是否有服务器数据
|
||||
function ArenaData:hasServerData()
|
||||
return self.season and self:getRankCfg(self.season)
|
||||
end
|
||||
|
||||
-- 是否在赛季结算中
|
||||
function ArenaData:isInSeasonSettlement()
|
||||
return self:getRemainSeasonTime() > 0 and self:getRemainSeasonSettlementTime() < 0
|
||||
@ -80,11 +89,6 @@ function ArenaData:getSeason()
|
||||
return self.season
|
||||
end
|
||||
|
||||
-- 获取帮助文案
|
||||
function ArenaData:getHelpDesc()
|
||||
return nil
|
||||
end
|
||||
|
||||
-- 获取当前赛季段位id列表
|
||||
function ArenaData:getGradingIdList()
|
||||
return table.keys(self.cfgRank)
|
||||
@ -316,7 +320,7 @@ end
|
||||
|
||||
-- 是否能看视频重新匹配
|
||||
function ArenaData:canAdRematch()
|
||||
return self.todayAdRematchCount < self:getRematchAdDailyMaxNum() and self:getFreeRematchCd() > 0
|
||||
return self:getFreeRematchCd() > 0 and self.todayAdRematchCount < self:getRematchAdDailyMaxNum()
|
||||
end
|
||||
|
||||
-- 获取上赛季段位id
|
||||
|
||||
@ -42,11 +42,6 @@ function PlayerData:init(data)
|
||||
self.data.vitGemCount = energyLimit.diamond_count or 0
|
||||
self.data.vitADCount = energyLimit.ad_count or 0
|
||||
|
||||
-- 竞技场入场券购买情况初始化
|
||||
local arenaTicketLimit = data.arena or GConst.EMPTY_TABLE
|
||||
self.data.arenaTicketGemCount = arenaTicketLimit.today_ticket_buy_count or 0
|
||||
self.data.arenaTicketADCount = arenaTicketLimit.today_ticket_ad_count or 0
|
||||
|
||||
self.lastLoginTime = basicInfo.lastLoginTime or Time:getBeginningOfServerToday()
|
||||
DataManager:registerCrossDayFunc("PlayerData", function()
|
||||
self:resetOnCrossDay()
|
||||
@ -62,6 +57,12 @@ function PlayerData:init(data)
|
||||
self:initModuleUnlockInfo()
|
||||
end
|
||||
|
||||
-- 竞技场入场券购买情况初始化
|
||||
function PlayerData:initArena(gemCount, adCount)
|
||||
self.data.arenaTicketGemCount = gemCount or 0
|
||||
self.data.arenaTicketADCount = adCount or 0
|
||||
end
|
||||
|
||||
function PlayerData:initModuleUnlockInfo()
|
||||
self.showModuleUnlockChapter = 0
|
||||
if self.moduleUnlockChapterMap then
|
||||
@ -492,7 +493,7 @@ function PlayerData:getShowFrameIds()
|
||||
return table.addArray(unlockIds, lockIds)
|
||||
end
|
||||
|
||||
-- 竞技场战令
|
||||
-- 竞技场入场券
|
||||
|
||||
function PlayerData:getArenaTicket()
|
||||
return self.arenaTicket or 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user