Merge branch 'card0515' of git.eoxnet.com:pan/pixelheros into card0515
This commit is contained in:
@@ -34,7 +34,7 @@ import { UIID } from "../common/config/GameUIConfig";
|
||||
import { mLogger } from "../common/Logger";
|
||||
import { MissionHeroComp } from "./MissionHeroComp";
|
||||
import { MoveComp } from "../hero/MoveComp";
|
||||
import { FacSet } from "../common/config/GameSet";
|
||||
import { FacSet, getLvColor } from "../common/config/GameSet";
|
||||
import { MissionEconomy } from "./MissionEconomy";
|
||||
|
||||
const {property, ccclass } = _decorator;
|
||||
@@ -67,9 +67,11 @@ export class HInfoComp extends CCComp {
|
||||
@property(Node)
|
||||
info_node=null!
|
||||
|
||||
@property(Node)
|
||||
lv_node=null!
|
||||
@property(Label)
|
||||
lv_node: Label = null!
|
||||
|
||||
@property(Node)
|
||||
pool_lvnode: Node = null!
|
||||
@property(Node)
|
||||
ap_node=null!
|
||||
|
||||
@@ -165,11 +167,21 @@ export class HInfoComp extends CCComp {
|
||||
// ---- 卡牌等级显示 ----
|
||||
if (this.lv_node) {
|
||||
const currentLv = this.model.lv ?? 1;
|
||||
this.lv_node.children.forEach(child => {
|
||||
if (child.name.startsWith('lv')) {
|
||||
const nodeLv = parseInt(child.name.substring(2));
|
||||
child.active = !isNaN(nodeLv) && nodeLv <= currentLv;
|
||||
}
|
||||
this.lv_node.string = `Lv.${currentLv}`;
|
||||
this.lv_node.color = getLvColor(currentLv);
|
||||
}
|
||||
|
||||
// ---- 卡池等级标识 ----
|
||||
if (this.pool_lvnode) {
|
||||
const poolLvStr = `lv${this.model.pool_lv ?? 1}`;
|
||||
this.pool_lvnode.children.forEach(child => {
|
||||
// if (child.name === "light") {
|
||||
// child.active = false;
|
||||
// } else if (child.name === "bg") {
|
||||
// child.active = true;
|
||||
// } else {
|
||||
child.active = (child.name === poolLvStr);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user