79 lines
1.9 KiB
JavaScript
79 lines
1.9 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, 'd03dbWpbCFJMYWO9tccxL3t', 'cmp.pvp.worship.item');
|
||
|
|
// Scripts/mod/pvp/cmp/cmp.pvp.worship.item.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
var SVCItem = require("nx.fx.sv.expand.item");
|
||
|
|
var NxSpine = require("nx.fx.spine");
|
||
|
|
var RoleController = require("role_controller");
|
||
|
|
cc.Class({
|
||
|
|
"extends": SVCItem,
|
||
|
|
properties: {
|
||
|
|
nodRole: {
|
||
|
|
"default": null,
|
||
|
|
type: NxSpine
|
||
|
|
},
|
||
|
|
nodWorship: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
nodName: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
nodLook: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// 数据重置
|
||
|
|
rebind: function rebind(_idx, _data, _key) {
|
||
|
|
this._super(_idx, _data, _key);
|
||
|
|
// 刷新
|
||
|
|
this.setData(_data);
|
||
|
|
},
|
||
|
|
setData: function setData(_data) {
|
||
|
|
this.mdata = _data;
|
||
|
|
this.freshInfo();
|
||
|
|
},
|
||
|
|
freshInfo: function freshInfo() {
|
||
|
|
var _this = this;
|
||
|
|
if (!this.mdata) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
nx.gui.setString(this.nodName, "", this.mdata.name);
|
||
|
|
nx.gui.setString(this.nodWorship, "", this.mdata.worship);
|
||
|
|
var ufg = game.configs.looks_data.data_data[this.mdata.lookid];
|
||
|
|
var model = "";
|
||
|
|
if (ufg) {
|
||
|
|
model = PathTool.getSpinePath(ufg.model, ufg.model, false);
|
||
|
|
}
|
||
|
|
if (this.nodRole) {
|
||
|
|
// 战斗迷你
|
||
|
|
this.nodRole.load(model, function (_e) {
|
||
|
|
if (!_e) {
|
||
|
|
_this.nodRole.action("stand2", true);
|
||
|
|
} else {
|
||
|
|
_this.nodRole.stop();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
var btn = nx.gui.getComponent(this.nodWorship, "", cc.Button);
|
||
|
|
if (btn) {
|
||
|
|
btn.interactable = this.mdata.worship_status == 0;
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onTouchWorship: function onTouchWorship() {
|
||
|
|
if (this.mdata.worship_status > 0) {
|
||
|
|
nx.tbox(nx.text.getKey("lab_arena_loop_rank_worshiped"));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
var RC = RoleController.getInstance();
|
||
|
|
if (RC) {
|
||
|
|
RC.sender10316(this.mdata.rid, this.mdata.srv_id, this.mdata.rank);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|