48 lines
1.6 KiB
JavaScript
48 lines
1.6 KiB
JavaScript
const Header = require( "cmp.common.header" );
|
|
const RoleController = require( "role_controller" );
|
|
|
|
cc.Class({
|
|
extends: Header,
|
|
|
|
properties: {
|
|
|
|
nodInfo : { type: cc.Node, default: null },
|
|
},
|
|
|
|
|
|
setInfo: function( info, _step ){
|
|
|
|
let 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( _info ){
|
|
|
|
if( !_info ){
|
|
return;
|
|
}
|
|
let 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 );
|
|
|
|
}
|
|
|
|
});
|