feat(herolist&skillbox): 新增英雄图鉴技能图标展示功能
1. 为SSkillBoxComp新增英雄图鉴专用初始化方法,支持区分技能/驻场光环图标来源 2. 扩展技能背景色适配,支持5档英雄技能等级配色 3. 在HerosListComp中实现英雄技能图标列表刷新逻辑,支持大招和各类触发技能展示 4. 按英雄等级动态显示技能解锁状态和对应等级图标
This commit is contained in:
@@ -44,6 +44,8 @@ export class SSkillBoxComp extends CCComp {
|
||||
private trigger_type: CardTriggerType = CardTriggerType.Instant;
|
||||
/** 驻场技能词条列表(uuid 指向 FieldSkillSet 底座,value 为生效数值) */
|
||||
public field: FieldEntry[] = [];
|
||||
/** 英雄图鉴模式下的图标来源:skill=SkillSet,field=FieldSkillSet;undefined 表示装备卡模式 */
|
||||
private hero_icon_source?: "skill" | "field";
|
||||
|
||||
/**
|
||||
* 初始化技能卡效果:
|
||||
@@ -69,6 +71,22 @@ export class SSkillBoxComp extends CCComp {
|
||||
this.updateUI();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化英雄技能图标(英雄图鉴面板专用):
|
||||
* 图标按 s_uuid 直接取 SkillSet / FieldSkillSet 配置,不走 EquipPoolList。
|
||||
* @param s_uuid 技能 UUID(大招/触发技能指向 SkillSet,光环词条指向 FieldSkillSet)
|
||||
* @param s_lv 当前英雄等级下生效的技能等级(显示在等级标签)
|
||||
* @param locked 当前等级未激活时显示锁定遮罩
|
||||
* @param isField true 时图标取 FieldSkillSet(驻场光环词条)
|
||||
*/
|
||||
initHeroSkill(s_uuid: number, s_lv: number, locked: boolean, isField: boolean = false) {
|
||||
this.s_uuid = s_uuid;
|
||||
this.card_lv = s_lv;
|
||||
this.hero_icon_source = isField ? "field" : "skill";
|
||||
this.updateUI();
|
||||
this.setLocked(locked);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置技能激活状态:
|
||||
* - locked = true → 显示锁定遮罩,技能未激活
|
||||
@@ -82,10 +100,9 @@ export class SSkillBoxComp extends CCComp {
|
||||
|
||||
/**
|
||||
* 根据技能等级切换 bg_node 下的颜色子节点显示。
|
||||
* 等级与颜色对应关系(技能卡 wave 档位):
|
||||
* card_lv 1 (wave 1) → green
|
||||
* card_lv 2 (wave 5) → blue
|
||||
* card_lv 3 (wave 8) → purple
|
||||
* 等级与颜色对应关系:
|
||||
* 技能卡档位:card_lv 1 (wave 1) → green,2 (wave 5) → blue,3 (wave 8) → purple
|
||||
* 英雄技能等级:s_lv 1~5 → green / blue / purple / red / yellow
|
||||
*/
|
||||
private updateBgNode() {
|
||||
if (!this.bg_node) return;
|
||||
@@ -93,6 +110,8 @@ export class SSkillBoxComp extends CCComp {
|
||||
1: "green",
|
||||
2: "blue",
|
||||
3: "purple",
|
||||
4: "red",
|
||||
5: "yellow",
|
||||
};
|
||||
const targetColor = lvToColor[this.card_lv];
|
||||
this.bg_node.children.forEach(child => {
|
||||
@@ -112,10 +131,16 @@ export class SSkillBoxComp extends CCComp {
|
||||
|
||||
// 加载技能图标
|
||||
if (this.icon_node) {
|
||||
// 优先使用卡牌自定义 icon;未定义则按 trigger_type 自动取
|
||||
// 优先使用卡牌自定义 icon;未定义则按图鉴模式 / 装备卡 trigger_type 自动取
|
||||
let iconId: string | undefined = this.card_icon;
|
||||
if (!iconId) {
|
||||
if (this.trigger_type === CardTriggerType.Interval) {
|
||||
if (this.hero_icon_source === "field") {
|
||||
// 英雄图鉴:驻场光环词条图标取 FieldSkillSet
|
||||
iconId = this.s_uuid ? FieldSkillSet[this.s_uuid]?.icon : undefined;
|
||||
} else if (this.hero_icon_source === "skill") {
|
||||
// 英雄图鉴:大招/触发技能图标取 SkillSet
|
||||
iconId = this.s_uuid ? SkillSet[this.s_uuid]?.icon : undefined;
|
||||
} else if (this.trigger_type === CardTriggerType.Interval) {
|
||||
iconId = this.s_uuid ? SkillSet[this.s_uuid]?.icon : undefined;
|
||||
} else if (this.trigger_type === CardTriggerType.Field) {
|
||||
const fieldUuid = this.field?.[0]?.uuid;
|
||||
|
||||
Reference in New Issue
Block a user