竞技场匹配阵容提示优化

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) local HeroManager = class("HeroManager", BaseModule)
function HeroManager:showHeroDetailUI(heroId, onlyLook) function HeroManager:showHeroDetailUI(heroId, onlyLook, heroEntity)
UIManager:showUI("app/ui/hero/hero_detail_ui", {heroId = heroId, onlyLook = onlyLook}) UIManager:showUI("app/ui/hero/hero_detail_ui", {heroId = heroId, onlyLook = onlyLook, heroEntity = heroEntity})
end end
function HeroManager:showHeroUnlockUI(heroIdList) 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 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)
heroCell:addClickListener(function()
local heroEntity = DataManager.HeroData:getEntity(formation[i])
ModuleManager.HeroManager:showHeroDetailUI(formation[i].id, true, heroEntity)
end)
else else
heroCell:setVisible(false) heroCell:setVisible(false)
end end

View File

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