Files
fc/dev/project/assets/Scripts/mod/pray/cmp/cmp.holy.pray.rate.js
T

62 lines
1.6 KiB
JavaScript
Raw Normal View History

2026-05-23 22:10:14 +08:00
const BridgeWindow = require( "bridge.window" );
cc.Class({
extends: BridgeWindow,
properties: {
nodRate: { default: null, type: cc.Node },
nodNowLevel: { default: null, type: cc.Node },
nodNextLevel: { default: null, type: cc.Node },
},
// 重载:参数打开
onOpenConfigs: function( _params ) {
this.freshInfo( _params );
},
freshInfo: function( _params ){
this.lev = _params.lev;
this.group_id = _params.group_id;
let cfg = game.configs.holy_eqm_lottery_data.data_pro_show[this.lev];
let nfg = game.configs.holy_eqm_lottery_data.data_pro_show[this.lev + 1];
let rates = [];
for (let i in cfg ) {
let rate = cfg[i];
rates.push( rate );
}
let nrates = [];
for (let i in nfg ) {
let rate = nfg[i];
nrates.push( rate );
}
nx.gui.gocChildren( this.nodRate,"", rates.length );
let chd = this.nodRate.children;
for (let i = 0; i < chd.length; i++) {
let nod = chd[i];
let rate = rates[i];
if( rate ){
nx.gui.setString( nod, "name", rate.name );
nx.gui.setString( nod, "rate", rate.pro + "%" );
nx.gui.setString( nod, "next", nrates[i].pro + "%" );
}
}
nx.gui.setString( this.nodNowLevel, "", nx.text.format( "StatueNowLv", this.lev ) );
nx.gui.setString( this.nodNextLevel, "", nx.text.format( "NextLevel", ( this.lev + 1 ) ) );
},
});