mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
57 lines
1.6 KiB
TypeScript
57 lines
1.6 KiB
TypeScript
import { _decorator, Component, Node } from 'cc';
|
|
import JNScrollViewItem from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
|
import { TB } from '../../config/data/schema';
|
|
import { Label } from 'cc';
|
|
import GBattleModeManager, { BattleMode } from '../../battle/GBattleModeManager';
|
|
import { app, TD } from '../../App';
|
|
import { GUI } from '../UIConfig';
|
|
import { PlayerResourceShow } from '../Consts/Resource/PlayerResourceShow';
|
|
import ResourceData from '../../data/ResourceData';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('DungeonShowItem')
|
|
export class DungeonShowItem extends JNScrollViewItem<TB.TbGSysDungeon> {
|
|
|
|
//副本名称
|
|
@property(Label)
|
|
title:Label;
|
|
|
|
//资源
|
|
@property(PlayerResourceShow)
|
|
resource:PlayerResourceShow;
|
|
|
|
onInit(){
|
|
|
|
this.resource.type = this.data.consume.id;
|
|
this.resource.onUpdateView();
|
|
this.onUpdateView();
|
|
|
|
}
|
|
|
|
onUpdateView(){
|
|
|
|
this.title.string = this.data.name;
|
|
|
|
}
|
|
|
|
//点击副本
|
|
onClickDungeon(){
|
|
|
|
if(ResourceData.getIns().getValue(this.data.consume.id) >= this.data.consume.value){
|
|
//打开副本
|
|
GBattleModeManager.getIns().Open(BattleMode[`${this.data.type}`],true,{
|
|
dungeonId:this.data.id,
|
|
dungeonItemId:TD[`${this.data.tigs}`].getDataList()[0].id,
|
|
data:TD[`${this.data.tigs}`].getDataList()[0].data
|
|
});
|
|
app.layer.Close(GUI.DungeonView);
|
|
}else{
|
|
app.layer.Open(GUI.Tips,{text:"没有钥匙了.."});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|