46 lines
1.6 KiB
JavaScript
46 lines
1.6 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '862e6PnHLxBHb4J9TjwsG89', 'cmp.cchampion.match.item');
|
|
// Scripts/mod/pvp/crosschampion/cmp/cmp.cchampion.match.item.js
|
|
|
|
"use strict";
|
|
|
|
var Header = require("cmp.common.header");
|
|
var RoleController = require("role_controller");
|
|
cc.Class({
|
|
"extends": Header,
|
|
properties: {
|
|
nodInfo: {
|
|
type: cc.Node,
|
|
"default": null
|
|
}
|
|
},
|
|
setInfo: function setInfo(info, _step) {
|
|
var role = RoleController.getInstance().getRoleVo();
|
|
nx.gui.setString(this.nodInfo, "info/txt", info.name);
|
|
nx.gui.setActive(this.nodInfo, "ico/mine", role.srv_id == info.srv_id && role.rid == info.rid);
|
|
nx.gui.setActive(this.nodInfo, "ico/win", info.ret == 1);
|
|
nx.gui.setActive(this.nodInfo, "ico/lose", info.ret == 2);
|
|
nx.gui.setString(this.nodInfo, "info/txt", info.name);
|
|
if (!_step) {
|
|
nx.gui.setActive(this.nodInfo, "info/icoe", info.ret == 0);
|
|
nx.gui.setActive(this.nodInfo, "info/ico", false);
|
|
} else {
|
|
nx.gui.setActive(this.nodInfo, "info/ico", info.ret == 0);
|
|
nx.gui.setActive(this.nodInfo, "info/icoe", false);
|
|
}
|
|
},
|
|
setEmpty: function setEmpty(_info) {
|
|
if (!_info) {
|
|
return;
|
|
}
|
|
var info = _info;
|
|
nx.gui.setSpriteFrame(this.nodInfo, "bg/icon", PathTool.BadAvatar);
|
|
nx.gui.setSpriteFrame(this.nodInfo, "bg/frame", PathTool.BadAvatarFrame);
|
|
nx.gui.setString(this.nodInfo, "info/txt", nx.text.format("Match64Desc", info.name));
|
|
nx.gui.setActive(this.nodInfo, "ico/mine", false);
|
|
nx.gui.setActive(this.nodInfo, "ico/win", false);
|
|
nx.gui.setActive(this.nodInfo, "ico/lose", false);
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |