59 lines
1.5 KiB
JavaScript
59 lines
1.5 KiB
JavaScript
|
|
const CampfightMod = require("campfight.mod");
|
||
|
|
const BridgeWindow = require( "bridge.window" );
|
||
|
|
cc.Class({
|
||
|
|
extends: BridgeWindow,
|
||
|
|
|
||
|
|
properties: {
|
||
|
|
item:{
|
||
|
|
default:null,
|
||
|
|
type:cc.Node
|
||
|
|
},
|
||
|
|
txtNd:{
|
||
|
|
default:null,
|
||
|
|
type:cc.Node
|
||
|
|
},
|
||
|
|
headTag:{
|
||
|
|
default:null,
|
||
|
|
type:cc.Node
|
||
|
|
},
|
||
|
|
fabHead:{
|
||
|
|
default:null,
|
||
|
|
type:cc.Prefab
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
// LIFE-CYCLE CALLBACKS:
|
||
|
|
|
||
|
|
onLoad () {
|
||
|
|
this.mod = CampfightMod.getInstance();
|
||
|
|
},
|
||
|
|
|
||
|
|
onOpenConfigs(params) {
|
||
|
|
let data = params.data;
|
||
|
|
if(data){
|
||
|
|
if(!this.rankHead){
|
||
|
|
this.rankHead = cc.instantiate(this.fabHead);
|
||
|
|
this.rankHead.parent = this.headTag;
|
||
|
|
}
|
||
|
|
|
||
|
|
let cmp = nx.gui.getComponent(this.rankHead,"","cmp.common.header");
|
||
|
|
if(cmp){
|
||
|
|
cmp.setData( data );
|
||
|
|
}
|
||
|
|
|
||
|
|
nx.gui.setActive(this.txtNd,String(data.rank),true);
|
||
|
|
nx.gui.setActive(this.item,String(data.rank),true);
|
||
|
|
nx.gui.setString(this.item,"name",data.name);
|
||
|
|
nx.gui.setString(this.item,"vip/txt",data.vip);
|
||
|
|
let honor_cfg = game.configs.honor_data.data_title[data.honor];
|
||
|
|
if(honor_cfg && honor_cfg.res_id){
|
||
|
|
nx.gui.setSpriteFrame(this.item,"honor",cc.js.formatStr("resDB/honors/%s",honor_cfg.res_id));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
onPreClosed() {
|
||
|
|
|
||
|
|
},
|
||
|
|
});
|