竞技场匹配阵容提示优化

This commit is contained in:
xiekaidong 2023-07-10 15:39:39 +08:00
parent e68de8da6c
commit 0a78db2330
3 changed files with 12 additions and 4 deletions

View File

@ -1,7 +1,7 @@
local HeroManager = class("HeroManager", BaseModule)
function HeroManager:showHeroDetailUI(heroId, onlyLook)
UIManager:showUI("app/ui/hero/hero_detail_ui", {heroId = heroId, onlyLook = onlyLook})
function HeroManager:showHeroDetailUI(heroId, onlyLook, heroEntity)
UIManager:showUI("app/ui/hero/hero_detail_ui", {heroId = heroId, onlyLook = onlyLook, heroEntity = heroEntity})
end
function HeroManager:showHeroUnlockUI(heroIdList)

View File

@ -42,6 +42,10 @@ function HeroFormationComp:refreshBriefInfo(formation)
if formation[i] and DataManager.HeroData:isExistHeroById(formation[i].id) then
heroCell:setVisible(true, 1)
heroCell:refreshBriefInfo(formation[i].id, formation[i].level)
heroCell:addClickListener(function()
local heroEntity = DataManager.HeroData:getEntity(formation[i])
ModuleManager.HeroManager:showHeroDetailUI(formation[i].id, true, heroEntity)
end)
else
heroCell:setVisible(false)
end

View File

@ -20,9 +20,13 @@ function HeroDetailUI:onPressBackspace()
end
function HeroDetailUI:ctor(parmas)
local heroId = parmas.heroId
self.onlyLook = parmas.onlyLook
self.heroEntity = DataManager.HeroData:getHeroById(heroId)
if parmas.heroEntity then
self.heroEntity = parmas.heroEntity
else
local heroId = parmas.heroId
self.heroEntity = DataManager.HeroData:getHeroById(heroId)
end
end
function HeroDetailUI:onLoadRootComplete()