Files

60 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2026-05-23 22:10:14 +08:00
const BridgeWindow = require( "bridge.window" )
const FxSVC = require( "nx.fx.sv.expand" );
cc.Class( {
extends: BridgeWindow,
properties: {
list: {
default: null,
type: FxSVC
},
ti:{
default:null,
type:cc.Node
}
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
},
onOpenConfigs(params) {
if(!params){
this.delayClose();
return;
}
this.camp_id = params.camp_id;
let cfgs = params.config;
if(!cfgs){
this.delayClose();
return;
}
let info = cfgs.data_info[params.camp_id];
if(info){
if(info.type == 1){
nx.gui.setString(this.ti,"",nx.text.getKey("btn_buff_fight_number"));
}else if(info.type == 2){
nx.gui.setString(this.ti,"",nx.text.getKey("btn_buff_savehp_number"));
}
}
let list = [];
for(let i in params.list){
let ob = {};
ob.info = params.list[i];
ob.cfg = cfgs;
list.push(ob);
}
this.list.svcKey = this.camp_id;
this.list.rebuild(list);
},
onPreClosed() {
this.list.rebuild( [] );
},
// update (dt) {},
} );