diff --git a/assets/res/prefabs/NUI/heroShop.prefab b/assets/res/prefabs/NUI/heroShop.prefab index 29fe6d1a..56ff0d3e 100644 --- a/assets/res/prefabs/NUI/heroShop.prefab +++ b/assets/res/prefabs/NUI/heroShop.prefab @@ -192,6 +192,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -424,6 +427,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -463,6 +469,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -564,6 +573,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -875,6 +887,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -1004,7 +1019,7 @@ "_position": { "__type__": "cc.Vec3", "x": -80, - "y": -50, + "y": -85, "z": 0 }, "_scale": { @@ -1068,6 +1083,23 @@ "a": 255 }, "_width": 0.5, + "_color2": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_width2": 0, + "_isUnderline": false, + "_UnderlineColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_UnderlineWidth": 0, "_id": "" }, { @@ -1316,6 +1348,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -1417,6 +1452,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -1518,6 +1556,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -1619,6 +1660,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -1720,6 +1764,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -2268,6 +2315,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -2307,6 +2357,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -2552,6 +2605,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -2885,6 +2941,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -2941,6 +3000,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -3180,6 +3242,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -3317,6 +3382,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -3373,6 +3441,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -3698,6 +3769,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -3799,6 +3873,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -4002,6 +4079,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -4207,6 +4287,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -4478,6 +4561,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { @@ -4517,6 +4603,9 @@ "_isTrimmedMode": true, "_state": 0, "_atlas": null, + "_tilecount": 1, + "_tileoffx": 0, + "_tileoffy": 0, "_id": "" }, { diff --git a/assets/scripts/UI/Academy/Academy_block.ts b/assets/scripts/UI/Academy/Academy_block.ts index d5161c1a..a908187f 100644 --- a/assets/scripts/UI/Academy/Academy_block.ts +++ b/assets/scripts/UI/Academy/Academy_block.ts @@ -73,6 +73,11 @@ export default class Academy_block extends cc.Component { this.leftTime ); this.leftTime -= 1; + } else { + var node = cc + .find('Canvas') + .getComponentInChildren(UIUpdateHero).node; + node.emit('refreshUI'); } }, 1); diff --git a/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts b/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts index 8adf3933..8963e06c 100644 --- a/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts +++ b/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts @@ -3,6 +3,7 @@ import { UIBase } from '../UIBase'; import { uimanger } from '../UIManger'; import { UIUpdateHero } from './UIUpdateHero'; import { UpdateChoose } from './updatechoose'; +var gameConfig = require('gameConfig'); const { ccclass, property } = cc._decorator; @@ -58,6 +59,19 @@ export class ChooseHeroUpQuality extends UIBase { this.finalHero.getComponent('herochoseone').initdata(data.heroInfo); this.mainHero.active = true; this.mainHeroData = data.heroInfo.hero_uniid; + + let cfg = + gameConfig.heroQuality[ + `${parseInt(data.heroInfo.quality) + 1}` + ]; + + this.costLabel.string = cfg.gold; + this.timeLabel.string = cfg.time; + this.rateLabel.string = cfg.success_rate + '%'; + + this.oldHp.string = data.heroInfo.hp; + this.oldAtk.string = data.heroInfo.atk; + this.oldDef.string = data.heroInfo.def; } else if (data.index == 1) { this.secHeroChoose.active = false; this.secHero.getComponent('herochoseone').initdata(data.heroInfo); diff --git a/assets/scripts/UI/Academy/ChooseHeroUpdate.ts b/assets/scripts/UI/Academy/ChooseHeroUpdate.ts index a5d6e472..f892f814 100644 --- a/assets/scripts/UI/Academy/ChooseHeroUpdate.ts +++ b/assets/scripts/UI/Academy/ChooseHeroUpdate.ts @@ -2,6 +2,7 @@ import { UIBase } from '../UIBase'; import { uimanger } from '../UIManger'; import { UIUpdateHero } from './UIUpdateHero'; import { UpdateChoose } from './updatechoose'; +var gameConfig = require('gameConfig'); const NetManage = require('../../manages/NetManage'); const { ccclass, property } = cc._decorator; @@ -21,12 +22,16 @@ export class ChooseHeroUpdate extends UIBase { private boxIndex = 0; init(data: any) { - this.boxIndex = data.boxIndex; } onLoad(): void { cc.Notifier.on('academyCHOOSE', this, this.hasGetOne.bind(this)); + //reset + this.currentLv.string = 'Lv.'; + this.nextlv.string = 'Lv.'; + this.costLabel.string = '0'; + this.timeLabel.string = '00:00:00'; } onDestroy(): void { @@ -38,6 +43,15 @@ export class ChooseHeroUpdate extends UIBase { this.heroNode.getComponent('herochoseone').initdata(data.heroInfo); this.heroNode.active = true; this.hero_uuid = data.heroInfo.hero_uniid; + + this.currentLv.string = `Lv.${data.heroInfo.hero_lv}`; + this.nextlv.string = `Lv.${parseInt(data.heroInfo.hero_lv) + 1}`; + + let cfg = + gameConfig.heroLevel[`${parseInt(data.heroInfo.hero_lv) + 1}`]; + + this.costLabel.string = cfg.gold; + this.timeLabel.string = cfg.time; } onClickChooseHero() { diff --git a/assets/scripts/UI/Academy/updatechoose.ts b/assets/scripts/UI/Academy/updatechoose.ts index 8a3e23b1..1bf1eb46 100644 --- a/assets/scripts/UI/Academy/updatechoose.ts +++ b/assets/scripts/UI/Academy/updatechoose.ts @@ -20,6 +20,19 @@ export class UpdateChoose extends UIBase { const node = cc.instantiate(this.pb_hero); var sc = node.getComponent('herochoseone'); sc.initdata(element); + + console.log(element.quality); + + // + if ( + this.qualityIndex && + this.qualityIndex == 1 && + element.quality > 1 + ) { + node.getComponent('wantedHero').showCover(); + } + // + node.on('click', () => { this.nd_heroContent.children.forEach((element) => { element.scale = 1; diff --git a/assets/scripts/tips/UpFail.ts b/assets/scripts/tips/UpFail.ts index f10ff3a9..f50097be 100644 --- a/assets/scripts/tips/UpFail.ts +++ b/assets/scripts/tips/UpFail.ts @@ -18,6 +18,12 @@ export class UpFail extends UIBase { init(data: any) { console.log(JSON.stringify(data)); this.beforeNode.getComponent('herochoseone').initdata(); + + this.lb_hp.string = data.old_hero.hp; + this.lb_atk.string = data.old_hero.atk; + this.lb_def.string = data.old_hero.def; + this.lb_lucky.string = data.old_hero.lucky; + this.lb_adv.string = data.old_hero.advanced_count; } onClose() { diff --git a/assets/scripts/tips/UpSuccess.ts b/assets/scripts/tips/UpSuccess.ts index 366cab26..f801eb54 100644 --- a/assets/scripts/tips/UpSuccess.ts +++ b/assets/scripts/tips/UpSuccess.ts @@ -21,9 +21,20 @@ export class UpSuccess extends UIBase { @property(cc.Label) lb_advaf: cc.Label = null; init(data: any) { - console.log(JSON.stringify(data)); this.beforeNode.getComponent('herochoseone').initdata(data.old_hero); this.lb_lv.string = data.new_hero.hero_lv; + + this.lb_hp.string = data.old_hero.hp; + this.lb_atk.string = data.old_hero.atk; + this.lb_def.string = data.old_hero.def; + this.lb_lucky.string = data.old_hero.lucky; + this.lb_adv.string = data.old_hero.advanced_count; + + this.lb_hpaf.string = data.new_hero.hp; + this.lb_atkaf.string = data.new_hero.atk; + this.lb_defaf.string = data.new_hero.def; + this.lb_luckyaf.string = data.new_hero.lucky; + this.lb_advaf.string = data.new_hero.advanced_count; } onClose() {