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

File diff suppressed because it is too large Load Diff

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);

View File

@@ -35,7 +35,7 @@
* - smc.vmdata.mission_data —— 局内数据coin / hero_num / hero_max_num
*/
import { mLogger } from "../common/Logger";
import { _decorator, Label, Node, NodeEventType, Tween, tween, Vec3 } from "cc";
import { _decorator, Label, Node, NodeEventType, Prefab, Tween, tween, Vec3 } 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 { GameEvent } from "../common/config/GameEvent";
@@ -106,14 +106,20 @@ export class MissionCardComp extends CCComp {
@property(Node)
closeHeros: Node = null!
/** 卡池升级按钮节点(已废弃,保留节点引用防止 editor 报错) */
/** 英雄卡牌池cards_node显示隐藏 */
/** 英雄卡牌池cards_node显示隐藏 */
@property(Node)
showEquips: Node = null!
/** 关闭英雄卡池按钮(仅负责收起 cards_node */
@property(Node)
closeEquips: Node = null!
@property(Node)
equipsPanNode: Node = null!
@property(Node)
equipsBoxNode: Node = null!
@property(Prefab)
equipPrefab: Prefab = null!
/** 卡池升级按钮节点(已废弃,保留节点引用防止 editor 报错) */
/** 英雄卡牌池cards_node显示隐藏 */
/** 英雄卡牌池cards_node显示隐藏 */
@property(Node)
showShop: Node = null!
/** 关闭英雄卡池按钮(仅负责收起 cards_node */