refactor(map): 优化英雄列表排序和英雄等级展示逻辑
1. 新增英雄列表按pool_lv升序排序的逻辑 2. 从cardData中获取英雄等级替代直接读取HeroInfo,优化数据读取方式
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user