From 2872b643f83716987f022c391d2520acddfdf07f Mon Sep 17 00:00:00 2001 From: panFD Date: Sun, 9 Aug 2026 20:40:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui&config):=20=E4=BC=98=E5=8C=96=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E5=90=8D=E5=AF=8C=E6=96=87=E6=9C=AC=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 调整技能名高亮色为金黄并添加描边效果,提升视觉层级 2. 封装skillNameRich工具函数统一处理技能名富文本格式 3. 修复英雄prefab布局参数,适配新的文本显示样式 --- assets/resources/gui/element/cHero.prefab | 357 ++++++++---------- .../game/common/config/HeroSkillDesc.ts | 33 +- 2 files changed, 182 insertions(+), 208 deletions(-) diff --git a/assets/resources/gui/element/cHero.prefab b/assets/resources/gui/element/cHero.prefab index 24cf53fa..8789270a 100644 --- a/assets/resources/gui/element/cHero.prefab +++ b/assets/resources/gui/element/cHero.prefab @@ -45,18 +45,18 @@ ], "_active": true, "_components": [ + { + "__id__": 330 + }, { "__id__": 332 }, { "__id__": 334 - }, - { - "__id__": 336 } ], "_prefab": { - "__id__": 430 + "__id__": 428 }, "_lpos": { "__type__": "cc.Vec3", @@ -4725,7 +4725,7 @@ { "__type__": "cc.Node", "_name": "RichText", - "_objFlags": 512, + "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 1 @@ -4738,18 +4738,15 @@ }, { "__id__": 327 - }, - { - "__id__": 329 } ], "_prefab": { - "__id__": 331 + "__id__": 329 }, "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": -44.99999999999999, + "y": 22.263000000000016, "z": 0 }, "_lrot": { @@ -4790,12 +4787,12 @@ "_contentSize": { "__type__": "cc.Size", "width": 200, - "height": 25.2 + "height": 22.68 }, "_anchorPoint": { "__type__": "cc.Vec2", "x": 0.5, - "y": 0.5 + "y": 1 }, "_id": "" }, @@ -4815,11 +4812,11 @@ "__prefab": { "__id__": 328 }, - "_lineHeight": 20, + "_lineHeight": 18, "_string": "RichText", "_horizontalAlign": 0, "_verticalAlign": 0, - "_fontSize": 17, + "_fontSize": 16, "_fontColor": { "__type__": "cc.Color", "r": 255, @@ -4841,42 +4838,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "94G83rsRxKLqWHFK2KnEEG" }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 324 - }, - "_enabled": true, - "__prefab": { - "__id__": 330 - }, - "_alignFlags": 4, - "_target": null, - "_left": 0, - "_right": 0, - "_top": 0, - "_bottom": 127.4, - "_horizontalCenter": 0, - "_verticalCenter": 0, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 0, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d2Dg4IKW9Piplf/xBdNvYL" - }, { "__type__": "cc.PrefabInfo", "root": { @@ -4900,7 +4861,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 333 + "__id__": 331 }, "_contentSize": { "__type__": "cc.Size", @@ -4928,7 +4889,7 @@ }, "_enabled": false, "__prefab": { - "__id__": 335 + "__id__": 333 }, "_alignFlags": 0, "_target": null, @@ -4964,10 +4925,10 @@ }, "_enabled": true, "__prefab": { - "__id__": 337 + "__id__": 335 }, "icon_node": { - "__id__": 338 + "__id__": 336 }, "bg_node": { "__id__": 21 @@ -4994,7 +4955,7 @@ "__id__": 287 }, "cost_label": { - "__id__": 380 + "__id__": 378 }, "_id": "" }, @@ -5008,23 +4969,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 339 + "__id__": 337 }, "_children": [], "_active": true, "_components": [ + { + "__id__": 371 + }, { "__id__": 373 }, { "__id__": 375 - }, - { - "__id__": 377 } ], "_prefab": { - "__id__": 379 + "__id__": 377 }, "_lpos": { "__type__": "cc.Vec3", @@ -5064,24 +5025,27 @@ "__id__": 131 }, "_children": [ - { - "__id__": 340 - }, { "__id__": 338 }, { - "__id__": 346 + "__id__": 336 }, { - "__id__": 352 + "__id__": 344 }, { - "__id__": 358 + "__id__": 350 + }, + { + "__id__": 356 } ], "_active": true, "_components": [ + { + "__id__": 362 + }, { "__id__": 364 }, @@ -5090,13 +5054,10 @@ }, { "__id__": 368 - }, - { - "__id__": 370 } ], "_prefab": { - "__id__": 372 + "__id__": 370 }, "_lpos": { "__type__": "cc.Vec3", @@ -5133,20 +5094,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 339 + "__id__": 337 }, "_children": [], "_active": true, "_components": [ { - "__id__": 341 + "__id__": 339 }, { - "__id__": 343 + "__id__": 341 } ], "_prefab": { - "__id__": 345 + "__id__": 343 }, "_lpos": { "__type__": "cc.Vec3", @@ -5183,11 +5144,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 340 + "__id__": 338 }, "_enabled": true, "__prefab": { - "__id__": 342 + "__id__": 340 }, "_contentSize": { "__type__": "cc.Size", @@ -5211,11 +5172,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 340 + "__id__": 338 }, "_enabled": true, "__prefab": { - "__id__": 344 + "__id__": 342 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5269,20 +5230,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 339 + "__id__": 337 }, "_children": [], "_active": false, "_components": [ { - "__id__": 347 + "__id__": 345 }, { - "__id__": 349 + "__id__": 347 } ], "_prefab": { - "__id__": 351 + "__id__": 349 }, "_lpos": { "__type__": "cc.Vec3", @@ -5319,11 +5280,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 346 + "__id__": 344 }, "_enabled": true, "__prefab": { - "__id__": 348 + "__id__": 346 }, "_contentSize": { "__type__": "cc.Size", @@ -5347,11 +5308,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 346 + "__id__": 344 }, "_enabled": true, "__prefab": { - "__id__": 350 + "__id__": 348 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5405,20 +5366,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 339 + "__id__": 337 }, "_children": [], "_active": false, "_components": [ { - "__id__": 353 + "__id__": 351 }, { - "__id__": 355 + "__id__": 353 } ], "_prefab": { - "__id__": 357 + "__id__": 355 }, "_lpos": { "__type__": "cc.Vec3", @@ -5455,11 +5416,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 352 + "__id__": 350 }, "_enabled": true, "__prefab": { - "__id__": 354 + "__id__": 352 }, "_contentSize": { "__type__": "cc.Size", @@ -5483,11 +5444,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 352 + "__id__": 350 }, "_enabled": true, "__prefab": { - "__id__": 356 + "__id__": 354 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5541,20 +5502,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 339 + "__id__": 337 }, "_children": [], "_active": false, "_components": [ { - "__id__": 359 + "__id__": 357 }, { - "__id__": 361 + "__id__": 359 } ], "_prefab": { - "__id__": 363 + "__id__": 361 }, "_lpos": { "__type__": "cc.Vec3", @@ -5591,11 +5552,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 358 + "__id__": 356 }, "_enabled": true, "__prefab": { - "__id__": 360 + "__id__": 358 }, "_contentSize": { "__type__": "cc.Size", @@ -5619,11 +5580,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 358 + "__id__": 356 }, "_enabled": true, "__prefab": { - "__id__": 362 + "__id__": 360 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5677,11 +5638,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 339 + "__id__": 337 }, "_enabled": true, "__prefab": { - "__id__": 365 + "__id__": 363 }, "_contentSize": { "__type__": "cc.Size", @@ -5705,11 +5666,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 339 + "__id__": 337 }, "_enabled": false, "__prefab": { - "__id__": 367 + "__id__": 365 }, "_type": 0, "_inverted": false, @@ -5727,11 +5688,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 339 + "__id__": 337 }, "_enabled": true, "__prefab": { - "__id__": 369 + "__id__": 367 }, "_alignFlags": 45, "_target": null, @@ -5763,11 +5724,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 339 + "__id__": 337 }, "_enabled": true, "__prefab": { - "__id__": 371 + "__id__": 369 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5822,11 +5783,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 338 + "__id__": 336 }, "_enabled": true, "__prefab": { - "__id__": 374 + "__id__": 372 }, "_contentSize": { "__type__": "cc.Size", @@ -5850,11 +5811,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 338 + "__id__": 336 }, "_enabled": true, "__prefab": { - "__id__": 376 + "__id__": 374 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5898,11 +5859,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 338 + "__id__": 336 }, "_enabled": false, "__prefab": { - "__id__": 378 + "__id__": 376 }, "_alignFlags": 45, "_target": null, @@ -5947,11 +5908,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 381 + "__id__": 379 }, "_enabled": true, "__prefab": { - "__id__": 429 + "__id__": 427 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6011,20 +5972,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 382 + "__id__": 380 }, "_children": [], "_active": true, "_components": [ { - "__id__": 426 + "__id__": 424 }, { - "__id__": 380 + "__id__": 378 } ], "_prefab": { - "__id__": 428 + "__id__": 426 }, "_lpos": { "__type__": "cc.Vec3", @@ -6063,27 +6024,27 @@ "mountedRoot": null }, "_parent": { - "__id__": 383 + "__id__": 381 }, "_children": [ { - "__id__": 415 + "__id__": 413 }, { - "__id__": 381 + "__id__": 379 } ], "_active": false, "_components": [ { - "__id__": 421 + "__id__": 419 }, { - "__id__": 423 + "__id__": 421 } ], "_prefab": { - "__id__": 425 + "__id__": 423 }, "_lpos": { "__type__": "cc.Vec3", @@ -6123,30 +6084,30 @@ "__id__": 287 }, "_children": [ - { - "__id__": 384 - }, { "__id__": 382 }, { - "__id__": 390 + "__id__": 380 + }, + { + "__id__": 388 } ], "_active": true, "_components": [ + { + "__id__": 406 + }, { "__id__": 408 }, { "__id__": 410 - }, - { - "__id__": 412 } ], "_prefab": { - "__id__": 414 + "__id__": 412 }, "_lpos": { "__type__": "cc.Vec3", @@ -6185,20 +6146,20 @@ "mountedRoot": null }, "_parent": { - "__id__": 383 + "__id__": 381 }, "_children": [], "_active": true, "_components": [ { - "__id__": 385 + "__id__": 383 }, { - "__id__": 387 + "__id__": 385 } ], "_prefab": { - "__id__": 389 + "__id__": 387 }, "_lpos": { "__type__": "cc.Vec3", @@ -6235,11 +6196,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 384 + "__id__": 382 }, "_enabled": true, "__prefab": { - "__id__": 386 + "__id__": 384 }, "_contentSize": { "__type__": "cc.Size", @@ -6263,11 +6224,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 384 + "__id__": 382 }, "_enabled": true, "__prefab": { - "__id__": 388 + "__id__": 386 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6346,27 +6307,27 @@ "mountedRoot": null }, "_parent": { - "__id__": 383 + "__id__": 381 }, "_children": [ { - "__id__": 391 + "__id__": 389 }, { - "__id__": 397 + "__id__": 395 } ], "_active": false, "_components": [ { - "__id__": 403 + "__id__": 401 }, { - "__id__": 405 + "__id__": 403 } ], "_prefab": { - "__id__": 407 + "__id__": 405 }, "_lpos": { "__type__": "cc.Vec3", @@ -6403,20 +6364,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 390 + "__id__": 388 }, "_children": [], "_active": true, "_components": [ { - "__id__": 392 + "__id__": 390 }, { - "__id__": 394 + "__id__": 392 } ], "_prefab": { - "__id__": 396 + "__id__": 394 }, "_lpos": { "__type__": "cc.Vec3", @@ -6453,11 +6414,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 391 + "__id__": 389 }, "_enabled": true, "__prefab": { - "__id__": 393 + "__id__": 391 }, "_contentSize": { "__type__": "cc.Size", @@ -6481,11 +6442,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 391 + "__id__": 389 }, "_enabled": true, "__prefab": { - "__id__": 395 + "__id__": 393 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6542,20 +6503,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 390 + "__id__": 388 }, "_children": [], "_active": true, "_components": [ { - "__id__": 398 + "__id__": 396 }, { - "__id__": 400 + "__id__": 398 } ], "_prefab": { - "__id__": 402 + "__id__": 400 }, "_lpos": { "__type__": "cc.Vec3", @@ -6592,11 +6553,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 397 + "__id__": 395 }, "_enabled": true, "__prefab": { - "__id__": 399 + "__id__": 397 }, "_contentSize": { "__type__": "cc.Size", @@ -6620,11 +6581,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 397 + "__id__": 395 }, "_enabled": true, "__prefab": { - "__id__": 401 + "__id__": 399 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6701,11 +6662,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 390 + "__id__": 388 }, "_enabled": true, "__prefab": { - "__id__": 404 + "__id__": 402 }, "_contentSize": { "__type__": "cc.Size", @@ -6729,11 +6690,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 390 + "__id__": 388 }, "_enabled": true, "__prefab": { - "__id__": 406 + "__id__": 404 }, "_resizeMode": 1, "_layoutType": 1, @@ -6780,11 +6741,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 383 + "__id__": 381 }, "_enabled": true, "__prefab": { - "__id__": 409 + "__id__": 407 }, "_contentSize": { "__type__": "cc.Size", @@ -6808,11 +6769,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 383 + "__id__": 381 }, "_enabled": true, "__prefab": { - "__id__": 411 + "__id__": 409 }, "_alignFlags": 45, "_target": null, @@ -6844,11 +6805,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 383 + "__id__": 381 }, "_enabled": true, "__prefab": { - "__id__": 413 + "__id__": 411 }, "_resizeMode": 1, "_layoutType": 2, @@ -6895,20 +6856,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 382 + "__id__": 380 }, "_children": [], "_active": true, "_components": [ { - "__id__": 416 + "__id__": 414 }, { - "__id__": 418 + "__id__": 416 } ], "_prefab": { - "__id__": 420 + "__id__": 418 }, "_lpos": { "__type__": "cc.Vec3", @@ -6945,11 +6906,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 415 + "__id__": 413 }, "_enabled": true, "__prefab": { - "__id__": 417 + "__id__": 415 }, "_contentSize": { "__type__": "cc.Size", @@ -6973,11 +6934,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 415 + "__id__": 413 }, "_enabled": true, "__prefab": { - "__id__": 419 + "__id__": 417 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -7031,11 +6992,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 382 + "__id__": 380 }, "_enabled": true, "__prefab": { - "__id__": 422 + "__id__": 420 }, "_contentSize": { "__type__": "cc.Size", @@ -7059,11 +7020,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 382 + "__id__": 380 }, "_enabled": true, "__prefab": { - "__id__": 424 + "__id__": 422 }, "_resizeMode": 1, "_layoutType": 1, @@ -7110,11 +7071,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 381 + "__id__": 379 }, "_enabled": true, "__prefab": { - "__id__": 427 + "__id__": 425 }, "_contentSize": { "__type__": "cc.Size", @@ -7160,14 +7121,14 @@ "fileId": "5dVotvOAFMoaprbNZVAkgY", "instance": null, "targetOverrides": [ + { + "__id__": 429 + }, { "__id__": 431 }, { "__id__": 433 - }, - { - "__id__": 435 } ], "nestedPrefabInstanceRoots": [ @@ -7188,7 +7149,7 @@ { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 336 + "__id__": 334 }, "sourceInfo": null, "propertyPath": [ @@ -7198,7 +7159,7 @@ "__id__": 131 }, "targetInfo": { - "__id__": 432 + "__id__": 430 } }, { @@ -7210,7 +7171,7 @@ { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 336 + "__id__": 334 }, "sourceInfo": null, "propertyPath": [ @@ -7220,7 +7181,7 @@ "__id__": 287 }, "targetInfo": { - "__id__": 434 + "__id__": 432 } }, { @@ -7240,7 +7201,7 @@ "__id__": 287 }, "targetInfo": { - "__id__": 436 + "__id__": 434 } }, { diff --git a/assets/script/game/common/config/HeroSkillDesc.ts b/assets/script/game/common/config/HeroSkillDesc.ts index 8c1c1471..205d5f5a 100644 --- a/assets/script/game/common/config/HeroSkillDesc.ts +++ b/assets/script/game/common/config/HeroSkillDesc.ts @@ -1,4 +1,4 @@ -/** +/** * @file HeroSkillDesc.ts * @description 英雄技能/能力描述的【唯一文字表达标准层】 * @@ -91,8 +91,21 @@ const ATTR_NAME: Partial> = { /** 富文本数值高亮色(鲜亮绿色,深色面板上高亮醒目) */ const RICH_VALUE_COLOR = "#3CE66E"; -/** 富文本技能名高亮色(蓝色,与数值绿色区分,标识技能名「」片段) */ -const RICH_NAME_COLOR = "#2E86C1"; +/** 富文本技能名高亮色(明亮金黄,品质感强,与绿色数值/白色正文拉开层级) */ +const RICH_NAME_COLOR = "#F1C40F"; + +/** 技能名描边色(深棕,衬托金黄填充,深色面板上清晰立体) */ +const RICH_NAME_OUTLINE = "#6E4A0E"; + +/** + * 技能名富文本片段:金黄填充 + 深棕描边。 + * 仅技能名单独包裹描边,正文/数值不描边,突出技能名视觉层级。 + * @param name 技能名(纯文本) + * @returns 包裹的富文本片段 + */ +function skillNameRich(name: string): string { + return `${name}`; +} /** 富文本未激活档位整行灰色(低饱和,深色面板上可读但明显弱化) */ const RICH_LOCKED_COLOR = "#95A5A6"; @@ -476,11 +489,11 @@ export function buildSingleSkillRich(skillUuid: number, overrides?: SkillOverrid // SkillConfig 未定义 cd 字段,冷却时间由外部运行时数据传入;计时模式展示持续时间 const dur = skill.buff_duration ?? (skill.timed_buff_id !== undefined ? BuffList[skill.timed_buff_id]?.duration : undefined) ?? 0; const cdTag = dur > 0 ? `持续:${dur}s` : ""; - const nameTag = `「${skill.name}」 Lv.${lv}`; + const nameTag = `${skillNameRich(skill.name)} Lv.${lv}`; // 复用结构化效果行,head 为空避免重复触发类型前缀 const line = buildEffectLine("", skill); - const prefix = line.prefix.replace(SKILL_NAME_PATTERN, `「$1」`); + const prefix = line.prefix.replace(SKILL_NAME_PATTERN, (m, g1) => skillNameRich(g1)); const effect = line.value ? `${prefix}${line.value}${line.suffix}` : `${prefix}${line.suffix}`; @@ -500,7 +513,7 @@ export function buildEquipRich(fieldUuids: number[], showName: boolean = false): for (const uuid of fieldUuids) { const line = buildFieldLine("", uuid, showName); if (!line) continue; - const prefix = line.prefix.replace(SKILL_NAME_PATTERN, `「$1」`); + const prefix = line.prefix.replace(SKILL_NAME_PATTERN, (m, g1) => skillNameRich(g1)); const text = line.value ? `${prefix}${line.value}${line.suffix}` : `${prefix}${line.suffix}`; @@ -528,7 +541,7 @@ export function buildSkillDescMoreRich(source: ISkillDescSource): string { // 单条效果 → 富文本(技能名蓝色、数值绿色高亮、持续秒数高亮) const effectRich = (line: ISkillLine): string => { - const prefix = line.prefix.replace(SKILL_NAME_PATTERN, `「$1」`); + const prefix = line.prefix.replace(SKILL_NAME_PATTERN, (m, g1) => skillNameRich(g1)); const text = line.value ? `${prefix}${line.value}${line.suffix}` : `${prefix}${line.suffix}`; @@ -583,7 +596,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(`「${reviveName}」: 每回合拥有${revive.r_num}次重生机会,死亡后以${Math.round(revive.upr * 100)}%血量原地重生`); + lines.push(`${skillNameRich(reviveName)}: 每回合拥有${revive.r_num}次重生机会,死亡后以${Math.round(revive.upr * 100)}%血量原地重生`); } return lines.join("\n"); @@ -605,7 +618,7 @@ function highlightDuration(text: string): string { */ function renderLineRich(line: ISkillLine): string { if (line.locked) return `${line.prefix}${line.value}${line.suffix}`; - const prefix = line.prefix.replace(SKILL_NAME_PATTERN, `「$1」`); + const prefix = line.prefix.replace(SKILL_NAME_PATTERN, (m, g1) => skillNameRich(g1)); // 未来档数值灰色追加在当前高亮数值后("15%/20%/30%"),suffix 仍位于整段数值之后 const next = line.nextValues?.length ? `/${line.nextValues.join("/")}` : ""; return line.value @@ -674,7 +687,7 @@ export function buildCardDescRich(card: CardConfig): string { return rich; } - const rhythm = `每${tInv}秒召唤${(card.overrides?.num ?? 0) + 1}个「${skill.name}」攻击敌人`; + const rhythm = `每${tInv}秒召唤${(card.overrides?.num ?? 0) + 1}个${skillNameRich(skill.name)}攻击敌人`; const times = `,共${tTimes}次`; return `${rhythm},${rich}${times}`; }