fix(equipBox): 修复装备盒点击预览逻辑
1. 移除冗余的跨卡池查找逻辑,改为仅从装备卡池查询装备配置 2. 新增isEquipCard参数区分装备卡和技能卡预览,优化HInfoComp的数据查询逻辑 3. 调整弹窗打开参数,简化装备盒点击的配置传递
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
* - 销毁时通过 GameEvent.RemoveSkillBox 通知 MissSkillsComp 回收槽位
|
||||
*
|
||||
* 依赖:
|
||||
* - CardPoolList / CardTriggerType(CardSet)—— 通用卡牌类型定义
|
||||
* - CardTriggerType(CardSet)—— 卡牌触发类型定义
|
||||
* - EquipPoolList(EquipSet)—— 装备卡池配置(查询触发配置)
|
||||
* - SkillSet —— 技能静态配置(icon 字段)
|
||||
* - GameEvent —— 各类游戏事件
|
||||
@@ -34,7 +34,7 @@ import { mLogger } from "../common/Logger";
|
||||
import { _decorator, Node, Prefab, Sprite, Label, Vec3, resources, SpriteAtlas, tween, v3, Tween, 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 { CardPoolList, CardTriggerType } from "../common/config/CardSet";
|
||||
import { CardTriggerType } from "../common/config/CardSet";
|
||||
import { EquipPoolList } from "../common/config/EquipSet";
|
||||
import { SkillSet, SkillOverrides, FieldSkillSet } from "../common/config/SkillSet";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
@@ -150,14 +150,9 @@ export class EquipBoxComp extends CCComp {
|
||||
private onNodeClicked() {
|
||||
if (!this.initialized) return;
|
||||
oops.audio.playEffect("music/button");
|
||||
// 点击时弹出 HInfoComp,传入卡牌 UUID 和等级以启用预览模式
|
||||
// 优先从装备卡池查找,找不到再从技能卡池查找
|
||||
const config = EquipPoolList.find(c => c.uuid === this.s_uuid || c.skill === this.s_uuid)
|
||||
?? CardPoolList.find(c => c.uuid === this.s_uuid || c.skill === this.s_uuid);
|
||||
const cardUuid = config ? config.uuid : this.s_uuid;
|
||||
|
||||
// 点击装备盒弹出 HInfoComp,从 EquipPoolList 查询配置
|
||||
oops.gui.remove(UIID.HInfo);
|
||||
oops.gui.open(UIID.HInfo, { heroUuid: cardUuid, heroLv: this.card_lv, poolLv: config?.pool_lv ?? 1, isSkillCard: true });
|
||||
oops.gui.open(UIID.HInfo, { heroUuid: this.s_uuid, heroLv: this.card_lv, poolLv: 1, isSkillCard: true, isEquipCard: true });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user