style: 修复代码格式与导入缺失

1. 补全MissionCardComp.ts中缺失的Prefab导入项
2. 统一调整两个文件中的缩进与空格格式问题
3. 修正HInfoComp.ts中的导入语句空格错误
This commit is contained in:
pan
2026-07-22 09:53:42 +08:00
parent 6725cb81b7
commit d37fadf5cf
3 changed files with 2580 additions and 16367 deletions

View File

@@ -40,7 +40,7 @@ import { SkillSet } from "../common/config/SkillSet";
import { CardBgComp } from "./CardBgComp";
import { MissionEconomy } from "./MissionEconomy";
const {property, ccclass } = _decorator;
const { property, ccclass } = _decorator;
/**
* HInfoComp —— 场上英雄信息面板视图组件
@@ -53,41 +53,41 @@ const {property, ccclass } = _decorator;
export class HInfoComp extends CCComp {
/** 英雄 idle 动画图标节点 */
@property(Node)
icon_node=null!
icon_node = null!
/** 技能图标节点 */
@property(Node)
skill_icon_node=null!
skill_icon_node = null!
/** 出售按钮节点 */
@property(Node)
sell_node=null!
sell_node = null!
/** 卡牌背景底框节点(按卡池等级切换子节点显示) */
@property(Node)
BG_node=null!
BG_node = null!
/** 关闭窗口按钮节点 */
@property(Node)
close_node=null!
close_node = null!
/** 英雄名字节点 */
@property(Node)
Name_node=null!
Name_node = null!
/** 技能信息节点 */
@property(Node)
info_node=null!
info_node = null!
@property(Label)
lv_node: Label = null!
@property(Node)
ap_node=null!
ap_node = null!
@property(Node)
hp_node=null!
hp_node = null!
@property(Node)
cd_node=null!
cd_node = null!
/** 绑定的英雄 ECS 实体 ID */
private eid: number = 0;
@@ -133,14 +133,14 @@ export class HInfoComp extends CCComp {
}
const eid = args?.eid ?? 0;
if (!eid) return;
let foundModel: HeroAttrsComp | null = null;
ecs.query(ecs.allOf(HeroAttrsComp)).forEach((entity: ecs.Entity) => {
if (entity.eid === eid) {
foundModel = entity.get(HeroAttrsComp);
}
});
if (foundModel) {
this.bindData(eid, foundModel);
} else {
@@ -309,14 +309,14 @@ export class HInfoComp extends CCComp {
return;
}
if (!this.model) return;
// ---- 卡牌等级显示 ----
if (this.lv_node) {
const currentLv = this.model.lv ?? 1;
this.lv_node.string = `Lv.${currentLv}`;
this.lv_node.color = getLvColor(currentLv);
}
// ---- 卡池等级标识 ----
const kindName = CKind[CKind.Hero];
if (this.BG_node) {
@@ -326,7 +326,7 @@ export class HInfoComp extends CCComp {
if (bg) child.active ? bg.apply(this.model.base_pool_lv ?? this.model.pool_lv ?? 1) : bg.clear();
});
}
// ---- 图标动画(仅在 UUID 变化时重新加载) ----
const heroUuid = this.model.hero_uuid ?? 0;
if (heroUuid !== this.iconHeroUuid) {
@@ -590,7 +590,7 @@ export class HInfoComp extends CCComp {
// const heroUuid = this.model.hero_uuid ?? 0;
// if (!heroUuid || !HeroInfo[heroUuid]) return;
// const heroLv = Math.max(1, Math.floor(this.model.lv ?? 1));
// this.isClosing = true;
// oops.gui.remove(UIID.HInfo); // 打开 IBox 前关闭自身
// oops.gui.remove(UIID.IBox);