refactor(map): 优化英雄列表排序和英雄等级展示逻辑

1. 新增英雄列表按pool_lv升序排序的逻辑
2. 从cardData中获取英雄等级替代直接读取HeroInfo,优化数据读取方式
This commit is contained in:
panw
2026-05-28 09:59:33 +08:00
parent f114fca2ce
commit f7f6c57b56
2 changed files with 6 additions and 3 deletions

View File

@@ -115,7 +115,11 @@ export class HerosListComp extends CCComp {
this.cards_node.removeAllChildren()
for (const uuid of HeroList) {
const sorted = [...HeroList].sort((a, b) => {
return (HeroInfo[a]?.pool_lv ?? 1) - (HeroInfo[b]?.pool_lv ?? 1);
});
for (const uuid of sorted) {
const hero = HeroInfo[uuid]
if (!hero) continue