feat(UI): 添加技能信息弹窗功能

1. 新增UIID.SInfo枚举项与弹窗配置
2. 为技能图标组件添加点击弹窗逻辑
3. 实现完整的技能信息弹窗UI组件,支持展示技能详情、等级提升说明
4. 支持点击外部区域关闭弹窗,防止重复绑定点击事件
This commit is contained in:
pan
2026-08-27 11:21:30 +08:00
parent 87f31d6804
commit b2f474d73b
4 changed files with 2661 additions and 27 deletions

View File

@@ -1,10 +1,12 @@
import { _decorator, Node, Sprite, Label } from "cc";
import { _decorator, Node, Sprite, Label, NodeEventType } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { oops } from "db://oops-framework/core/Oops";
import { CardTriggerType } from "../common/config/CardSet";
import { EquipPoolList } from "../common/config/EquipSet";
import { SkillSet, FieldSkillSet } from "../common/config/SkillSet";
import { FieldEntry } from "../common/config/heroSet";
import { UIID } from "../common/config/GameUIConfig";
import { smc } from "../common/SingletonModuleComp";
const { ccclass, property } = _decorator;
@@ -53,6 +55,42 @@ export class SSkillBoxComp extends CCComp {
/** 英雄图鉴模式下的图标来源:skill=SkillSet,field=FieldSkillSet;undefined 表示装备卡模式 */
private hero_icon_source?: "skill" | "field";
/** 点击事件是否已注册(防止重复绑定) */
private _clickRegistered: boolean = false;
/**
* 注册点击事件(幂等,可安全重复调用)
*/
private registerClick() {
if (this._clickRegistered) return;
this._clickRegistered = true;
this.node.on(NodeEventType.TOUCH_END, this.onClick, this);
}
/** 点击:弹出技能信息框 */
private onClick() {
oops.audio.playEffect("music/button");
oops.gui.open(UIID.SInfo, {
uuid: this.s_uuid,
card_lv: this.card_lv,
card_icon: this.card_icon,
skill_name: this.resolveSkillName(),
field: this.field,
trigger_type: this.trigger_type,
});
}
onLoad() {
this.registerClick();
}
onDestroy() {
super.onDestroy();
if (this.node && this.node.isValid) {
this.node.off(NodeEventType.TOUCH_END, this.onClick, this);
}
}
/**
* 初始化技能卡效果:
* 1. 从 EquipPoolList 查询装备卡的触发配置(含 trigger_type)。