refactor: 统一游戏文本标点格式,优化UI显示

1.  替换全角逗号为半角逗号,修正技能描述、英雄介绍中的标点一致性
2.  调整弹窗预制体尺寸与布局参数,适配新的UI显示需求
3.  优化技能名称富文本样式与光环档位显示逻辑
4.  清理冗余的prefab实例配置字段
This commit is contained in:
panFD
2026-08-09 20:40:19 +08:00
parent 2872b643f8
commit 2b3a68fb2a
6 changed files with 91 additions and 112 deletions

View File

@@ -1,4 +1,4 @@
/**
/**
* @file HeroSkillDesc.ts
* @description 英雄技能/能力描述的【唯一文字表达标准层】
*
@@ -91,20 +91,20 @@ const ATTR_NAME: Partial<Record<Attrs, string>> = {
/** 富文本数值高亮色(鲜亮绿色,深色面板上高亮醒目) */
const RICH_VALUE_COLOR = "#3CE66E";
/** 富文本技能名高亮色(明亮金黄,品质感强,与绿色数值/白色正文拉开层级 */
const RICH_NAME_COLOR = "#F1C40F";
/** 富文本技能名高亮色(蜜桃橙,暖色系,与面板绿/蓝/红/黄/紫均不冲突 */
const RICH_NAME_COLOR = "#F8C471";
/** 技能名描边色(深,衬托金黄填充,深色面板上清晰立体 */
const RICH_NAME_OUTLINE = "#6E4A0E";
/** 技能名描边色(深,衬托蜜桃橙填充,深色面板上温馨醒目 */
const RICH_NAME_OUTLINE = "#6E2C00";
/**
* 技能名富文本片段:金黄填充 + 深描边。
* 仅技能名单独包裹描边,正文/数值不描边,突出技能名视觉层级。
* @param name 技能名(纯文本)
* @returns <outline><color> 包裹的富文本片段
* 技能名富文本片段:[技能名]整体蜜桃橙填充 + 深描边(含方括号)
* 括号与技能名同色同描边,正文/数值不描边,突出技能名视觉层级。
* @param name 技能名(纯文本,不含括号
* @returns <outline><color>[技能名]</color></outline> 富文本片段
*/
function skillNameRich(name: string): string {
return `<outline color=${RICH_NAME_OUTLINE} width=1><color=${RICH_NAME_COLOR}>${name}</color></outline>`;
return `<outline color=${RICH_NAME_OUTLINE} width=1><color=${RICH_NAME_COLOR}>[${name}]</color></outline>`;
}
/** 富文本未激活档位整行灰色(低饱和,深色面板上可读但明显弱化) */
@@ -113,9 +113,6 @@ const RICH_LOCKED_COLOR = "#95A5A6";
/** 技能名「」匹配模式(仅本模块行首/行中技能名片段使用) */
const SKILL_NAME_PATTERN = /「([^」]*)」/g;
/** 技能等级罗马数字徽章(索引 = 技能等级 1~5用于技能名后的品质感等级标识 */
const SKILL_LV_BADGE = ["", "", "Ⅱ", "Ⅲ", "Ⅳ", ""];
/** "持续X秒"匹配模式(卡片描述后处理:把持续时间数值也高亮) */
const DURATION_PATTERN = /持续(\d+)秒/g;
@@ -271,7 +268,7 @@ function buildReviveLines(source: ISkillDescSource, showName: boolean = true, sh
const nameSeg = showName ? `${base.name}` : "";
// 高亮片段选回血百分比(数值中最关键的收益指标)
return {
prefix: `${head}${nameSeg}可复活${maxCount}每次恢复`,
prefix: `${head}${nameSeg}可复活${maxCount}, 每次恢复`,
value: `${hpPct}%`,
suffix: "生命",
locked,
@@ -576,18 +573,20 @@ export function buildSkillDescMoreRich(source: ISkillDescSource): string {
const curTrig = needCount
? `${trigName}<color=${RICH_VALUE_COLOR}>${cur.t_num}</color>次`
: trigName;
// 技能名 + 罗马数字等级徽章(如 "不屈壁垒"等级徽标随技能名一并蓝色高亮
const badge = SKILL_LV_BADGE[curSLv] ?? `${curSLv}`;
const curHead = `${skillName}${badge}」: ${curTrig}`;
// 技能名 + 档位数字后缀(如 "不屈壁垒1"与光环命名口径一致
const curHead = `${skillName}${curSLv}」: ${curTrig}, `;
lines.push(effectRich(buildEffectLine(curHead, mergeSkillParams(base, cur.overrides))));
}
}
// 驻场光环field直接以技能名开头,技能名走 heroSet 语境专属命名(如「战歌祝福」)
// 驻场光环field技能名按档位带数字后缀(如 [攻击光环1]/[攻击光环2]),便于玩家识别成长
const fieldEntries = source[SkillTriggerType.Field] as LvFieldEntry[] | undefined;
if (fieldEntries?.length) {
for (const uuid of resolveFieldByLv(fieldEntries, lv)) {
const line = buildFieldLine("", uuid, true, getTriggerSkillName(SkillTriggerType.Field, uuid));
// uuid 百位编码档位7002 基础(0)=1、7202 +(2)=2、7402 ++(4)=3
const tier = Math.floor((uuid % 1000) / 100) / 2 + 1;
const baseName = getTriggerSkillName(SkillTriggerType.Field, uuid);
const line = buildFieldLine("", uuid, true, `${baseName}${tier}`);
if (line) lines.push(effectRich(line));
}
}
@@ -596,7 +595,7 @@ export function buildSkillDescMoreRich(source: ISkillDescSource): string {
const revive = resolveReviveByLv(source[SkillTriggerType.Revive] as LvReviveEntry[] | undefined, lv);
if (revive) {
const reviveName = getTriggerSkillName(SkillTriggerType.Revive, revive.s_uuid);
lines.push(`${skillNameRich(reviveName)}: 每回合拥有<color=${RICH_VALUE_COLOR}>${revive.r_num}</color>次重生机会死亡后以<color=${RICH_VALUE_COLOR}>${Math.round(revive.upr * 100)}%</color>血量原地重生`);
lines.push(`${skillNameRich(reviveName)}: 每回合拥有<color=${RICH_VALUE_COLOR}>${revive.r_num}</color>次重生机会, 死亡后以<color=${RICH_VALUE_COLOR}>${Math.round(revive.upr * 100)}%</color>血量原地重生`);
}
return lines.join("\n");
@@ -688,8 +687,8 @@ export function buildCardDescRich(card: CardConfig): string {
}
const rhythm = `每<color=${RICH_VALUE_COLOR}>${tInv}</color>秒召唤<color=${RICH_VALUE_COLOR}>${(card.overrides?.num ?? 0) + 1}</color>个${skillNameRich(skill.name)}攻击敌人`;
const times = `共<color=${RICH_VALUE_COLOR}>${tTimes}</color>次`;
return `${rhythm}${rich}${times}`;
const times = `, 共<color=${RICH_VALUE_COLOR}>${tTimes}</color>次`;
return `${rhythm}, ${rich}${times}`;
}
return card.info || "";