mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
简单的升星
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { PlayerPetOV } from '../../consts/API';
|
||||
import JNScrollViewItem from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { PetIconSelect } from '../Consts/Pet/PetIconSelect';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('IntoBattlePetIcon')
|
||||
export class IntoBattlePetIcon extends JNScrollViewItem<PlayerPetOV> {
|
||||
|
||||
@property(PetIconSelect)
|
||||
select:PetIconSelect;
|
||||
|
||||
protected start(): void {
|
||||
this.select.setIcon(this.data.petTbId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "0d7f0c4b-80b2-49fb-baab-f4c7131b9dda",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -10,7 +10,7 @@ import { PlayerPetOV } from '../../consts/API';
|
||||
import { UIPetAnim } from '../../consts/GData';
|
||||
import { GUI } from '../UIConfig';
|
||||
import PlayerTacticalData from '../../data/PlayerTacticalData';
|
||||
import { IntoBattlePetIcon } from './IntoBattlePetIcon';
|
||||
import { PetIconSelectScroll } from '../Consts/Pet/PetIconSelectScroll';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//上阵页面
|
||||
@@ -53,7 +53,7 @@ export class IntoBattleView extends JNLayerBase {
|
||||
this.views.refreshData(this.pets);
|
||||
|
||||
//设置不可选中
|
||||
this.views.getItems<IntoBattlePetIcon>().forEach(item => {
|
||||
this.views.getItems<PetIconSelectScroll>().forEach(item => {
|
||||
if(PlayerTacticalData.getIns().getTacticalInfo().indexOf(item.data.petId) != -1)
|
||||
item.select.isNoSelect = true; //如果在阵法里则不可选中
|
||||
})
|
||||
@@ -69,13 +69,13 @@ export class IntoBattleView extends JNLayerBase {
|
||||
onUpdateSelect(){
|
||||
|
||||
//默认都不选中
|
||||
this.views.getItems<IntoBattlePetIcon>().forEach(item => {
|
||||
this.views.getItems<PetIconSelectScroll>().forEach(item => {
|
||||
item.select.isSelect = false;
|
||||
})
|
||||
|
||||
//设置选中
|
||||
if(this.index != -1){
|
||||
let current = this.views.getItems<IntoBattlePetIcon>()[this.index]
|
||||
let current = this.views.getItems<PetIconSelectScroll>()[this.index]
|
||||
current.select.isSelect = true;
|
||||
|
||||
//显示选中宠物
|
||||
@@ -87,12 +87,6 @@ export class IntoBattleView extends JNLayerBase {
|
||||
|
||||
//点击Item
|
||||
onClickItem(index:number){
|
||||
|
||||
//判断是否不可选中
|
||||
if(this.views.getItems<IntoBattlePetIcon>()[index].select.isNoSelect) {
|
||||
app.layer.Open(GUI.Tips,{text:"当前宠物已上阵"})
|
||||
return;
|
||||
}
|
||||
|
||||
//设置当前选中
|
||||
this.index = index;
|
||||
@@ -108,6 +102,10 @@ export class IntoBattleView extends JNLayerBase {
|
||||
app.layer.Open(GUI.Tips,{text:"请选择要上阵的宠物."})
|
||||
return;
|
||||
}
|
||||
if(this.views.getItems<PetIconSelectScroll>()[this.index].select.isNoSelect) {
|
||||
app.layer.Open(GUI.Tips,{text:"当前宠物已上阵"})
|
||||
return;
|
||||
}
|
||||
|
||||
//修改上阵信息
|
||||
await PlayerTacticalData.getIns().UpdateIndexTactical(this.tIndex,this.pets[this.index].petId);
|
||||
@@ -117,6 +115,17 @@ export class IntoBattleView extends JNLayerBase {
|
||||
|
||||
}
|
||||
|
||||
//点击升星页面
|
||||
async onClickUpStar(){
|
||||
|
||||
if(this.index < 0){
|
||||
app.layer.Open(GUI.Tips,{text:"请选择宠物."})
|
||||
return;
|
||||
}
|
||||
app.layer.Open(GUI.PetUpStarView,this.pets[this.index]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user