提交升级

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-28 02:13:05 +08:00
parent 62959f80e4
commit 07db3912cc
46 changed files with 2482 additions and 961 deletions

View File

@@ -6,11 +6,12 @@ import JNScrollView from '../../../../extensions/ngame/assets/ngame/util/compone
import { NodeEventType } from 'cc';
import { sp } from 'cc';
import { app } from '../../App';
import { PlayerPetOV } from '../../consts/API';
import { API, PlayerPetOV } from '../../consts/API';
import { UIPetAnim } from '../../consts/GData';
import { GUI } from '../UIConfig';
import PlayerTacticalData from '../../data/PlayerTacticalData';
import { PetIconSelectScroll } from '../Consts/Pet/PetIconSelectScroll';
import { PetPreviewWindow } from '../Consts/Pet/info/PetPreviewWindow';
const { ccclass, property } = _decorator;
//上阵页面
@@ -21,8 +22,8 @@ export class IntoBattleView extends JNLayerBase {
@property(JNScrollView)
views:JNScrollView; //宠物列表
@property(sp.Skeleton)
spine:sp.Skeleton; //当前选中的宠物
@property(PetPreviewWindow)
petPreview:PetPreviewWindow; //宠物显示窗口
//宠物数据
pets:PlayerPetOV[] = [];
@@ -79,8 +80,7 @@ export class IntoBattleView extends JNLayerBase {
current.select.isSelect = true;
//显示选中宠物
this.spine.skeletonData = app.battleRes.roleSpine[this.pets[this.index].petTbId];
this.spine.setAnimation(0,UIPetAnim.std,true);
this.petPreview.bind(this.pets[this.index]);
}
}
@@ -126,6 +126,17 @@ export class IntoBattleView extends JNLayerBase {
}
//点击升级
async onClickUpLevel(){
if(this.index < 0){
app.layer.Open(GUI.Tips,{text:"请选择宠物."})
return;
}
if(await API.PetUpLevel(this.pets[this.index].petId))
app.layer.Open(GUI.Tips,{text:"升级成功!"})
}
}