From 124bb19005425a49b24b7fff5f78b80fdddd3898 Mon Sep 17 00:00:00 2001 From: panFD Date: Tue, 8 Sep 2026 22:53:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor(common):=20=E8=B0=83=E6=95=B4=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E9=A2=84=E5=88=B6=E4=BD=93=E5=B0=BA=E5=AF=B8=E4=B8=8E?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 调整弹窗内容区域高度与文本行高、字号 2. 为通用弹窗标题添加描边支持 3. 优化英雄列表排序逻辑 首先调整了通用弹窗预制体的文本样式参数,修复Cocos 3.8+的Label描边适配,同时重构英雄列表排序规则,将可升级英雄优先展示并按等级、品质降序排列。 --- assets/resources/common/prefab/window.prefab | 6 +++--- assets/script/game/common/CommonPrompt.ts | 9 +++++++++ assets/script/game/map/HerosListComp.ts | 12 +++++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/assets/resources/common/prefab/window.prefab b/assets/resources/common/prefab/window.prefab index b7a21d7f..86944b2e 100644 --- a/assets/resources/common/prefab/window.prefab +++ b/assets/resources/common/prefab/window.prefab @@ -787,7 +787,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 540, - "height": 26.46 + "height": 44.1 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -812,11 +812,11 @@ "__prefab": { "__id__": 44 }, - "_lineHeight": 21, + "_lineHeight": 35, "_string": "RichText", "_horizontalAlign": 0, "_verticalAlign": 1, - "_fontSize": 20, + "_fontSize": 30, "_fontColor": { "__type__": "cc.Color", "r": 255, diff --git a/assets/script/game/common/CommonPrompt.ts b/assets/script/game/common/CommonPrompt.ts index c633a875..7f4c862c 100644 --- a/assets/script/game/common/CommonPrompt.ts +++ b/assets/script/game/common/CommonPrompt.ts @@ -21,6 +21,7 @@ */ import { _decorator, Button, Color, Component, EventTouch, Label, Node, NodeEventType, RichText, Tween, tween, Vec3 } from "cc"; import { oops } from "db://oops-framework/core/Oops"; +import { RICH_OUTLINE_COLOR, RICH_OUTLINE_WIDTH } from "./RichOutline"; const { ccclass, property } = _decorator; @@ -181,6 +182,14 @@ export class CommonPrompt extends Component { if (this.config.titleColor) { this.lab_title.color = new Color().fromHEX(this.config.titleColor); } + this.ensureTitleOutline(); + } + + /** 标题描边:Cocos 3.8+ 废弃 LabelOutline 组件,改用 Label 内建 outlineColor/outlineWidth */ + private ensureTitleOutline() { + if (!this.lab_title || !this.lab_title.isValid) return; + this.lab_title.outlineColor = new Color().fromHEX(RICH_OUTLINE_COLOR); + this.lab_title.outlineWidth = RICH_OUTLINE_WIDTH; } private setContent() { diff --git a/assets/script/game/map/HerosListComp.ts b/assets/script/game/map/HerosListComp.ts index 476e1e62..6b0e8c58 100644 --- a/assets/script/game/map/HerosListComp.ts +++ b/assets/script/game/map/HerosListComp.ts @@ -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) {