逻辑完善
This commit is contained in:
parent
98d46965f9
commit
52a1631ad4
@ -110,6 +110,9 @@ BIReport.ITEM_GET_TYPE = {
|
|||||||
DUNGEON_SHARDS_CHALLENGE = "DungeonShardsChallenge", -- 碎片副本挑战
|
DUNGEON_SHARDS_CHALLENGE = "DungeonShardsChallenge", -- 碎片副本挑战
|
||||||
DUNGEON_SHARDS_END = "DungeonShardsEnd", -- 碎片副本结算
|
DUNGEON_SHARDS_END = "DungeonShardsEnd", -- 碎片副本结算
|
||||||
DUNGEON_SHARDS_SWEEP = "DungeonShardsSweep", -- 碎片副本扫荡
|
DUNGEON_SHARDS_SWEEP = "DungeonShardsSweep", -- 碎片副本扫荡
|
||||||
|
ARENA_REMATCH_CD = "ArenaRematchCd",
|
||||||
|
ARENA_REWARD = "ArenaReward",
|
||||||
|
ARENA_SETTLEMENT = "ArenaSettlement",
|
||||||
CHANGE_NAME = "ChangeName", -- 重命名
|
CHANGE_NAME = "ChangeName", -- 重命名
|
||||||
CHANGE_AVATAR = "ChangeAvatar", -- 修改头像
|
CHANGE_AVATAR = "ChangeAvatar", -- 修改头像
|
||||||
CHANGE_FRAME = "ChangeFrame", -- 修改头像框
|
CHANGE_FRAME = "ChangeFrame", -- 修改头像框
|
||||||
|
|||||||
@ -87,6 +87,7 @@ function ArenaManager:rspSettlement(result)
|
|||||||
-- 总共输的次数result.total_lose_count
|
-- 总共输的次数result.total_lose_count
|
||||||
|
|
||||||
-- 展示结算界面
|
-- 展示结算界面
|
||||||
|
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.ARENA, result.rewards, result.reqData.combatReport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ end
|
|||||||
|
|
||||||
-- 领取上赛季奖励
|
-- 领取上赛季奖励
|
||||||
function ArenaManager:reqLastSeasonReward()
|
function ArenaManager:reqLastSeasonReward()
|
||||||
self:sendMessage(ProtoMsgType.FromMsgEnum.PVPSeasonRewardReq, {}, {}, self.rspLastSeasonReward, nil)
|
self:sendMessage(ProtoMsgType.FromMsgEnum.PVPSeasonRewardReq, {}, {}, self.rspLastSeasonReward, BIReport.ITEM_GET_TYPE.ARENA_REWARD)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaManager:rspLastSeasonReward(result)
|
function ArenaManager:rspLastSeasonReward(result)
|
||||||
@ -150,12 +151,13 @@ end
|
|||||||
|
|
||||||
-- 结束匹配cd
|
-- 结束匹配cd
|
||||||
function ArenaManager:reqOverCD(isAd)
|
function ArenaManager:reqOverCD(isAd)
|
||||||
self:sendMessage(ProtoMsgType.FromMsgEnum.PVPOverCDReq, {ad = isAd}, {}, self.rspOverCD, nil)
|
self:sendMessage(ProtoMsgType.FromMsgEnum.PVPOverCDReq, {ad = isAd}, {}, self.rspOverCD, BIReport.ITEM_GET_TYPE.ARENA_REMATCH_CD)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaManager:rspOverCD(result)
|
function ArenaManager:rspOverCD(result)
|
||||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||||
DataManager.ArenaData:onOverFreeRematchCD(result.reqData.ad)
|
DataManager.ArenaData:onOverFreeRematchCD(result.reqData.ad)
|
||||||
|
self:reqMatch()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -106,8 +106,10 @@ end
|
|||||||
|
|
||||||
-- formation = {{id = 000, level = 000}, {id = 000, level = 000}, ...}
|
-- formation = {{id = 000, level = 000}, {id = 000, level = 000}, ...}
|
||||||
function TipsManager:showHeroFormation(targetObj, formation)
|
function TipsManager:showHeroFormation(targetObj, formation)
|
||||||
|
local tarCornerScreenPos, location = self:getCornerScreenPosition(targetObj, TipsManager.ALIGN_TYPE.BOTTOM_CENTER)
|
||||||
local params = {
|
local params = {
|
||||||
targetObj = targetObj,
|
tarCornerScreenPos = tarCornerScreenPos,
|
||||||
|
location = location,
|
||||||
formation = formation,
|
formation = formation,
|
||||||
}
|
}
|
||||||
UIManager:showUI("app/ui/tips/formation_tips", params)
|
UIManager:showUI("app/ui/tips/formation_tips", params)
|
||||||
|
|||||||
@ -19,11 +19,11 @@ end
|
|||||||
|
|
||||||
function ArenaBuyTicketUI:onLoadRootComplete()
|
function ArenaBuyTicketUI:onLoadRootComplete()
|
||||||
local uiMap = self.root:genAllChildren()
|
local uiMap = self.root:genAllChildren()
|
||||||
uiMap["arena_buy_ticket_ui.bg.close_btn"]:addClickListener(function()
|
uiMap["arena_buy_ticket_ui.bg.btn_close"]:addClickListener(function()
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
uiMap["arena_buy_ticket_ui.bg.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BUY_ENERGY))
|
uiMap["arena_buy_ticket_ui.bg.tx_title"]:setText(I18N:getGlobalText(I18N.GlobalConst.BUY_ENERGY))
|
||||||
local constCfg = ConfigManager:getConfig("const")
|
local constCfg = ConfigManager:getConfig("const")
|
||||||
local diamondReward = constCfg["arena_notes_diamond_buy"].reward
|
local diamondReward = constCfg["arena_notes_diamond_buy"].reward
|
||||||
local adReward = constCfg["arena_notes_ad_buy"].reward
|
local adReward = constCfg["arena_notes_ad_buy"].reward
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
local ArenaFormationUI = class("ArenaFormationUI", BaseUI)
|
local ArenaFormationUI = class("ArenaFormationUI", BaseUI)
|
||||||
|
|
||||||
function ArenaFormationUI:isFullScreen()
|
function ArenaFormationUI:isFullScreen()
|
||||||
return false
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaFormationUI:showCommonBG()
|
function ArenaFormationUI:showCommonBG()
|
||||||
@ -17,6 +17,20 @@ function ArenaFormationUI:onPressBackspace()
|
|||||||
self:closeUI()
|
self:closeUI()
|
||||||
end
|
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
|
||||||
|
|
||||||
function ArenaFormationUI:ctor(params)
|
function ArenaFormationUI:ctor(params)
|
||||||
self.formationType = params
|
self.formationType = params
|
||||||
end
|
end
|
||||||
|
|||||||
@ -17,6 +17,24 @@ function ArenaMatchUI:onPressBackspace()
|
|||||||
self:closeUI()
|
self:closeUI()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ArenaMatchUI:getCurrencyParams()
|
||||||
|
if not self.showResult then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
function ArenaMatchUI:ctor(isBack)
|
function ArenaMatchUI:ctor(isBack)
|
||||||
self.isBack = isBack-- 是否是返回到匹配结果界面
|
self.isBack = isBack-- 是否是返回到匹配结果界面
|
||||||
end
|
end
|
||||||
@ -29,10 +47,16 @@ end
|
|||||||
|
|
||||||
function ArenaMatchUI:onClose()
|
function ArenaMatchUI:onClose()
|
||||||
if self.waitSid then
|
if self.waitSid then
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.waitSid)
|
self:unscheduleGlobal(self.waitSid)
|
||||||
|
self.waitSid = nil
|
||||||
end
|
end
|
||||||
if self.countdownSid then
|
if self.countdownSid then
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.countdownSid)
|
self:unscheduleGlobal(self.countdownSid)
|
||||||
|
self.countdownSid = nil
|
||||||
|
end
|
||||||
|
if self.existSid then
|
||||||
|
self:unscheduleGlobal(self.existSid)
|
||||||
|
self.existSid = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -90,9 +114,6 @@ function ArenaMatchUI:onLoadRootComplete()
|
|||||||
UIManager:showUI("app/ui/arena/arena_formation_ui", GConst.BattleConst.FORMATION_TYPE.ARENA_ATTACK)
|
UIManager:showUI("app/ui/arena/arena_formation_ui", GConst.BattleConst.FORMATION_TYPE.ARENA_ATTACK)
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
end)
|
end)
|
||||||
self:bind(DataManager.ArenaData, "isDirty", function()
|
|
||||||
self:showMatchResult()
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaMatchUI:onRefresh()
|
function ArenaMatchUI:onRefresh()
|
||||||
@ -111,6 +132,7 @@ end
|
|||||||
function ArenaMatchUI:showMatchLoading()
|
function ArenaMatchUI:showMatchLoading()
|
||||||
self.matchLoading:setActive(true)
|
self.matchLoading:setActive(true)
|
||||||
self.matchResult:setActive(false)
|
self.matchResult:setActive(false)
|
||||||
|
self.showResult = false
|
||||||
|
|
||||||
self.txSeason:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_21, DataManager.ArenaData:getSeason()))
|
self.txSeason:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_21, DataManager.ArenaData:getSeason()))
|
||||||
self.txLoading:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_22))
|
self.txLoading:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_22))
|
||||||
@ -118,34 +140,33 @@ function ArenaMatchUI:showMatchLoading()
|
|||||||
|
|
||||||
-- 等待
|
-- 等待
|
||||||
if self.waitSid then
|
if self.waitSid then
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.waitSid)
|
self:unscheduleGlobal(self.waitSid)
|
||||||
end
|
end
|
||||||
self.waitSid = self.matchLoading:performWithDelayGlobal(function()
|
self.waitSid = self:performWithDelayGlobal(function()
|
||||||
self:showMatchResult()
|
self:showMatchResult()
|
||||||
end, 1.5)
|
end, 1.5)
|
||||||
|
UIManager:updateBarsState(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 展示匹配结果页
|
-- 展示匹配结果页
|
||||||
function ArenaMatchUI:showMatchResult()
|
function ArenaMatchUI:showMatchResult()
|
||||||
local matchInfo = DataManager.ArenaData:getMatchInfo()
|
local matchInfo = DataManager.ArenaData:getMatchInfo()
|
||||||
if not matchInfo then
|
if not matchInfo then
|
||||||
-- 基本不会走到这
|
|
||||||
Logger.logError("没有匹配对象却进入了匹配结果页,检查是否是网络慢了等情况")
|
Logger.logError("没有匹配对象却进入了匹配结果页,检查是否是网络慢了等情况")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
self.matchLoading:setActive(false)
|
self.matchLoading:setActive(false)
|
||||||
self.matchResult:setActive(true)
|
self.matchResult:setActive(true)
|
||||||
self.freeRematchCD = DataManager.ArenaData:getFreeRematchCd()
|
self.showResult = true
|
||||||
|
|
||||||
Logger.printTable(matchInfo)
|
self.freeRematchCD = DataManager.ArenaData:getFreeRematchCd()
|
||||||
Logger.printTable(self.freeRematchCD)
|
|
||||||
|
|
||||||
self.txStart:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
|
self.txStart:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
|
||||||
self.txConst:setText(DataManager.ArenaData:getFightCostNum())
|
self.txConst:setText(DataManager.ArenaData:getFightCostNum())
|
||||||
self.txRematch:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_23))
|
self.txRematch:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_23))
|
||||||
self.txFormation:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_10))
|
self.txFormation:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_10))
|
||||||
self.imgAd:setActive(self.freeRematchCD > 0 and DataManager.ArenaData:canAdRematch())
|
self.imgAd:setActive(DataManager.ArenaData:canAdRematch())
|
||||||
|
|
||||||
self.matchAvatar:refresh(matchInfo.avatar, matchInfo.avatar_frame)
|
self.matchAvatar:refresh(matchInfo.avatar, matchInfo.avatar_frame)
|
||||||
self.matchTxName:setText(matchInfo.name)
|
self.matchTxName:setText(matchInfo.name)
|
||||||
@ -172,13 +193,29 @@ function ArenaMatchUI:showMatchResult()
|
|||||||
end
|
end
|
||||||
self.selfHeroFormationComp:refreshBriefInfo(formation)
|
self.selfHeroFormationComp:refreshBriefInfo(formation)
|
||||||
|
|
||||||
if self.countdownSid then
|
-- 对手存在倒计时
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.countdownSid)
|
self.matchExistCd = DataManager.ArenaData:getMatchExistRemainTime()
|
||||||
|
if self.existSid then
|
||||||
|
self:unscheduleGlobal(self.existSid)
|
||||||
end
|
end
|
||||||
self.countdownSid = self.txFreeCountdown:scheduleGlobal(function()
|
self.existSid = self:scheduleGlobal(function()
|
||||||
|
self.matchExistCd = self.matchExistCd - 1
|
||||||
|
if self.matchExistCd <= 0 then
|
||||||
|
self:unscheduleGlobal(self.existSid)
|
||||||
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_8))
|
||||||
|
self:closeUI()
|
||||||
|
end
|
||||||
|
end, 1)
|
||||||
|
|
||||||
|
-- 免费匹配cd倒计时
|
||||||
|
if self.countdownSid then
|
||||||
|
self:unscheduleGlobal(self.countdownSid)
|
||||||
|
end
|
||||||
|
self.countdownSid = self:scheduleGlobal(function()
|
||||||
self:refreshCountdown()
|
self:refreshCountdown()
|
||||||
end, 1)
|
end, 1)
|
||||||
self:refreshCountdown()
|
self:refreshCountdown()
|
||||||
|
UIManager:updateBarsState(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaMatchUI:refreshCountdown()
|
function ArenaMatchUI:refreshCountdown()
|
||||||
@ -187,7 +224,7 @@ function ArenaMatchUI:refreshCountdown()
|
|||||||
-- 冷却已好
|
-- 冷却已好
|
||||||
self.txFreeCountdown:setActive(false)
|
self.txFreeCountdown:setActive(false)
|
||||||
|
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.countdownSid)
|
self:unscheduleGlobal(self.countdownSid)
|
||||||
else
|
else
|
||||||
-- 冷却未好
|
-- 冷却未好
|
||||||
self.txFreeCountdown:setActive(true)
|
self.txFreeCountdown:setActive(true)
|
||||||
@ -199,21 +236,22 @@ end
|
|||||||
function ArenaMatchUI:onClickRematch()
|
function ArenaMatchUI:onClickRematch()
|
||||||
if self.freeRematchCD > 0 then
|
if self.freeRematchCD > 0 then
|
||||||
-- 在cd时间内
|
-- 在cd时间内
|
||||||
|
|
||||||
if DataManager.ArenaData:canAdRematch() then
|
if DataManager.ArenaData:canAdRematch() then
|
||||||
-- 看视频
|
-- 看视频
|
||||||
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.ARENA_REMATCH, function ()
|
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.ARENA_REMATCH, function ()
|
||||||
ModuleManager.ArenaManager:reqOverCD(true)
|
ModuleManager.ArenaManager:reqOverCD(true)
|
||||||
|
self:showMatchLoading()
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
-- 钻石
|
-- 钻石
|
||||||
local params ={
|
local params ={
|
||||||
content = I18N:getGlobalText(I18N.GlobalConst.BOUNTY_BUY_LEVEL_COUNTENT),
|
content = I18N:getGlobalText(I18N.GlobalConst.BOUNTY_BUY_LEVEL_COUNTENT),
|
||||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
||||||
costId = ItemConst.ITEM_ID_GEM,
|
costId = GConst.ItemConst.ITEM_ID_GEM,
|
||||||
costNum = DataManager.ArenaData:getRematchConstGem(),
|
costNum = DataManager.ArenaData:getRematchConstGem(),
|
||||||
okFunc = function()
|
okFunc = function()
|
||||||
ModuleManager.ArenaManager:reqOverCD(false)
|
ModuleManager.ArenaManager:reqOverCD(false)
|
||||||
|
self:showMatchLoading()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
GFunc.showMessageBox(params)
|
GFunc.showMessageBox(params)
|
||||||
|
|||||||
@ -35,14 +35,14 @@ function ArenaRankUI:onLoadRootComplete()
|
|||||||
|
|
||||||
self.txTitle = uiMap["arena_rank_ui.bg.title.tx_title"]
|
self.txTitle = uiMap["arena_rank_ui.bg.title.tx_title"]
|
||||||
self.closeBtn = uiMap["arena_rank_ui.bg.close_btn"]
|
self.closeBtn = uiMap["arena_rank_ui.bg.close_btn"]
|
||||||
|
self.imgRank = uiMap["arena_rank_ui.bg.my_rank.img_rank"]
|
||||||
self.txRank = uiMap["arena_rank_ui.bg.my_rank.tx_rank"]
|
self.txRank = uiMap["arena_rank_ui.bg.my_rank.tx_rank"]
|
||||||
self.playerHeadCell = CellManager:addCellComp(uiMap["arena_rank_ui.bg.my_rank.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
self.playerHeadCell = CellManager:addCellComp(uiMap["arena_rank_ui.bg.my_rank.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
||||||
self.txName = uiMap["arena_rank_ui.bg.my_rank.tx_name"]
|
self.txName = uiMap["arena_rank_ui.bg.my_rank.tx_name"]
|
||||||
self.cellGrading = uiMap["arena_rank_ui.bg.my_rank.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
self.cellGrading = uiMap["arena_rank_ui.bg.my_rank.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
||||||
self.scrollRectComp = uiMap["arena_rank_ui.bg.list_rank"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
|
self.scrollRectComp = uiMap["arena_rank_ui.bg.list_rank"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
|
||||||
|
|
||||||
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_5))
|
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_5))
|
||||||
self.txRank:setText(DataManager.ArenaData:getRank())
|
|
||||||
self.txName:setText(DataManager.PlayerData:getNickname())
|
self.txName:setText(DataManager.PlayerData:getNickname())
|
||||||
self.cellGrading:refresh(DataManager.ArenaData:getGradingId())
|
self.cellGrading:refresh(DataManager.ArenaData:getGradingId())
|
||||||
self.playerHeadCell:refresh(nil, nil, false)
|
self.playerHeadCell:refresh(nil, nil, false)
|
||||||
@ -65,6 +65,25 @@ end
|
|||||||
function ArenaRankUI:onRefresh()
|
function ArenaRankUI:onRefresh()
|
||||||
self.scrollRectComp:clearCells()
|
self.scrollRectComp:clearCells()
|
||||||
self.scrollRectComp:refillCells(DataManager.ArenaData:getRankCount())
|
self.scrollRectComp:refillCells(DataManager.ArenaData:getRankCount())
|
||||||
|
|
||||||
|
local rank = DataManager.ArenaData:getRank()
|
||||||
|
if rank == 1 then
|
||||||
|
self.txRank:setActive(false)
|
||||||
|
self.imgRank:setActive(true)
|
||||||
|
self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_1")
|
||||||
|
elseif rank == 2 then
|
||||||
|
self.txRank:setActive(false)
|
||||||
|
self.imgRank:setActive(true)
|
||||||
|
self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_2")
|
||||||
|
elseif rank == 3 then
|
||||||
|
self.txRank:setActive(false)
|
||||||
|
self.imgRank:setActive(true)
|
||||||
|
self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_3")
|
||||||
|
else
|
||||||
|
self.imgRank:setActive(false)
|
||||||
|
self.txRank:setActive(true)
|
||||||
|
self.txRank:setText(rank)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return ArenaRankUI
|
return ArenaRankUI
|
||||||
@ -27,6 +27,10 @@ function ArenaSeasonRewardUI:onReshow()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ArenaSeasonRewardUI:onClose()
|
function ArenaSeasonRewardUI:onClose()
|
||||||
|
if self.seasonChangeSid then
|
||||||
|
self:unscheduleGlobal(self.seasonChangeSid)
|
||||||
|
self.seasonChangeSid = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaSeasonRewardUI:onLoadRootComplete()
|
function ArenaSeasonRewardUI:onLoadRootComplete()
|
||||||
@ -77,9 +81,9 @@ function ArenaSeasonRewardUI:showSeasonReward()
|
|||||||
self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_12, DataManager.ArenaData:getSeason()))
|
self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_12, DataManager.ArenaData:getSeason()))
|
||||||
|
|
||||||
if self.seasonChangeSid then
|
if self.seasonChangeSid then
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.seasonChangeSid)
|
self:unscheduleGlobal(self.seasonChangeSid)
|
||||||
end
|
end
|
||||||
self.seasonChangeSid = self.txTime:scheduleGlobal(function()
|
self.seasonChangeSid = self:scheduleGlobal(function()
|
||||||
self:refreshCountdown()
|
self:refreshCountdown()
|
||||||
end, 1)
|
end, 1)
|
||||||
|
|
||||||
@ -110,7 +114,7 @@ function ArenaSeasonRewardUI:showGetReward()
|
|||||||
self.txGrading:setText(DataManager.ArenaData:getGradingName(lastId))
|
self.txGrading:setText(DataManager.ArenaData:getGradingName(lastId))
|
||||||
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
|
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
|
||||||
|
|
||||||
self.btnGet:addRedPoint(65, 35, 0.6)
|
self.btnGet:addRedPoint(110, 35, 0.6)
|
||||||
|
|
||||||
self.getRewardComp:addInitCallback(function()
|
self.getRewardComp:addInitCallback(function()
|
||||||
return GConst.TYPEOF_LUA_CLASS.REWARD_CELL
|
return GConst.TYPEOF_LUA_CLASS.REWARD_CELL
|
||||||
|
|||||||
@ -4,6 +4,7 @@ function ArenaRankCell:init()
|
|||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
|
|
||||||
self.txRank = uiMap["arena_rank_cell.tx_rank"]
|
self.txRank = uiMap["arena_rank_cell.tx_rank"]
|
||||||
|
self.imgRank = uiMap["arena_rank_cell.img_rank"]
|
||||||
self.playerHeadCell = CellManager:addCellComp(uiMap["arena_rank_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
self.playerHeadCell = CellManager:addCellComp(uiMap["arena_rank_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
|
||||||
self.txName = uiMap["arena_rank_cell.tx_name"]
|
self.txName = uiMap["arena_rank_cell.tx_name"]
|
||||||
self.cellGrading = uiMap["arena_rank_cell.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
self.cellGrading = uiMap["arena_rank_cell.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
|
||||||
@ -25,13 +26,34 @@ function ArenaRankCell:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ArenaRankCell:refresh(rank)
|
function ArenaRankCell:refresh(rank)
|
||||||
self.clickFormation = false
|
|
||||||
self.rankInfo = DataManager.ArenaData:getRankData(rank)
|
self.rankInfo = DataManager.ArenaData:getRankData(rank)
|
||||||
|
|
||||||
self.playerHeadCell:refresh(self.rankInfo.avatar, self.rankInfo.avatar_frame)
|
self.playerHeadCell:refresh(self.rankInfo.avatar, self.rankInfo.avatar_frame)
|
||||||
self.txRank:setText(self.rankInfo.rank)
|
self.txRank:setText(self.rankInfo.rank)
|
||||||
self.txName:setText(rank)
|
self.txName:setText(self.rankInfo.name)
|
||||||
self.cellGrading:refresh(DataManager.ArenaData:getGradingIdFromScore(self.rankInfo.score))
|
self.cellGrading:refresh(DataManager.ArenaData:getGradingIdFromScore(self.rankInfo.score))
|
||||||
|
|
||||||
|
if rank == 1 then
|
||||||
|
self.txRank:setActive(false)
|
||||||
|
self.imgRank:setActive(true)
|
||||||
|
self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_1")
|
||||||
|
self.baseObject:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_bg_1")
|
||||||
|
elseif rank == 2 then
|
||||||
|
self.txRank:setActive(false)
|
||||||
|
self.imgRank:setActive(true)
|
||||||
|
self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_2")
|
||||||
|
self.baseObject:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_bg_2")
|
||||||
|
elseif rank == 3 then
|
||||||
|
self.txRank:setActive(false)
|
||||||
|
self.imgRank:setActive(true)
|
||||||
|
self.imgRank:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_3")
|
||||||
|
self.baseObject:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_bg_3")
|
||||||
|
else
|
||||||
|
self.imgRank:setActive(false)
|
||||||
|
self.txRank:setActive(true)
|
||||||
|
self.txRank:setText(rank)
|
||||||
|
self.baseObject:setSprite(GConst.ATLAS_PATH.ARENA, "arena_ranking_bg_4")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaRankCell:showHeroFormationTips()
|
function ArenaRankCell:showHeroFormationTips()
|
||||||
|
|||||||
@ -151,6 +151,12 @@ end
|
|||||||
|
|
||||||
function BattleResultUI:refreshUnitNodeAnim(parent)
|
function BattleResultUI:refreshUnitNodeAnim(parent)
|
||||||
local uiMap = self.root:genAllChildren()
|
local uiMap = self.root:genAllChildren()
|
||||||
|
if not parent then
|
||||||
|
uiMap["battle_result_ui.unit_node"]:setActive(false)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
uiMap["battle_result_ui.unit_node"]:setActive(true)
|
||||||
|
end
|
||||||
uiMap["battle_result_ui.unit_node"]:setParent(parent, false)
|
uiMap["battle_result_ui.unit_node"]:setParent(parent, false)
|
||||||
uiMap["battle_result_ui.unit_node"]:setAnchoredPosition(0, 0)
|
uiMap["battle_result_ui.unit_node"]:setAnchoredPosition(0, 0)
|
||||||
local canvasNodeUnit = parent:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
local canvasNodeUnit = parent:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
||||||
@ -167,6 +173,16 @@ function BattleResultUI:refreshUnitNodeAnim(parent)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleResultUI:refreshArenaNode(isShow)
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
if not isShow then
|
||||||
|
uiMap["battle_result_ui.arena_node"]:setActive(false)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
uiMap["battle_result_ui.arena_node"]:setActive(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleResultUI:refreshRewards()
|
function BattleResultUI:refreshRewards()
|
||||||
if self.scrollRectComp then
|
if self.scrollRectComp then
|
||||||
self.scrollRectComp:updateAllCell()
|
self.scrollRectComp:updateAllCell()
|
||||||
|
|||||||
@ -444,6 +444,7 @@ function BountyMainUI:scrollToIndex(targetIndex)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BountyMainUI:updateTime()
|
function BountyMainUI:updateTime()
|
||||||
|
Logger.logError("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
||||||
local remainTime = self.endTime - Time:getServerTime()
|
local remainTime = self.endTime - Time:getServerTime()
|
||||||
if remainTime < 0 then
|
if remainTime < 0 then
|
||||||
UIManager:closeUnderUI(self)
|
UIManager:closeUnderUI(self)
|
||||||
|
|||||||
@ -30,7 +30,6 @@ function HeroCell:init()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 显示自己英雄
|
|
||||||
function HeroCell:refresh(heroEntity, isGray)
|
function HeroCell:refresh(heroEntity, isGray)
|
||||||
self.selfNode:setVisible(true)
|
self.selfNode:setVisible(true)
|
||||||
self.otherNode:setVisible(false)
|
self.otherNode:setVisible(false)
|
||||||
@ -81,7 +80,6 @@ function HeroCell:refresh(heroEntity, isGray)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--显示其他人英雄
|
|
||||||
function HeroCell:refreshBriefInfo(id, level)
|
function HeroCell:refreshBriefInfo(id, level)
|
||||||
self.selfNode:setVisible(false)
|
self.selfNode:setVisible(false)
|
||||||
self.otherNode:setVisible(true)
|
self.otherNode:setVisible(true)
|
||||||
|
|||||||
@ -14,7 +14,6 @@ function PlayerHeadCell:refresh(avatarId, frameId, showRp)
|
|||||||
self.isSelf = true
|
self.isSelf = true
|
||||||
avatarId = DataManager.PlayerData:getUsingAvatarId()
|
avatarId = DataManager.PlayerData:getUsingAvatarId()
|
||||||
frameId = DataManager.PlayerData:getUsingFrameId()
|
frameId = DataManager.PlayerData:getUsingFrameId()
|
||||||
showRp = showRp == nil and (DataManager.PlayerData:hasNewAvatar() or DataManager.PlayerData:hasNewFrame())
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 背景颜色
|
-- 背景颜色
|
||||||
@ -43,7 +42,7 @@ function PlayerHeadCell:refresh(avatarId, frameId, showRp)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 红点
|
-- 红点
|
||||||
if showRp then
|
if showRp and (DataManager.PlayerData:hasNewAvatar() or DataManager.PlayerData:hasNewFrame()) then
|
||||||
self.baseObject:addRedPoint(50, 50, 0.7)
|
self.baseObject:addRedPoint(50, 50, 0.7)
|
||||||
else
|
else
|
||||||
self.baseObject:removeRedPoint()
|
self.baseObject:removeRedPoint()
|
||||||
|
|||||||
@ -39,7 +39,7 @@ end
|
|||||||
-- formation = {{id = 000, level=000},{id = 000, level=000}, ...}
|
-- formation = {{id = 000, level=000},{id = 000, level=000}, ...}
|
||||||
function HeroFormationComp:refreshBriefInfo(formation)
|
function HeroFormationComp:refreshBriefInfo(formation)
|
||||||
for i, heroCell in ipairs(self.heroCells) do
|
for i, heroCell in ipairs(self.heroCells) do
|
||||||
if formation[i] then
|
if formation[i] and DataManager.HeroData:isExistHeroById(formation[i].id) then
|
||||||
heroCell:setVisible(true, 1)
|
heroCell:setVisible(true, 1)
|
||||||
heroCell:refreshBriefInfo(formation[i].id, formation[i].level)
|
heroCell:refreshBriefInfo(formation[i].id, formation[i].level)
|
||||||
else
|
else
|
||||||
|
|||||||
@ -102,10 +102,10 @@ end
|
|||||||
|
|
||||||
function DungeonBoardCell:refreshCountdown(txCountdown)
|
function DungeonBoardCell:refreshCountdown(txCountdown)
|
||||||
if self.countdownSid then
|
if self.countdownSid then
|
||||||
SchedulerManager:unscheduleGlobal(self.countdownSid)
|
ModuleManager.DungeonManager:unscheduleGlobal(self.countdownSid)
|
||||||
self.countdownSid = nil
|
self.countdownSid = nil
|
||||||
end
|
end
|
||||||
self.countdownSid = txCountdown:scheduleGlobal(function()
|
self.countdownSid = ModuleManager.DungeonManager:scheduleGlobal(function()
|
||||||
self:updateTime(txCountdown)
|
self:updateTime(txCountdown)
|
||||||
end, 1)
|
end, 1)
|
||||||
self:updateTime(txCountdown)
|
self:updateTime(txCountdown)
|
||||||
|
|||||||
@ -128,9 +128,9 @@ function ArenaComp:refreshShow()
|
|||||||
|
|
||||||
self.seasonChangeCD = DataManager.ArenaData:getRemainSeasonTime()
|
self.seasonChangeCD = DataManager.ArenaData:getRemainSeasonTime()
|
||||||
if self.seasonChangeSid then
|
if self.seasonChangeSid then
|
||||||
ModuleManager.BattleManager:unscheduleGlobal(self.seasonChangeSid)
|
ModuleManager.ArenaManager:unscheduleGlobal(self.seasonChangeSid)
|
||||||
end
|
end
|
||||||
self.seasonChangeSid = self.txCountdown:scheduleGlobal(function()
|
self.seasonChangeSid = ModuleManager.ArenaManager:scheduleGlobal(function()
|
||||||
self:refreshCountdown()
|
self:refreshCountdown()
|
||||||
end, 1)
|
end, 1)
|
||||||
|
|
||||||
|
|||||||
@ -136,7 +136,7 @@ end
|
|||||||
function DailyChallengeComp:refreshCountdown()
|
function DailyChallengeComp:refreshCountdown()
|
||||||
self.countdownTx = self.uiMap["daily_challenge_comp.countdown.time_tx"]
|
self.countdownTx = self.uiMap["daily_challenge_comp.countdown.time_tx"]
|
||||||
if not self.countdownSid then
|
if not self.countdownSid then
|
||||||
self.countdownSid = self.countdownTx:scheduleGlobal(function()
|
self.countdownSid = ModuleManager.DailyChallengeManager:scheduleGlobal(function()
|
||||||
self:updateTime()
|
self:updateTime()
|
||||||
end, 1)
|
end, 1)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -39,9 +39,14 @@ function MainCityUI:getCurrencyParams()
|
|||||||
table.remove(self.currencyParams.itemIds)
|
table.remove(self.currencyParams.itemIds)
|
||||||
end
|
end
|
||||||
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
|
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
|
||||||
self.currencyParams.itemIds[1] = GConst.ItemConst.ITEM_ID_GOLD
|
if self.mainComp and self.mainComp:getCurModuleType() == GConst.MainCityConst.MAIN_MODULE.ARENA then
|
||||||
self.currencyParams.itemIds[2] = GConst.ItemConst.ITEM_ID_GEM
|
self.currencyParams.itemIds[1] = GConst.ItemConst.ITEM_ID_GEM
|
||||||
self.currencyParams.itemIds[3] = GConst.ItemConst.ITEM_ID_VIT
|
self.currencyParams.itemIds[2] = GConst.ItemConst.ITEM_ID_ARENA_TICKET
|
||||||
|
else
|
||||||
|
self.currencyParams.itemIds[1] = GConst.ItemConst.ITEM_ID_GOLD
|
||||||
|
self.currencyParams.itemIds[2] = GConst.ItemConst.ITEM_ID_GEM
|
||||||
|
self.currencyParams.itemIds[3] = GConst.ItemConst.ITEM_ID_VIT
|
||||||
|
end
|
||||||
elseif self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.HERO then
|
elseif self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.HERO then
|
||||||
self.currencyParams.itemIds[1] = GConst.ItemConst.ITEM_ID_GOLD
|
self.currencyParams.itemIds[1] = GConst.ItemConst.ITEM_ID_GOLD
|
||||||
self.currencyParams.itemIds[2] = GConst.ItemConst.ITEM_ID_VIT
|
self.currencyParams.itemIds[2] = GConst.ItemConst.ITEM_ID_VIT
|
||||||
@ -758,6 +763,7 @@ function MainCityUI:switchMainCompModule(moduleKey)
|
|||||||
self:setTopNodeVisible(module:isShowTopNode())
|
self:setTopNodeVisible(module:isShowTopNode())
|
||||||
self:setSideBarVisible(module:isShowSideBar())
|
self:setSideBarVisible(module:isShowSideBar())
|
||||||
self:refreshBounty()
|
self:refreshBounty()
|
||||||
|
UIManager:updateBarsState(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -2,9 +2,9 @@ local BaseTips = require "app/ui/tips/base_tips"
|
|||||||
local FormationTips = class("FormationTips", BaseTips)
|
local FormationTips = class("FormationTips", BaseTips)
|
||||||
|
|
||||||
function FormationTips:ctor(params)
|
function FormationTips:ctor(params)
|
||||||
self.desc = (params.desc or GConst.EMPTY_STRING)
|
|
||||||
self.tarCornerScreenPos = params.tarCornerScreenPos
|
self.tarCornerScreenPos = params.tarCornerScreenPos
|
||||||
self.location = params.location
|
self.location = params.location
|
||||||
|
self.formation = params.formation
|
||||||
end
|
end
|
||||||
|
|
||||||
function FormationTips:getPrefabPath()
|
function FormationTips:getPrefabPath()
|
||||||
@ -17,9 +17,8 @@ end
|
|||||||
|
|
||||||
function FormationTips:init()
|
function FormationTips:init()
|
||||||
local uiMap = self.root:genAllChildren()
|
local uiMap = self.root:genAllChildren()
|
||||||
self.bg = uiMap["item_tips.bg1.bg"]
|
self.bg = uiMap["formation_tips.bg"]
|
||||||
self.bg1 = uiMap["item_tips.bg1"]
|
self.heroFormation = uiMap["formation_tips.bg.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
|
||||||
self.descTx = uiMap["item_tips.bg1.bg.desc_tx"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function FormationTips:onLoadRootComplete()
|
function FormationTips:onLoadRootComplete()
|
||||||
@ -29,6 +28,8 @@ function FormationTips:onLoadRootComplete()
|
|||||||
self.originPivot = tipsBgTransform.pivot
|
self.originPivot = tipsBgTransform.pivot
|
||||||
self.originAnchoredPosition = tipsBgTransform.anchoredPosition
|
self.originAnchoredPosition = tipsBgTransform.anchoredPosition
|
||||||
self.originLocalPosition = tipsBgTransform.localPosition
|
self.originLocalPosition = tipsBgTransform.localPosition
|
||||||
|
|
||||||
|
self.heroFormation:refreshBriefInfo(self.formation)
|
||||||
end
|
end
|
||||||
|
|
||||||
function FormationTips:onRefresh()
|
function FormationTips:onRefresh()
|
||||||
@ -36,16 +37,8 @@ function FormationTips:onRefresh()
|
|||||||
self:closeUI()
|
self:closeUI()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.descTx:setText(self.desc)
|
|
||||||
-- 这里原来是用preferredHeight,但是在中英文混合的时候这个值可能不准,只有改用renderedHeight
|
|
||||||
-- renderedHeight必须要先调用下ForceMeshUpdate强制刷新才有效
|
|
||||||
self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO):ForceMeshUpdate()
|
|
||||||
local height = self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).renderedHeight + 18
|
|
||||||
if height < 130 then
|
|
||||||
height = 130
|
|
||||||
end
|
|
||||||
self.bg:setSizeDeltaY(height)
|
|
||||||
if self.tarCornerScreenPos then
|
if self.tarCornerScreenPos then
|
||||||
|
self.tarCornerScreenPos.x = 0
|
||||||
self:locate(self.location, self.originSizeDelta, self.bg, self.tarCornerScreenPos)
|
self:locate(self.location, self.originSizeDelta, self.bg, self.tarCornerScreenPos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -203,7 +203,7 @@ end
|
|||||||
|
|
||||||
-- 本地是否有排行榜该玩家编队数据
|
-- 本地是否有排行榜该玩家编队数据
|
||||||
function ArenaData:hasRankFormation(id)
|
function ArenaData:hasRankFormation(id)
|
||||||
return self.rankFormation == nil or self.rankFormation[id] == nil
|
return self.rankFormation ~= nil and self.rankFormation[id] ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取排行榜玩家编队信息
|
-- 获取排行榜玩家编队信息
|
||||||
@ -215,6 +215,11 @@ end
|
|||||||
|
|
||||||
-- 获取匹配玩家信息
|
-- 获取匹配玩家信息
|
||||||
function ArenaData:getMatchInfo()
|
function ArenaData:getMatchInfo()
|
||||||
|
if EDITOR_MODE then
|
||||||
|
Logger.logHighlight("当前匹配玩家信息")
|
||||||
|
Logger.printTable(self.matchInfo)
|
||||||
|
end
|
||||||
|
|
||||||
if Time:getServerTime() - self.matchSuccessTime > self:getMatchInfoMaxTime() then
|
if Time:getServerTime() - self.matchSuccessTime > self:getMatchInfoMaxTime() then
|
||||||
-- 超过时间需要重新匹配
|
-- 超过时间需要重新匹配
|
||||||
return nil
|
return nil
|
||||||
@ -226,6 +231,11 @@ function ArenaData:getMatchInfo()
|
|||||||
return self.matchInfo
|
return self.matchInfo
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 匹配玩家剩余存在时间
|
||||||
|
function ArenaData:getMatchExistRemainTime()
|
||||||
|
return self:getMatchInfoMaxTime() - (Time:getServerTime() - self.matchSuccessTime)
|
||||||
|
end
|
||||||
|
|
||||||
-- 个人 ----------------------------------------------------------------------
|
-- 个人 ----------------------------------------------------------------------
|
||||||
|
|
||||||
-- 获取当前段位积分
|
-- 获取当前段位积分
|
||||||
@ -288,9 +298,9 @@ function ArenaData:getFreeRematchCd()
|
|||||||
return self.matchFreeCdEndTime - Time:getServerTime()
|
return self.matchFreeCdEndTime - Time:getServerTime()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 今日是否能看视频重新匹配
|
-- 是否能看视频重新匹配
|
||||||
function ArenaData:canAdRematch()
|
function ArenaData:canAdRematch()
|
||||||
return self.todayAdRematchCount < self:getRematchAdDailyMaxNum()
|
return self.todayAdRematchCount < self:getRematchAdDailyMaxNum() and self:getFreeRematchCd() > 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取上赛季段位id
|
-- 获取上赛季段位id
|
||||||
|
|||||||
@ -36,7 +36,7 @@ function HeroData:init(data)
|
|||||||
local heroCfg = ConfigManager:getConfig("hero")
|
local heroCfg = ConfigManager:getConfig("hero")
|
||||||
for heroId, info in pairs(heroCfg) do
|
for heroId, info in pairs(heroCfg) do
|
||||||
local entity = self:getHeroById(heroId)
|
local entity = self:getHeroById(heroId)
|
||||||
if entity:isActived() then
|
if entity and entity:isActived() then
|
||||||
local matchType = entity:getMatchType()
|
local matchType = entity:getMatchType()
|
||||||
if not self.matchActiveHeroMap[matchType] then
|
if not self.matchActiveHeroMap[matchType] then
|
||||||
self.matchActiveHeroMap[matchType] = {}
|
self.matchActiveHeroMap[matchType] = {}
|
||||||
@ -53,6 +53,15 @@ function HeroData:init(data)
|
|||||||
self.showHeroUnlockChapter = 0
|
self.showHeroUnlockChapter = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 是否是合法的英雄
|
||||||
|
function HeroData:isExistHeroById(id)
|
||||||
|
if not id or id == 0 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return self.heroes[id] ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
function HeroData:addHero(heroStruct)
|
function HeroData:addHero(heroStruct)
|
||||||
if self.heroes[heroStruct.id] then
|
if self.heroes[heroStruct.id] then
|
||||||
return
|
return
|
||||||
@ -66,7 +75,7 @@ function HeroData:getEntity(heroStruct)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function HeroData:getHeroById(id)
|
function HeroData:getHeroById(id)
|
||||||
if not id or id == 0 then
|
if not self:isExistHeroById(id) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not self.heroes[id] then
|
if not self.heroes[id] then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user