45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'bd95acxa09P6JK00omCgRaf', 'cmp.adventure.item.hero');
|
|
// Scripts/mod/pve/adventure/cmp/cmp.adventure.item.hero.js
|
|
|
|
"use strict";
|
|
|
|
var ItemBase = require("nx.fx.sv.expand.item");
|
|
cc.Class({
|
|
"extends": ItemBase,
|
|
properties: {
|
|
show: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
camp: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
focus: {
|
|
"default": null,
|
|
type: cc.Node
|
|
}
|
|
},
|
|
rebind: function rebind(_idx, _data, _key) {
|
|
this._super(_idx, _data, _key);
|
|
this.setData(_data);
|
|
},
|
|
start: function start() {},
|
|
setData: function setData(data) {
|
|
if (nx.dt.objEmpty(data)) return;
|
|
var res_path = cc.js.formatStr("resDB/models/%s/half_show2", data.bustid);
|
|
nx.gui.setSpriteFrame(this.show, "", res_path);
|
|
nx.gui.setSpriteFrame(this.camp, "", cc.js.formatStr("coms/images/camps%s", data.camp_type));
|
|
},
|
|
onFocus: function onFocus() {
|
|
this.focus.active = true;
|
|
this.node.runAction(cc.moveBy(0.1, cc.v2(0, 25)));
|
|
},
|
|
outFocus: function outFocus() {
|
|
this.focus.active = false;
|
|
this.node.y = 0;
|
|
} // update (dt) {},
|
|
});
|
|
|
|
cc._RF.pop(); |