refactor(talent): 重构天赋道具UI状态显示逻辑

1. 移除原MAX满级角标,替换为两种状态边框
2. 新增满级边框和已加点边框逻辑
3. 调整UI3布局参数优化显示
4. 更新预制件和注释文档
This commit is contained in:
pan
2026-09-20 10:55:27 +08:00
parent c610829661
commit d140645aab
5 changed files with 6767 additions and 4421 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7476,7 +7476,7 @@
"height": 17, "height": 17,
"rawWidth": 4, "rawWidth": 4,
"rawHeight": 17, "rawHeight": 17,
"borderTop": 10, "borderTop": 9,
"borderBottom": 7, "borderBottom": 7,
"borderLeft": 2, "borderLeft": 2,
"borderRight": 2, "borderRight": 2,

View File

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