feat(talent-ui): 优化天赋界面展示逻辑与数据显示

1.  天赋总览页新增各层已投入点数展示
2.  天赋详情弹窗重构前置与层位校验UI:
    - 拆分层位需求与软前置展示模块
    - 优化进度显示逻辑,避免数值歧义
    - 修正前置等级展示为当前/需求格式
3.  更新相关注释与文档说明
This commit is contained in:
pan
2026-09-20 16:04:09 +08:00
parent c183ae464a
commit 1634f6a528
4 changed files with 3971 additions and 1738 deletions

View File

@@ -3,7 +3,7 @@
* @description 天赋加点页组件(UI 视图层,最小容器)
*
* 职责:
* 1. 页头展示:可用天赋点 / 天赋等级(Lv.x)/ 当前等级经验进度。
* 1. 页头展示:可用天赋点 / 天赋等级(Lv.x)/ 当前等级经验进度 / 各层已投入点数。
* 2. 收集子树内全部 TalentItemComp(编辑器静态摆放),TALENT_UPDATE 事件驱动全量刷新。
* 3. 卡片点击统一打开 TIBox 天赋详情弹窗;加点校验(层位/前置/满级/点数)由 TIBoxComp 内聚,
* 不满足条件时弹窗隐藏加点按钮,仅作详情查看。
@@ -46,6 +46,9 @@ export class TalentsComp extends CCComp {
@property({ type: Label, tooltip: "当前等级经验数值(当前经验/升级所需经验)" })
lbl_exp: Label = null!;
@property({ type: [Label], tooltip: "各层已投入点数 Label(数组索引对应第 1~5 层)" })
lbl_tier_points: Label[] = [];
@property({ type: Node, tooltip: "看广告重置按钮" })
btn_reset: Node = null!;
@@ -88,6 +91,14 @@ export class TalentsComp extends CCComp {
this.lbl_points.string = `${remaining}/${remaining + invested}`;
}
// 各层已投入点数(数组索引对应层 1~5)
for (let tier = 1; tier <= this.lbl_tier_points.length; tier++) {
const lbl = this.lbl_tier_points[tier - 1];
if (lbl) {
lbl.string = `${getTalentTierInvestedPoints(levels, tier)}`;
}
}
// 天赋等级(Lv.x)与当前等级经验进度
const talentLv = smc.getTalentLevel();
if (this.lbl_lv) this.lbl_lv.string = `Lv.${talentLv}`;