From f5ce46542022de389031181a2419cefe0c4b89b5 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Mon, 30 Jun 2025 22:01:18 +0800 Subject: [PATCH] hero --- lua/app/ui/common/cell/hero_cell.lua | 2 -- lua/app/ui/hero/hero_comp.lua | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index 7b3f3963..b3c4f0b6 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -9,7 +9,6 @@ function HeroCell:init() self.check = uiMap["hero_cell.hero_bg.mask"] self.matchImg = uiMap["hero_cell.hero_bg.match_img"] 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.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.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position]) self.check:setVisible(false) - self.sImg:setVisible(heroInfo.qlt >= 4) self:refreshHeroIcon(heroInfo.icon) self:setGray(isGray) end diff --git a/lua/app/ui/hero/hero_comp.lua b/lua/app/ui/hero/hero_comp.lua index 8ca784ab..e265e097 100644 --- a/lua/app/ui/hero/hero_comp.lua +++ b/lua/app/ui/hero/hero_comp.lua @@ -51,13 +51,17 @@ function HeroComp:init() UIManager:showUI("app/ui/collection/collection_ui", GConst.CollectionConst.TYPE.HERO) end) 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 infoBtn = self.uiMap["hero_ui.bottom_bg.attr_bg.info_btn"] self.elementType = 0 self.elementTypeBtns = {} + self.elementTypeBtnFilters = {} for i = 0, 5 do 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() if self.elementType == i then return @@ -99,6 +103,7 @@ function HeroComp:refresh(battleType) self:clearAdapt() self:adapt() self:refreshCollectEntrance() + self:updateFilter() if self.battleType == GConst.BattleConst.FORMATION_TYPE.STAGE then self:refreshStageFormation() elseif self.battleType == GConst.BattleConst.FORMATION_TYPE.ARENA_ATTACK then @@ -116,6 +121,12 @@ function HeroComp:refresh(battleType) end end +function HeroComp:updateFilter() + for i = 0, 5 do + self.elementTypeBtnFilters[i]:setActive(i == self.elementType) + end +end + -- 展示主线章节阵容 function HeroComp:refreshStageFormation() self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.MAIN_BTN_2))