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

@@ -114,8 +114,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.7, "x": 1,
"y": 0.7, "y": 1,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -142,8 +142,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 160, "width": 120,
"height": 160 "height": 120
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -325,8 +325,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.7, "x": 1,
"y": 0.7, "y": 1,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -353,8 +353,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 160, "width": 120,
"height": 160 "height": 120
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -536,8 +536,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.7, "x": 1,
"y": 0.7, "y": 1,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -564,8 +564,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 160, "width": 120,
"height": 160 "height": 120
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",

File diff suppressed because it is too large Load Diff

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 { 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 { HeroInfo, HeroList } from "../common/config/heroSet"; 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("k2").active = this.hero.kind == 2;
this.node.getChildByName("show").getChildByName("name").getChildByName("quality").getChildByName("k3").active = this.hero.kind == 3; 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("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("ap").getComponent(Label).string = "+"+this.hero.ap_up
lvup.getChildByName("info").getChildByName("def").getComponent(Label).string = "+"+this.hero.def_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("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) 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("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() let slvneed=((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
slvup.getChildByName("cost").getChildByName("btn").getChildByName("num").getComponent(Label).string = smc.heros[this.h_uuid].num.toString() 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)) 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) let hchipcomp= slvup.getChildByName("cost").getChildByName("btn").getChildByName("hchip").getComponent(HChipComp)
hchipcomp.update_data(this.h_uuid,0) hchipcomp.update_data(this.h_uuid,0)