refactor(map): 移除冗余的卡池等级节点并重构显示逻辑
1. 删除HInfoComp和CardLiteComp中不再使用的pool_lv相关节点字段 2. 将卡池等级背景色显示逻辑迁移到HerosListComp中统一处理 3. 简化CardLiteComp的节点初始化隐藏逻辑
This commit is contained in:
@@ -76,8 +76,6 @@ export class HInfoComp extends CCComp {
|
||||
@property(Label)
|
||||
lv_node: Label = null!
|
||||
|
||||
@property(Node)
|
||||
pool_lvnode: Node = null!
|
||||
@property(Node)
|
||||
ap_node=null!
|
||||
|
||||
@@ -160,13 +158,6 @@ export class HInfoComp extends CCComp {
|
||||
this.lv_node.color = getLvColor(heroLv);
|
||||
}
|
||||
|
||||
if (this.pool_lvnode) {
|
||||
const poolLvStr = `lv${this.previewPoolLv}`;
|
||||
this.pool_lvnode.children.forEach(child => {
|
||||
child.active = (child.name === poolLvStr);
|
||||
});
|
||||
}
|
||||
|
||||
const poolColorNames = ["green", "blue", "purple", "yellow", "red"];
|
||||
const poolColorIdx = Math.min(this.previewPoolLv, 5) - 1;
|
||||
const activeColor = poolColorNames[poolColorIdx];
|
||||
@@ -288,16 +279,8 @@ export class HInfoComp extends CCComp {
|
||||
}
|
||||
|
||||
// ---- 卡池等级标识 ----
|
||||
const poolLv = this.model.pool_lv ?? 1;
|
||||
if (this.pool_lvnode) {
|
||||
const poolLvStr = `lv${poolLv}`;
|
||||
this.pool_lvnode.children.forEach(child => {
|
||||
child.active = (child.name === poolLvStr);
|
||||
});
|
||||
}
|
||||
|
||||
const poolColorNames = ["green", "blue", "purple", "yellow", "red"];
|
||||
const poolColorIdx = Math.min(poolLv, 5) - 1;
|
||||
const poolColorIdx = Math.min(this.model.pool_lv ?? 1, 5) - 1;
|
||||
const activeColor = poolColorNames[poolColorIdx];
|
||||
const kindName = CKind[CKind.Hero];
|
||||
if (this.BG_node) {
|
||||
|
||||
Reference in New Issue
Block a user