style: 修复代码格式与导入缺失
1. 补全MissionCardComp.ts中缺失的Prefab导入项 2. 统一调整两个文件中的缩进与空格格式问题 3. 修正HInfoComp.ts中的导入语句空格错误
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@ import { SkillSet } from "../common/config/SkillSet";
|
|||||||
import { CardBgComp } from "./CardBgComp";
|
import { CardBgComp } from "./CardBgComp";
|
||||||
import { MissionEconomy } from "./MissionEconomy";
|
import { MissionEconomy } from "./MissionEconomy";
|
||||||
|
|
||||||
const {property, ccclass } = _decorator;
|
const { property, ccclass } = _decorator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HInfoComp —— 场上英雄信息面板视图组件
|
* HInfoComp —— 场上英雄信息面板视图组件
|
||||||
@@ -53,41 +53,41 @@ const {property, ccclass } = _decorator;
|
|||||||
export class HInfoComp extends CCComp {
|
export class HInfoComp extends CCComp {
|
||||||
/** 英雄 idle 动画图标节点 */
|
/** 英雄 idle 动画图标节点 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
icon_node=null!
|
icon_node = null!
|
||||||
/** 技能图标节点 */
|
/** 技能图标节点 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
skill_icon_node=null!
|
skill_icon_node = null!
|
||||||
/** 出售按钮节点 */
|
/** 出售按钮节点 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
sell_node=null!
|
sell_node = null!
|
||||||
|
|
||||||
/** 卡牌背景底框节点(按卡池等级切换子节点显示) */
|
/** 卡牌背景底框节点(按卡池等级切换子节点显示) */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
BG_node=null!
|
BG_node = null!
|
||||||
|
|
||||||
/** 关闭窗口按钮节点 */
|
/** 关闭窗口按钮节点 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
close_node=null!
|
close_node = null!
|
||||||
|
|
||||||
/** 英雄名字节点 */
|
/** 英雄名字节点 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
Name_node=null!
|
Name_node = null!
|
||||||
|
|
||||||
/** 技能信息节点 */
|
/** 技能信息节点 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
info_node=null!
|
info_node = null!
|
||||||
|
|
||||||
@property(Label)
|
@property(Label)
|
||||||
lv_node: Label = null!
|
lv_node: Label = null!
|
||||||
|
|
||||||
@property(Node)
|
@property(Node)
|
||||||
ap_node=null!
|
ap_node = null!
|
||||||
|
|
||||||
@property(Node)
|
@property(Node)
|
||||||
hp_node=null!
|
hp_node = null!
|
||||||
|
|
||||||
@property(Node)
|
@property(Node)
|
||||||
cd_node=null!
|
cd_node = null!
|
||||||
|
|
||||||
/** 绑定的英雄 ECS 实体 ID */
|
/** 绑定的英雄 ECS 实体 ID */
|
||||||
private eid: number = 0;
|
private eid: number = 0;
|
||||||
@@ -133,14 +133,14 @@ export class HInfoComp extends CCComp {
|
|||||||
}
|
}
|
||||||
const eid = args?.eid ?? 0;
|
const eid = args?.eid ?? 0;
|
||||||
if (!eid) return;
|
if (!eid) return;
|
||||||
|
|
||||||
let foundModel: HeroAttrsComp | null = null;
|
let foundModel: HeroAttrsComp | null = null;
|
||||||
ecs.query(ecs.allOf(HeroAttrsComp)).forEach((entity: ecs.Entity) => {
|
ecs.query(ecs.allOf(HeroAttrsComp)).forEach((entity: ecs.Entity) => {
|
||||||
if (entity.eid === eid) {
|
if (entity.eid === eid) {
|
||||||
foundModel = entity.get(HeroAttrsComp);
|
foundModel = entity.get(HeroAttrsComp);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (foundModel) {
|
if (foundModel) {
|
||||||
this.bindData(eid, foundModel);
|
this.bindData(eid, foundModel);
|
||||||
} else {
|
} else {
|
||||||
@@ -309,14 +309,14 @@ export class HInfoComp extends CCComp {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.model) return;
|
if (!this.model) return;
|
||||||
|
|
||||||
// ---- 卡牌等级显示 ----
|
// ---- 卡牌等级显示 ----
|
||||||
if (this.lv_node) {
|
if (this.lv_node) {
|
||||||
const currentLv = this.model.lv ?? 1;
|
const currentLv = this.model.lv ?? 1;
|
||||||
this.lv_node.string = `Lv.${currentLv}`;
|
this.lv_node.string = `Lv.${currentLv}`;
|
||||||
this.lv_node.color = getLvColor(currentLv);
|
this.lv_node.color = getLvColor(currentLv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- 卡池等级标识 ----
|
// ---- 卡池等级标识 ----
|
||||||
const kindName = CKind[CKind.Hero];
|
const kindName = CKind[CKind.Hero];
|
||||||
if (this.BG_node) {
|
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();
|
if (bg) child.active ? bg.apply(this.model.base_pool_lv ?? this.model.pool_lv ?? 1) : bg.clear();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- 图标动画(仅在 UUID 变化时重新加载) ----
|
// ---- 图标动画(仅在 UUID 变化时重新加载) ----
|
||||||
const heroUuid = this.model.hero_uuid ?? 0;
|
const heroUuid = this.model.hero_uuid ?? 0;
|
||||||
if (heroUuid !== this.iconHeroUuid) {
|
if (heroUuid !== this.iconHeroUuid) {
|
||||||
@@ -590,7 +590,7 @@ export class HInfoComp extends CCComp {
|
|||||||
// const heroUuid = this.model.hero_uuid ?? 0;
|
// const heroUuid = this.model.hero_uuid ?? 0;
|
||||||
// if (!heroUuid || !HeroInfo[heroUuid]) return;
|
// if (!heroUuid || !HeroInfo[heroUuid]) return;
|
||||||
// const heroLv = Math.max(1, Math.floor(this.model.lv ?? 1));
|
// const heroLv = Math.max(1, Math.floor(this.model.lv ?? 1));
|
||||||
|
|
||||||
// this.isClosing = true;
|
// this.isClosing = true;
|
||||||
// oops.gui.remove(UIID.HInfo); // 打开 IBox 前关闭自身
|
// oops.gui.remove(UIID.HInfo); // 打开 IBox 前关闭自身
|
||||||
// oops.gui.remove(UIID.IBox);
|
// oops.gui.remove(UIID.IBox);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
* - smc.vmdata.mission_data —— 局内数据(coin / hero_num / hero_max_num)
|
* - smc.vmdata.mission_data —— 局内数据(coin / hero_num / hero_max_num)
|
||||||
*/
|
*/
|
||||||
import { mLogger } from "../common/Logger";
|
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 { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
@@ -106,14 +106,20 @@ export class MissionCardComp extends CCComp {
|
|||||||
@property(Node)
|
@property(Node)
|
||||||
closeHeros: Node = null!
|
closeHeros: Node = null!
|
||||||
/** 卡池升级按钮节点(已废弃,保留节点引用防止 editor 报错) */
|
/** 卡池升级按钮节点(已废弃,保留节点引用防止 editor 报错) */
|
||||||
/** 英雄卡牌池cards_node显示隐藏 */
|
/** 英雄卡牌池cards_node显示隐藏 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
showEquips: Node = null!
|
showEquips: Node = null!
|
||||||
/** 关闭英雄卡池按钮(仅负责收起 cards_node) */
|
/** 关闭英雄卡池按钮(仅负责收起 cards_node) */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
closeEquips: Node = null!
|
closeEquips: Node = null!
|
||||||
|
@property(Node)
|
||||||
|
equipsPanNode: Node = null!
|
||||||
|
@property(Node)
|
||||||
|
equipsBoxNode: Node = null!
|
||||||
|
@property(Prefab)
|
||||||
|
equipPrefab: Prefab = null!
|
||||||
/** 卡池升级按钮节点(已废弃,保留节点引用防止 editor 报错) */
|
/** 卡池升级按钮节点(已废弃,保留节点引用防止 editor 报错) */
|
||||||
/** 英雄卡牌池cards_node显示隐藏 */
|
/** 英雄卡牌池cards_node显示隐藏 */
|
||||||
@property(Node)
|
@property(Node)
|
||||||
showShop: Node = null!
|
showShop: Node = null!
|
||||||
/** 关闭英雄卡池按钮(仅负责收起 cards_node) */
|
/** 关闭英雄卡池按钮(仅负责收起 cards_node) */
|
||||||
|
|||||||
Reference in New Issue
Block a user