This commit is contained in:
2025-01-02 13:04:35 +08:00
parent b29adbd1a3
commit b448945994
3 changed files with 1983 additions and 1827 deletions

View File

@@ -1,4 +1,4 @@
import { _decorator,Button,EventHandler,EventTouch,instantiate,Label,NodeEventType,Prefab,ProgressBar,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } from "cc";
import { _decorator,Button,color,EventHandler,EventTouch,instantiate,Label,NodeEventType,Prefab,ProgressBar,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } 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 { HeroInfo, HeroList } from "../common/config/heroSet";
@@ -108,17 +108,31 @@ export class HeroHomeComp extends CCComp {
this.node.getChildByName("show").getChildByName("name").getChildByName("quality").getChildByName("k2").active = this.hero.kind == 2;
this.node.getChildByName("show").getChildByName("name").getChildByName("quality").getChildByName("k3").active = this.hero.kind == 3;
let lvneed=((LvUp[0]+this.hero.lvexp)*this.role.lv)
// lvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.LvUp*this.role.lv).toString()
lvup.getChildByName("item").getChildByName("btn").getChildByName("need").getComponent(Label).string = ((LvUp[0]+this.hero.lvexp)*this.role.lv).toString()
lvup.getChildByName("item").getChildByName("btn").getChildByName("need").getComponent(Label).string = lvneed.toString()
lvup.getChildByName("item").getChildByName("btn").getChildByName("num").getComponent(Label).string = smc.vmdata.exp.num.toString()
if( smc.vmdata.exp.num>=lvneed) {
lvup.getChildByName("item").getChildByName("btn").getChildByName("num").getComponent(Label).color = color(0,255,0);
}else{
lvup.getChildByName("item").getChildByName("btn").getChildByName("num").getComponent(Label).color = color(255,0,0);
}
lvup.getChildByName("item").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/lvneed
lvup.getChildByName("info").getChildByName("ap").getComponent(Label).string = "+"+this.hero.ap_up
lvup.getChildByName("info").getChildByName("def").getComponent(Label).string = "+"+this.hero.def_up
lvup.getChildByName("info").getChildByName("hp").getComponent(Label).string = "+"+this.hero.hp_up
lvup.getChildByName("item").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/((LvUp[0]+this.hero.lvexp)*this.role.lv)
// slvup.getChildByName("gold").getChildByName("btn").getChildByName("need").getComponent(Label).string = (UpGold.SlvUp*(this.role.slv+1)).toString()
slvup.getChildByName("cost").getChildByName("btn").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv)).toString()
slvup.getChildByName("cost").getChildByName("btn").getChildByName("num").getComponent(Label).string = smc.heros[this.h_uuid].num.toString()
let slvneed=((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
let slvnum=smc.heros[this.h_uuid].num
if( slvnum>=slvneed) {
slvup.getChildByName("cost").getChildByName("btn").getChildByName("num").getComponent(Label).color = color(0,255,0);
}else{
slvup.getChildByName("cost").getChildByName("btn").getChildByName("num").getComponent(Label).color = color(255,0,0);
}
slvup.getChildByName("cost").getChildByName("btn").getChildByName("need").getComponent(Label).string = slvneed.toString()
slvup.getChildByName("cost").getChildByName("btn").getChildByName("num").getComponent(Label).string = slvnum.toString()
slvup.getChildByName("cost").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.heros[this.h_uuid].num/((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
let hchipcomp= slvup.getChildByName("cost").getChildByName("btn").getChildByName("hchip").getComponent(HChipComp)
hchipcomp.update_data(this.h_uuid,0)