英雄页面ui 继续完善
This commit is contained in:
@@ -2385,7 +2385,7 @@
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_string": "升星",
|
||||
"_string": "升阶",
|
||||
"_horizontalAlign": 1,
|
||||
"_verticalAlign": 1,
|
||||
"_actualFontSize": 25,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -46,26 +46,35 @@ export class HeroHomeComp extends CCComp {
|
||||
this.hero=HeroInfo[uuid]
|
||||
let tal=this.node.getChildByName("sk").getChildByName("tal");
|
||||
let sk_node= this.node.getChildByName("sk");
|
||||
let skill = SkillSet[this.hero.sk2[0]]
|
||||
let skill1 = SkillSet[this.hero.sk1[0]]
|
||||
let skill2 = SkillSet[this.hero.sk2[0]]
|
||||
var sk_path = "game/skills/skill_icon"
|
||||
var icon_path = "game/heros/herois"
|
||||
|
||||
this.node.getChildByName("name").getChildByName("value").getComponent(Label).string=this.hero.name
|
||||
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("hero").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(this.hero.path);
|
||||
});
|
||||
resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = sk_node.getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(skill.path);
|
||||
const sprite = this.node.getChildByName("sk").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(skill1.path);
|
||||
});
|
||||
sk_node.getChildByName("name").getComponent(Label).string = skill.name;
|
||||
sk_node.getChildByName("info").getComponent(Label).string = skill.info;
|
||||
this.node.getChildByName("name").getChildByName("value").getComponent(Label).string=this.hero.name
|
||||
tal.getChildByName("slv1").getChildByName("val").getComponent(Label).string = this.hero.tals[0]
|
||||
tal.getChildByName("slv2").getChildByName("val").getComponent(Label).string = this.hero.tals[1]
|
||||
tal.getChildByName("slv3").getChildByName("val").getComponent(Label).string = this.hero.tals[2]
|
||||
tal.getChildByName("slv4").getChildByName("val").getComponent(Label).string = this.hero.tals[3]
|
||||
tal.getChildByName("slv5").getChildByName("val").getComponent(Label).string = this.hero.tals[4]
|
||||
this.node.getChildByName("sk").getChildByName("name").getComponent(Label).string = skill1.name;
|
||||
this.node.getChildByName("sk").getChildByName("info").getComponent(Label).string = skill1.info;
|
||||
resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("sk2").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(skill2.path);
|
||||
});
|
||||
this.node.getChildByName("sk2").getChildByName("name").getComponent(Label).string = skill2.name;
|
||||
this.node.getChildByName("sk2").getChildByName("info").getComponent(Label).string = skill2.info;
|
||||
|
||||
// tal.getChildByName("slv1").getChildByName("val").getComponent(Label).string = this.hero.tals[0]
|
||||
// tal.getChildByName("slv2").getChildByName("val").getComponent(Label).string = this.hero.tals[1]
|
||||
// tal.getChildByName("slv3").getChildByName("val").getComponent(Label).string = this.hero.tals[2]
|
||||
// tal.getChildByName("slv4").getChildByName("val").getComponent(Label).string = this.hero.tals[3]
|
||||
// tal.getChildByName("slv5").getChildByName("val").getComponent(Label).string = this.hero.tals[4]
|
||||
this.update_data()
|
||||
}
|
||||
update_data(){
|
||||
@@ -87,6 +96,7 @@ export class HeroHomeComp extends CCComp {
|
||||
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("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/((LvUp[0]+this.hero.lvexp)*this.role.lv)
|
||||
|
||||
// slvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.SlvUp*(this.role.slv+1)).toString()
|
||||
slvup.getChildByName("cost").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv)).toString()
|
||||
@@ -175,11 +185,11 @@ export class HeroHomeComp extends CCComp {
|
||||
}
|
||||
slv_up(){
|
||||
if(this.role.slv>=5){
|
||||
oops.gui.toast("已经满星,升星失败");
|
||||
oops.gui.toast("已经满星,升阶失败");
|
||||
return
|
||||
}
|
||||
if(smc.heros[this.h_uuid].num < ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))){
|
||||
oops.gui.toast("资源不足,升星失败");
|
||||
oops.gui.toast("资源不足,升阶失败");
|
||||
return
|
||||
}
|
||||
smc.heros[this.h_uuid].num -= SlvUp[this.role.slv]*(1+this.role.slv)
|
||||
|
||||
@@ -49,7 +49,7 @@ export class ItemInfoComp extends CCComp {
|
||||
if(args.type==1){ //技能碎片
|
||||
this.node.getChildByName("skill").active = true;
|
||||
this.node.getChildByName("name").getComponent(Label).string=SkillSet[args.uuid].name+" 碎片"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+SkillSet[args.uuid].name+"」碎片,用于技能升星"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+SkillSet[args.uuid].name+"」碎片,用于技能升阶"
|
||||
var icon_path = "game/skills/skill_icon"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("skill").getChildByName("skill").getChildByName("icon").getComponent(Sprite);
|
||||
@@ -62,7 +62,7 @@ export class ItemInfoComp extends CCComp {
|
||||
if(args.type==2){ //英雄碎片
|
||||
this.node.getChildByName("hero").active = true
|
||||
this.node.getChildByName("name").getComponent(Label).string=HeroInfo[args.uuid].name+" 碎片"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+HeroInfo[args.uuid].name+"」碎片,用于英雄升星"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+HeroInfo[args.uuid].name+"」碎片,用于英雄升阶"
|
||||
var icon_path = "game/heros/herois"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("hero").getChildByName("hero").getChildByName("icon").getComponent(Sprite);
|
||||
|
||||
Reference in New Issue
Block a user