升级表现

This commit is contained in:
xiekaidong 2023-09-16 19:17:47 +08:00
parent 2038237e6c
commit d2d1dd612e
3 changed files with 65 additions and 1 deletions

View File

@ -112,6 +112,8 @@ end
function ActPvpManager:rspEnter(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:updateData(result.activity_pvp)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {closeMainUI = true})
self:showMainUI()
end
end
@ -277,8 +279,10 @@ end
function ActPvpManager:rspFightEnd(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local herolv = DataManager.ActPvpData:getHeroLv()
DataManager.ActPvpData:updateData(result.activity_pvp)
DataManager.ActPvpData:setLastTurnWin(nil) -- 默认不给状态
DataManager.ActPvpData:setHeroLevelUp(false)
-- 展示结算界面
if result.reqData then
local taskStat = result.reqData.task_stat
@ -291,6 +295,11 @@ function ActPvpManager:rspFightEnd(result)
ModuleManager.BattleManager:showActPvpResultUI(GConst.BattleConst.BATTLE_TYPE.ACT_PVP, result.rewards, result.reqData.battleReport)
if not DataManager.ActPvpData:isPlaying() then -- 进入下一轮
DataManager.ActPvpData:setLastTurnWin(result.reqData.win)
else
local newHerolv = DataManager.ActPvpData:getHeroLv()
if newHerolv > herolv then
DataManager.ActPvpData:setHeroLevelUp(true)
end
end
end
end

View File

@ -47,6 +47,11 @@ function ActPvpPlayingUI:onClose()
self:unscheduleGlobal(self.countdownSid)
self.countdownSid = nil
end
if self.showLevelUpSid then
self:unscheduleGlobal(self.showLevelUpSid)
self.showLevelUpSid = nil
end
end
function ActPvpPlayingUI:_display()
@ -136,6 +141,48 @@ function ActPvpPlayingUI:refreshPlayingNode()
self.simpleHeroCells[i] = CellManager:addCellComp(uiMap["act_pvp_main_ui.down.playing_node.hero_formation_comp.simple_hero_cell_" .. i], SIMPLE_HERO_CELL)
end
end
if not self.skillObjs then
self.skillObjs = {}
for i = 1, 5 do
self.skillObjs[i] = {}
self.skillObjs[i].bg = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_" .. i]
self.skillObjs[i].icon = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_" .. i .. ".icon"]
self.skillObjs[i].spine = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_node.ui_spine_obj_" .. i]
end
end
local heroes = DataManager.ActPvpData:getHeros()
local skillUpNode = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_node"]
skillUpNode:setVisible(false)
if DataManager.ActPvpData:getHeroLevelUp() then
DataManager.ActPvpData:setHeroLevelUp(false)
local heroLv = DataManager.ActPvpData:getHeroLv()
local info = ConfigManager:getConfig("hero_level")[heroLv]
local infoLast = ConfigManager:getConfig("hero_level")[heroLv - 1]
if info and infoLast and info.unlock_skill > infoLast.unlock_skill then
skillUpNode:setVisible(true)
for matchType, objs in ipairs(self.skillObjs) do
local entity = heroes[matchType]
local skillId = entity:getRogueSkillList()[info.unlock_skill]
if entity and skillId then
objs.bg:addClickListener(function()
local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
ModuleManager.TipsManager:showSkillTips(objs.icon, cfg.buff_id, skillId)
end)
objs.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
objs.bg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true))
objs.spine:playAnim("idle", false, false, false)
end
end
if self.showLevelUpSid then
self:unscheduleGlobal(self.showLevelUpSid)
self.showLevelUpSid = nil
end
self.showLevelUpSid = self:performWithDelayGlobal(function()
skillUpNode:setVisible(false)
end, 5)
end
end
local actData = DataManager.ActPvpData
local txObj = uiMap["act_pvp_main_ui.down.playing_node.tx_fight"]
@ -143,7 +190,6 @@ function ActPvpPlayingUI:refreshPlayingNode()
txObj:setText(actData:getWinCount() .. "/" .. actData:getWinLimit())
txLose:setText(actData:getLoseCount() .. "/" .. actData:getLoseLimit())
local heroes = DataManager.ActPvpData:getHeros()
for matchType, cell in ipairs(self.simpleHeroCells) do
local entity = heroes[matchType]
if entity then

View File

@ -397,6 +397,15 @@ function ActPvpData:setLastTurnWin(win)
self.lastTurnWin = win
end
function ActPvpData:getHeroLevelUp()
-- return self.heroLevelUp
return true
end
function ActPvpData:setHeroLevelUp(up)
-- self.heroLevelUp = up
end
---- 排行榜
function ActPvpData:updateRankInfo(ranks, selfRank)