51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '41418U6JUFCg6t1WLKEdgTs', 'cmp.adventure.item.endless');
|
||
|
|
// Scripts/mod/pve/adventure/cmp/cmp.adventure.item.endless.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
var ItemBase = require("nx.fx.sv.expand.item");
|
||
|
|
var ItemLay = require("cmp.common.itemlayout");
|
||
|
|
var ADVCT = require("adventure_controller");
|
||
|
|
cc.Class({
|
||
|
|
"extends": ItemBase,
|
||
|
|
properties: {
|
||
|
|
confirm: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
got: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
items: {
|
||
|
|
"default": null,
|
||
|
|
type: ItemLay
|
||
|
|
},
|
||
|
|
score: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Label
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// LIFE-CYCLE CALLBACKS:
|
||
|
|
rebind: function rebind(_index, _data, _key) {
|
||
|
|
this._super(_index, _data, _key);
|
||
|
|
this.setData(_data);
|
||
|
|
},
|
||
|
|
start: function start() {},
|
||
|
|
setData: function setData(data) {
|
||
|
|
if (nx.dt.objEmpty(data)) return;
|
||
|
|
this.data = data.data;
|
||
|
|
this.confirm.active = this.mdata.status == 1;
|
||
|
|
this.got.active = this.mdata.status == 2;
|
||
|
|
this.score.string = String(this.data.count);
|
||
|
|
this.items.rebuild(this.data.items);
|
||
|
|
},
|
||
|
|
onClickAward: function onClickAward() {
|
||
|
|
if (this.mdata.status == 1) {
|
||
|
|
ADVCT.getInstance().send29535(this.data.id);
|
||
|
|
}
|
||
|
|
} // update (dt) {},
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|