refactor(common): 调整弹窗预制体尺寸与文本样式
1. 调整弹窗内容区域高度与文本行高、字号 2. 为通用弹窗标题添加描边支持 3. 优化英雄列表排序逻辑 首先调整了通用弹窗预制体的文本样式参数,修复Cocos 3.8+的Label描边适配,同时重构英雄列表排序规则,将可升级英雄优先展示并按等级、品质降序排列。
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user