mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交挂机
This commit is contained in:
@@ -2,9 +2,12 @@ import { _decorator, Component, Node } from 'cc';
|
||||
import { JNGLayerBase } from '../../../components/JNComponent';
|
||||
import JNScrollView from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
|
||||
import GOnHookData from '../../../data/GOnHookData';
|
||||
import { TD } from '../../../App';
|
||||
import { app, TD } from '../../../App';
|
||||
import { NodeEventType } from 'cc';
|
||||
import { TablePetIconSelectScroll } from '../../Consts/Pet/table/TablePetIconSelectScroll';
|
||||
import { Label } from 'cc';
|
||||
import GOnHookManager from '../../../manager/battle/mode/GOnHookManager';
|
||||
import { GUI } from '../../UIConfig';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MainOnHookView')
|
||||
@@ -13,6 +16,10 @@ export class MainOnHookView extends JNGLayerBase {
|
||||
//野怪列表
|
||||
@property(JNScrollView)
|
||||
views:JNScrollView;
|
||||
|
||||
//挂机按钮
|
||||
@property(Label)
|
||||
onHookLabel:Label;
|
||||
|
||||
onJNLoad(){
|
||||
|
||||
@@ -28,11 +35,12 @@ export class MainOnHookView extends JNGLayerBase {
|
||||
onUpdateView(){
|
||||
|
||||
//显示当前地图可出现的所有宠物
|
||||
|
||||
let mapInfo = TD.TbGOnHookMaps.get(GOnHookData.getIns().info.onHookMap);
|
||||
let pets = mapInfo.petIds.map(petId => TD.TbGRole.get(petId));
|
||||
this.views.refreshData(pets);
|
||||
|
||||
this.onHookLabel.string = (!GOnHookManager.getIns().isOnHook) ? "挂机" : "取消挂机"
|
||||
|
||||
}
|
||||
|
||||
//点击Item
|
||||
@@ -43,6 +51,14 @@ export class MainOnHookView extends JNGLayerBase {
|
||||
|
||||
}
|
||||
|
||||
//点击挂机
|
||||
onClickOnHook(){
|
||||
GOnHookManager.getIns().onHookCatchPets = this.views.getItems<TablePetIconSelectScroll>().filter(item => item.select.isSelect).map(item => item.data)
|
||||
GOnHookManager.getIns().isOnHook = !GOnHookManager.getIns().isOnHook;
|
||||
app.layer.Open(GUI.Tips,{text:`${(GOnHookManager.getIns().isOnHook) ? "挂机" : "取消挂机"} 设置成功`})
|
||||
this.close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user