Files

55 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2026-05-24 10:21:26 +08:00
"use strict";
cc._RF.push(module, '0bed7ChdFhOSqkTIeKD0xFH', 'cmp.adventure.endlessaward');
// Scripts/mod/pve/adventure/cmp/cmp.adventure.endlessaward.js
"use strict";
var BridgeWindow = require("bridge.window");
var ADVCT = require("adventure_controller");
var NxExpand = require("nx.fx.sv.expand");
var ADEVT = require("adventure_event");
cc.Class({
"extends": BridgeWindow,
properties: {
list: {
"default": null,
type: NxExpand
}
},
// LIFE-CYCLE CALLBACKS:
onLoad: function onLoad() {
this.ctrl = ADVCT.getInstance();
this.data_list = [];
this.bindGEvent(ADEVT.Update_Awards, this.udpateAwards.bind(this));
},
start: function start() {},
udpateAwards: function udpateAwards(list) {
for (var i = 0; i < this.data_list.length; i++) {
var cfg = this.data_list[i];
for (var j in list) {
if (cfg.data.id == list[j].id) {
cfg.status = list[j].status;
}
}
}
this.list.rebuild(this.data_list);
},
onOpenConfigs: function onOpenConfigs() {
this.initConfig();
this.ctrl.send29534(1);
},
onPreClosed: function onPreClosed() {
this.list.rebuild([]);
},
initConfig: function initConfig() {
var round_list = game.configs.adventure_endless_data.data_round_reward_list;
for (var i in round_list) {
var obj = {};
obj.data = round_list[i];
obj.status = 0; //未開始
this.data_list.push(obj);
}
} // update (dt) {},
});
cc._RF.pop();