This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-01-19 02:42:37 +08:00
parent bc2ddf1fcd
commit ed4e094536
36 changed files with 3752 additions and 123 deletions

View File

@@ -5,6 +5,8 @@ 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')
@@ -14,8 +16,14 @@ 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();
}
@@ -29,8 +37,17 @@ export class DungeonShowItem extends JNScrollViewItem<TB.TbGSysDungeon> {
//点击副本
onClickDungeon(){
GBattleModeManager.getIns().Open(BattleMode[`${this.data.type}`],true,TD[`${this.data.tigs}`].getDataList()[0].data);
app.layer.Close(GUI.DungeonView);
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:"没有钥匙了.."});
}
}