refactor(common): 调整弹窗预制体尺寸与文本样式
1. 调整弹窗内容区域高度与文本行高、字号 2. 为通用弹窗标题添加描边支持 3. 优化英雄列表排序逻辑 首先调整了通用弹窗预制体的文本样式参数,修复Cocos 3.8+的Label描边适配,同时重构英雄列表排序规则,将可升级英雄优先展示并按等级、品质降序排列。
This commit is contained in:
@@ -27,6 +27,7 @@ import { buildHeroSkillDesc } from "../common/HeroSkillText";
|
||||
import { outlineRich } from "../common/RichOutline";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { HERO_UPGRADE_NEED_FRAGMENTS, RARITY_BG_COLORS } from "../common/config/GameSet";
|
||||
import { canHeroUpgrade } from "../common/config/heroUpSet";
|
||||
import { CardLiteComp } from "./CardLiteComp";
|
||||
import { ChipComp } from "./ChipComp";
|
||||
import { SmallTipComp } from "./SmallTipComp";
|
||||
@@ -336,7 +337,16 @@ export class HerosListComp extends CCComp {
|
||||
this.cards_node.removeAllChildren()
|
||||
|
||||
const sorted = [...HeroList].sort((a, b) => {
|
||||
return (HeroInfo[a]?.rarity ?? 1) - (HeroInfo[b]?.rarity ?? 1);
|
||||
const ga = smc.getHeroGrowth(a)
|
||||
const gb = smc.getHeroGrowth(b)
|
||||
// 可升级的一批排在最左
|
||||
const ca = canHeroUpgrade(ga.lv, ga.fragments) ? 0 : 1
|
||||
const cb = canHeroUpgrade(gb.lv, gb.fragments) ? 0 : 1
|
||||
if (ca !== cb) return ca - cb
|
||||
// 同批内:现有等级降序优先
|
||||
if (ga.lv !== gb.lv) return gb.lv - ga.lv
|
||||
// 等级相同:品质降序(rarity 越大品质越高)
|
||||
return (HeroInfo[b]?.rarity ?? 1) - (HeroInfo[a]?.rarity ?? 1)
|
||||
});
|
||||
|
||||
for (const uuid of sorted) {
|
||||
|
||||
Reference in New Issue
Block a user