提交挂机

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-12-28 02:56:34 +08:00
parent 4d536f1663
commit 6890d80086
12 changed files with 733 additions and 57 deletions

View File

@@ -11,6 +11,8 @@ import { app, TD } from '../../App';
import { GUI } from '../UIConfig';
import { ProgressBar } from 'cc';
import JProgressBar from '../../../../extensions/ngame/assets/ngame/util/components/Progress/JProgressBar';
import { Toggle } from 'cc';
import GOnHookManager from '../../manager/battle/mode/GOnHookManager';
const { ccclass, property } = _decorator;
@ccclass('PetUpStarView')
@@ -30,6 +32,9 @@ export class PetUpStarView extends JNLayerBase {
@property(JProgressBar)
viewPetExpProgress:JProgressBar; //预览宠物经验条
@property(Toggle)
isEngulfToggle:Toggle; //是否主动吞噬 0 星 宠物
data:PlayerPetOV;
onJNLoad(data: PlayerPetOV): void {
@@ -70,6 +75,9 @@ export class PetUpStarView extends JNLayerBase {
this.onUpdateSelect();
//更新吞噬
this.isEngulfToggle.isChecked = GOnHookManager.getIns().onHookEngulfPets.indexOf(this.data) >= 0;
}
//刷新信息
@@ -149,6 +157,7 @@ export class PetUpStarView extends JNLayerBase {
//点击合成
async onClickUp(){
//获取被合成的Id
let pets = this.views.getData<PlayerPetOVSelect>().filter(pet => pet.isSelect).map(pet => pet.petId);
@@ -158,9 +167,16 @@ export class PetUpStarView extends JNLayerBase {
}
await API.PetUpStar(this.data.petId,pets);
app.layer.Open(GUI.Tips,{text:"合成成功"});
}
//点击吞噬选择
onClickEngulfToggle(){
GOnHookManager.getIns().onHookEngulfPets.splice(GOnHookManager.getIns().onHookEngulfPets.indexOf(this.data),1);
if(this.isEngulfToggle.isChecked){
GOnHookManager.getIns().onHookEngulfPets.push(this.data);
}
}
}