50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '3f3a2k0mrVLo6jdKLve3LlY', 'cmp.planesafk.wnd.buff');
|
|
// Scripts/mod/pve/planesafk/cmp/cmp.planesafk.wnd.buff.js
|
|
|
|
"use strict";
|
|
|
|
var BridgeWindow = require("bridge.window");
|
|
var ItemLay = require("cmp.common.itemlayout");
|
|
var PlanesafkController = require("planesafk_controller");
|
|
cc.Class({
|
|
"extends": BridgeWindow,
|
|
properties: {
|
|
list: {
|
|
"default": null,
|
|
type: ItemLay
|
|
}
|
|
},
|
|
// LIFE-CYCLE CALLBACKS:
|
|
onLoad: function onLoad() {
|
|
this.ctrl = PlanesafkController.getInstance();
|
|
this.model = this.ctrl.getModel();
|
|
},
|
|
start: function start() {},
|
|
onOpenConfigs: function onOpenConfigs(param) {
|
|
this.data = param.data;
|
|
this.setData(param.buff_list);
|
|
},
|
|
onPreClosed: function onPreClosed() {
|
|
this.list.rebuild([]);
|
|
},
|
|
setData: function setData(buff_list) {
|
|
if (!buff_list) return;
|
|
var data_list = [];
|
|
for (var i in buff_list) {
|
|
var buff_id = buff_list[i];
|
|
var buff_cfg = game.configs.planes_data.data_buff[buff_id];
|
|
var cfg = buff_cfg;
|
|
if (cfg) {
|
|
cfg.line = this.data.line;
|
|
cfg.index = this.data.index;
|
|
data_list.push(cfg);
|
|
}
|
|
}
|
|
this.list.rebuild(data_list);
|
|
}
|
|
|
|
// update (dt) {},
|
|
});
|
|
|
|
cc._RF.pop(); |