This commit is contained in:
puxuan 2025-06-30 22:01:18 +08:00
parent 6107c663e5
commit f5ce465420
2 changed files with 11 additions and 2 deletions

View File

@ -9,7 +9,6 @@ function HeroCell:init()
self.check = uiMap["hero_cell.hero_bg.mask"] self.check = uiMap["hero_cell.hero_bg.mask"]
self.matchImg = uiMap["hero_cell.hero_bg.match_img"] self.matchImg = uiMap["hero_cell.hero_bg.match_img"]
self.lvTx = uiMap["hero_cell.hero_bg.lv_tx"] self.lvTx = uiMap["hero_cell.hero_bg.lv_tx"]
self.sImg = uiMap["hero_cell.hero_bg.s"]
-- 个人节点 -- 个人节点
self.selfNode = uiMap["hero_cell.hero_bg.self_node"] self.selfNode = uiMap["hero_cell.hero_bg.self_node"]
self.progressBg = uiMap["hero_cell.hero_bg.self_node.progress_bg"] self.progressBg = uiMap["hero_cell.hero_bg.self_node.progress_bg"]
@ -175,7 +174,6 @@ function HeroCell:_refresh(heroInfo, isGray)
self.heroDec:setSprite(GConst.ATLAS_PATH.HERO, GConst.HERO_DEC_QLT[heroInfo.qlt]) self.heroDec:setSprite(GConst.ATLAS_PATH.HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position]) self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
self.check:setVisible(false) self.check:setVisible(false)
self.sImg:setVisible(heroInfo.qlt >= 4)
self:refreshHeroIcon(heroInfo.icon) self:refreshHeroIcon(heroInfo.icon)
self:setGray(isGray) self:setGray(isGray)
end end

View File

@ -51,13 +51,17 @@ function HeroComp:init()
UIManager:showUI("app/ui/collection/collection_ui", GConst.CollectionConst.TYPE.HERO) UIManager:showUI("app/ui/collection/collection_ui", GConst.CollectionConst.TYPE.HERO)
end) end)
self.uiMap["hero_ui.btn_collect.tx_collect"]:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_10)) self.uiMap["hero_ui.btn_collect.tx_collect"]:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_10))
-- self.uiMap["hero_ui.bottom_bg.filter_bg.btn_0.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_10))
self.uiMap["hero_ui.bottom_bg.filter_bg.btn_0.desc_tx"]:setText("ALL")
local attrTx = self.uiMap["hero_ui.bottom_bg.attr_bg.attr_tx"] local attrTx = self.uiMap["hero_ui.bottom_bg.attr_bg.attr_tx"]
local infoBtn = self.uiMap["hero_ui.bottom_bg.attr_bg.info_btn"] local infoBtn = self.uiMap["hero_ui.bottom_bg.attr_bg.info_btn"]
self.elementType = 0 self.elementType = 0
self.elementTypeBtns = {} self.elementTypeBtns = {}
self.elementTypeBtnFilters = {}
for i = 0, 5 do for i = 0, 5 do
self.elementTypeBtns[i] = self.uiMap["hero_ui.bottom_bg.filter_bg.btn_" .. i] self.elementTypeBtns[i] = self.uiMap["hero_ui.bottom_bg.filter_bg.btn_" .. i]
self.elementTypeBtnFilters[i] = self.uiMap["hero_ui.bottom_bg.filter_bg.btn_" .. i .. ".filter_img"]
self.elementTypeBtns[i]:addClickListener(function() self.elementTypeBtns[i]:addClickListener(function()
if self.elementType == i then if self.elementType == i then
return return
@ -99,6 +103,7 @@ function HeroComp:refresh(battleType)
self:clearAdapt() self:clearAdapt()
self:adapt() self:adapt()
self:refreshCollectEntrance() self:refreshCollectEntrance()
self:updateFilter()
if self.battleType == GConst.BattleConst.FORMATION_TYPE.STAGE then if self.battleType == GConst.BattleConst.FORMATION_TYPE.STAGE then
self:refreshStageFormation() self:refreshStageFormation()
elseif self.battleType == GConst.BattleConst.FORMATION_TYPE.ARENA_ATTACK then elseif self.battleType == GConst.BattleConst.FORMATION_TYPE.ARENA_ATTACK then
@ -116,6 +121,12 @@ function HeroComp:refresh(battleType)
end end
end end
function HeroComp:updateFilter()
for i = 0, 5 do
self.elementTypeBtnFilters[i]:setActive(i == self.elementType)
end
end
-- 展示主线章节阵容 -- 展示主线章节阵容
function HeroComp:refreshStageFormation() function HeroComp:refreshStageFormation()
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.MAIN_BTN_2)) self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.MAIN_BTN_2))