refactor(gui, talent): 调整天赋卡片UI布局与边框参数

feat(talent): 新增天赋面板经验数值与点数统计显示

refactor(hero): 重构英雄列表与详情弹窗排序逻辑

fix(window): 修复弹窗默认激活状态与位置偏移问题
This commit is contained in:
panFD
2026-09-18 23:11:42 +08:00
parent 16854ab1b8
commit f67f8a4aa0
10 changed files with 5736 additions and 977 deletions

View File

@@ -69,6 +69,9 @@ export class TalentsComp extends CCComp {
@property({ type: ProgressBar, tooltip: "当前等级经验进度条" })
progress_exp: ProgressBar = null!;
@property({ type: Label, tooltip: "当前等级经验数值(当前经验/升级所需经验)" })
lbl_exp: Label = null!;
@property({ type: Node, tooltip: "一阶页签节点" })
tab_basic: Node = null!;
@@ -148,7 +151,14 @@ export class TalentsComp extends CCComp {
if (!this.talents_content || !this.prefab_talent_item) return;
const levels = smc.getTalentLevels();
if (this.lbl_points) this.lbl_points.string = `${smc.getTalentPoints()}`;
if (this.lbl_points) {
// 剩余/总点数:总点数 = 剩余 + 各阶已投入
const remaining = smc.getTalentPoints();
const invested = getTalentTierInvestedPoints(levels, TalentTier.Basic)
+ getTalentTierInvestedPoints(levels, TalentTier.Specialized)
+ getTalentTierInvestedPoints(levels, TalentTier.Super);
this.lbl_points.string = `${remaining}/${remaining + invested}`;
}
// 天赋等级(Lv.x)与当前等级经验进度
const talentLv = smc.getTalentLevel();
@@ -160,6 +170,13 @@ export class TalentsComp extends CCComp {
? Math.min(1, smc.getTalentExp() / needExp)
: 1;
}
if (this.lbl_exp) {
const needExp = getTalentLevelExp(talentLv);
// 满级后显示为 0/0,避免分母为 0
this.lbl_exp.string = needExp > 0
? `${smc.getTalentExp()}/${needExp}`
: `0/0`;
}
// 仅首次进入时默认选中已解锁的最高阶,后续刷新保持玩家当前选择
if (!this.inited) {