feat(missionHome): 添加天赋按钮并优化底部栏选中状态

1. 新增天赋按钮节点引用与相关页面切换逻辑
2. 封装setBarActive方法统一处理按钮选中态显示
3. 调整页面切换时的按钮状态更新逻辑
This commit is contained in:
panw
2026-05-27 16:42:34 +08:00
parent ad0539d238
commit bfafdbabeb
3 changed files with 3189 additions and 1145 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -49,7 +49,11 @@ export class MissionHomeComp extends CCComp {
/** 排行榜按钮节点 */
@property(Node)
rank_btn=null!
/** 排行榜按钮节点 */
/** 天赋按钮节点 */
@property(Node)
tals_btn=null!
@property(Node)
heros_page=null!
@property(Node)
@@ -96,12 +100,28 @@ export class MissionHomeComp extends CCComp {
this.heros_page.active = (page === this.heros_page)
this.talents_page.active = (page === this.talents_page)
this.ranks_page.active = (page === this.ranks_page)
this.setBarActive(this.hero_btn, page === this.heros_page)
this.setBarActive(this.tals_btn, page === this.talents_page)
this.setBarActive(this.rank_btn, page === this.ranks_page)
this.setBarActive(this.home_btn, false)
}
private hideAllPages() {
this.heros_page.active = false
this.talents_page.active = false
this.ranks_page.active = false
this.setBarActive(this.home_btn, true)
this.setBarActive(this.hero_btn, false)
this.setBarActive(this.tals_btn, false)
this.setBarActive(this.rank_btn, false)
}
private setBarActive(btn: Node, active: boolean) {
if (!btn) return
const child = btn.getChildByName("active")
if (child) child.active = active
}
openRanks() {