ui 整体修改

This commit is contained in:
2024-12-22 23:52:22 +08:00
parent 177bc0e346
commit 26c673e95b
18 changed files with 8067 additions and 9817 deletions

View File

@@ -25,14 +25,10 @@ export class HeroCard extends ecs.Entity {
const sprite = node.getChildByName("Mask").getChildByName("hero").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
});
node.getChildByName("lv").getComponent(Label).string = smc.heros[uuid].lv.toString()+"级";
if(smc.heros[uuid].slv>=1) {slv.getChildByName("s1").active=true} else {slv.getChildByName("s1").active=false};
if(smc.heros[uuid].slv>=2) {slv.getChildByName("s2").active=true} else {slv.getChildByName("s2").active=false};
if(smc.heros[uuid].slv>=3) {slv.getChildByName("s3").active=true} else {slv.getChildByName("s3").active=false};
if(smc.heros[uuid].slv>=4) {slv.getChildByName("s4").active=true} else {slv.getChildByName("s4").active=false};
if(smc.heros[uuid].slv>=5) {slv.getChildByName("s5").active=true} else {slv.getChildByName("s5").active=false};
let hcc = node.getComponent(HeroCardComp)!;
hcc.h_uuid = uuid;
hcc.update_data();
this.add(hcc);
}
/** 模块资源释放 */

View File

@@ -37,15 +37,18 @@ export class HeroCardComp extends CCComp {
show_bg(val:boolean){
this.node.getChildByName("show").active=val
}
update_data(event: string, args: any){
if(args.uuid!=this.h_uuid) return
update_data(){
let slv = this.node.getChildByName("slv")
this.node.getChildByName("lv").getComponent(Label).string=smc.heros[this.h_uuid].lv.toString()+"级"
if(smc.heros[this.h_uuid].slv>=1) {slv.getChildByName("s1").active=true} else {slv.getChildByName("s1").active=false};
if(smc.heros[this.h_uuid].slv>=2) {slv.getChildByName("s2").active=true} else {slv.getChildByName("s2").active=false};
if(smc.heros[this.h_uuid].slv>=3) {slv.getChildByName("s3").active=true} else {slv.getChildByName("s3").active=false};
if(smc.heros[this.h_uuid].slv>=4) {slv.getChildByName("s4").active=true} else {slv.getChildByName("s4").active=false};
if(smc.heros[this.h_uuid].slv>=5) {slv.getChildByName("s5").active=true} else {slv.getChildByName("s5").active=false};
if(smc.heros[this.h_uuid].slv==0){
this.node.getChildByName("lock").active=true
slv.active=false
}else{
slv.active=true
this.node.getChildByName("lock").active=false
slv.getChildByName("slv").getComponent(Label).string=smc.heros[this.h_uuid].slv.toString()
}
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {

View File

@@ -25,14 +25,9 @@ export class HeroSelect extends ecs.Entity {
const sprite = node.getChildByName("Mask").getChildByName("hero").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
});
node.getChildByName("lv").getComponent(Label).string = smc.heros[uuid].lv.toString()+"级";
if(smc.heros[uuid].slv>=1) {slv.getChildByName("s1").active=true} else {slv.getChildByName("s1").active=false};
if(smc.heros[uuid].slv>=2) {slv.getChildByName("s2").active=true} else {slv.getChildByName("s2").active=false};
if(smc.heros[uuid].slv>=3) {slv.getChildByName("s3").active=true} else {slv.getChildByName("s3").active=false};
if(smc.heros[uuid].slv>=4) {slv.getChildByName("s4").active=true} else {slv.getChildByName("s4").active=false};
if(smc.heros[uuid].slv>=5) {slv.getChildByName("s5").active=true} else {slv.getChildByName("s5").active=false};
let hcc = node.getComponent(HeroSelectComp)!;
hcc.h_uuid = uuid;
hcc.update_data();
this.add(hcc);
}

View File

@@ -52,15 +52,15 @@ export class HeroSelectComp extends CCComp {
show_bg(val:boolean){
this.node.getChildByName("show").active=val
}
update_data(event: string, args: any){
if(args.uuid!=this.h_uuid) return
update_data(){
let slv = this.node.getChildByName("slv")
this.node.getChildByName("lv").getComponent(Label).string=smc.heros[this.h_uuid].lv.toString()+"级"
if(smc.heros[this.h_uuid].slv>=1) {slv.getChildByName("s1").active=true} else {slv.getChildByName("s1").active=false};
if(smc.heros[this.h_uuid].slv>=2) {slv.getChildByName("s2").active=true} else {slv.getChildByName("s2").active=false};
if(smc.heros[this.h_uuid].slv>=3) {slv.getChildByName("s3").active=true} else {slv.getChildByName("s3").active=false};
if(smc.heros[this.h_uuid].slv>=4) {slv.getChildByName("s4").active=true} else {slv.getChildByName("s4").active=false};
if(smc.heros[this.h_uuid].slv>=5) {slv.getChildByName("s5").active=true} else {slv.getChildByName("s5").active=false};
if(smc.heros[this.h_uuid].slv==0){
slv.active=false
}else{
slv.active=true
slv.getChildByName("slv").getComponent(Label).string=smc.heros[this.h_uuid].slv.toString()
}
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {

View File

@@ -23,7 +23,7 @@ export class CardControllerComp extends CCComp {
touch_time:number = 0
in_touch:boolean = false
bbg:any=null
bbg_y:number=60
bbg_y:number=40
bbg_x:any=[-300,-150,0,150,300]
protected onLoad(): void {
this.bbg=this.node.getChildByName("bar").getChildByName("bbg")

View File

@@ -55,7 +55,7 @@ export class HeroHomeComp extends CCComp {
sprite.spriteFrame = atlas.getSpriteFrame(this.hero.path);
});
resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
const sprite = sk_node.getChildByName("skicon").getChildByName("icon").getComponent(Sprite);
const sprite = sk_node.getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(skill.path);
});
sk_node.getChildByName("name").getComponent(Label).string = skill.name;
@@ -75,14 +75,13 @@ export class HeroHomeComp extends CCComp {
let attr = this.node.getChildByName("attr");
let attr2 = this.node.getChildByName("attr2").getChildByName("other");
this.node.getChildByName("name").getChildByName("lv").getComponent(Label).string = this.role.lv.toString()+"级";
if( this.role.slv==0) {
slv_node.getChildByName("slv").active=false
}else{
slv_node.getChildByName("slv").active=true
slv_node.getChildByName("slv").getComponent(Label).string = this.role.slv.toString();
};
if( this.role.slv>=1) {slv_node.getChildByName("s1").active=true}else{slv_node.getChildByName("s1").active=false};
if( this.role.slv>=2) {slv_node.getChildByName("s2").active=true}else{slv_node.getChildByName("s2").active=false};
if( this.role.slv>=3) {slv_node.getChildByName("s3").active=true}else{slv_node.getChildByName("s3").active=false};
if( this.role.slv>=4) {slv_node.getChildByName("s4").active=true}else{slv_node.getChildByName("s4").active=false};
if( this.role.slv>=5) {slv_node.getChildByName("s5").active=true}else{slv_node.getChildByName("s5").active=false};
// lvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.LvUp*this.role.lv).toString()
lvup.getChildByName("item").getChildByName("need").getComponent(Label).string = ((LvUp[0]+this.hero.lvexp)*this.role.lv).toString()
lvup.getChildByName("info").getChildByName("ap").getComponent(Label).string = "+"+this.hero.ap_up