fix(talent): 调整天赋项UI显示逻辑与样式

1.  修改天赋项锁定状态判断逻辑,不再因Lv0显示锁遮罩
2.  更新节点注释与tooltip描述
3.  调整预制体布局与精灵资源配置
This commit is contained in:
panFD
2026-09-19 15:34:35 +08:00
parent 707e25e73f
commit f4150bd33c
7 changed files with 11109 additions and 4183 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e2394eb1-27f0-4b7c-ace3-cfb3453eef99",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "TIBox"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -6326,10 +6326,10 @@
"height": 75,
"rawWidth": 52,
"rawHeight": 75,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 37.5,
"borderBottom": 37.5,
"borderLeft": 26,
"borderRight": 26,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,

View File

@@ -6,7 +6,7 @@
* 1. 通过编辑器配置的 uuid 自查询天赋配置 + 当前等级 + 层位解锁态,渲染迷你点选卡。
* 2. 卡面自包含:图标 / 名称 / 当前已生效数值(Lv0 显示每级数值引导)/ 右下「当前/满级」角标。
* 3. 层位背景:普通背景节点下挂 blue / red / yellow 三个颜色子节点,按层位映射激活其一(L1蓝 / L2红 / L3金,L4/L5 复用金)。
* 4. 状态机:满级(MAX 金角标)/ 未激活(左上锁角标:未加点 / 层位未解锁 / 前置未满足,不做灰阶处理)。
* 4. 状态机:满级(MAX 金角标)/ 锁定(锁遮罩:层位未解锁或前置未满足;可加点时不显示,不做灰阶处理)。
* 5. 点击回调上抛卡体点击,加点确认弹窗与升级校验统一由 TalentsComp 处理(单一决策点)。
*
* 依赖:
@@ -58,9 +58,10 @@ export class TalentItemComp extends CCComp {
@property({ type: Node, tooltip: "MAX 满级角标" })
node_max: Node = null!;
@property({ type: Node, tooltip: "未激活锁遮罩/锁图标(未加点、层位未解锁或前置未满足)" })
@property({ type: Node, tooltip: "锁遮罩/锁图标(层位未解锁或前置未满足时显示;可加点时隐藏)" })
node_lock: Node = null!;
/** 点击回调(卡体点击上抛),由 TalentsComp 统一校验升级 */
public onTalentTap: ((uuid: number) => void) | null = null;
@@ -86,8 +87,8 @@ export class TalentItemComp extends CCComp {
if (this.lbl_info) this.lbl_info.string = getTalentDisplayText(cfg, lv);
if (this.lbl_lv) this.lbl_lv.string = `${lv}/${cfg.max_lv}`;
// 未激活(Lv0 / 层位未解锁 / 前置未满足):仅显示 node_lock 锁遮罩,不做灰阶处理
const inactive = lv <= 0 || !tierUnlocked || !prereqMet;
// 锁遮罩:仅在层位未解锁或前置未满足时显示;已解锁且前置满足即可加点,不再因 Lv0 挂锁
const locked = !tierUnlocked || !prereqMet;
// 层位背景:激活对应颜色子节点(L1蓝 / L2红 / L3金)
if (this.bg) this.applyTierBg(cfg.tier);
@@ -104,9 +105,9 @@ export class TalentItemComp extends CCComp {
if (frame) this.icon.spriteFrame = frame;
}
// 状态角标:满级 MAX / 未激活锁角标(置于左上角)
// 状态角标:满级 MAX / 锁遮罩(层位未解锁或前置未满足)
if (this.node_max) this.node_max.active = lv >= cfg.max_lv;
if (this.node_lock) this.node_lock.active = inactive;
if (this.node_lock) this.node_lock.active = locked;
}
/** 按层位激活 bg 下对应颜色子节点,其余隐藏 */