Files
fc/dev/project/assets/Scripts/mod/pve/adventure/cmp/cmp.adventure.endlessaward.js
T

63 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-05-23 22:10:14 +08:00
const BridgeWindow = require( "bridge.window" );
const ADVCT = require("adventure_controller");
const NxExpand = require("nx.fx.sv.expand");
const ADEVT = require("adventure_event");
cc.Class({
extends: BridgeWindow,
properties: {
list:{
default:null,
type:NxExpand
}
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
this.ctrl = ADVCT.getInstance();
this.data_list = [];
this.bindGEvent(ADEVT.Update_Awards,this.udpateAwards.bind(this));
},
start () {
},
udpateAwards(list){
for(let i = 0;i < this.data_list.length;i++){
let cfg = this.data_list[i];
for(let j in list){
if(cfg.data.id == list[j].id){
cfg.status = list[j].status;
}
}
}
this.list.rebuild(this.data_list);
},
onOpenConfigs() {
this.initConfig();
this.ctrl.send29534(1);
},
onPreClosed() {
this.list.rebuild([]);
},
initConfig(){
let round_list = game.configs.adventure_endless_data.data_round_reward_list;
for(let i in round_list){
let obj = {};
obj.data = round_list[i];
obj.status = 0;//未開始
this.data_list.push(obj);
}
},
// update (dt) {},
});