Files
fc/dev/project/assets/Scripts/mod/home/bedroom/cmp.bedroom.help.wnd.js
T

63 lines
1.8 KiB
JavaScript
Raw Normal View History

2026-05-23 22:10:14 +08:00
/******************************************************************
*
* 闺蜜升级加成说明
*
******************************************************************/
const BridgeWindow = require( "bridge.window" );
cc.Class( {
extends: BridgeWindow,
properties: {
nodContent: { default: null, type: cc.Node },
nodList: { default: null, type: cc.Node },
},
// 显示
onEnable: function() {
// 判空
const LEN = game.configs.favor_data.data_intimacy_lev_length;
if( !nx.dt.numPositive( LEN, false ) ) {
nx.gui.setActive( this.nodContent, "empty", true );
nx.gui.setActive( this.nodContent, "scv", false );
return;
}
nx.gui.setActive( this.nodContent, "empty", false );
nx.gui.setActive( this.nodContent, "scv", true );
const DATA = game.configs.favor_data.data_intimacy_lev;
let chds = this.nodList.children;
nx.gui.gocChildren( this.nodList, "", LEN-1, chds[0] );
for( let i = 0; i < LEN-1; ++i ) {
let cfgs = DATA[i+1];
if( nx.dt.objEmpty( cfgs ) ) {
continue;
}
// 等级
let item = chds[i];
nx.gui.setString( item, "level", nx.text.format( "LvNumber", cfgs.lev ) );
// 加成
for( let k in cfgs.attr ) {
let atr = cfgs.attr[k];
nx.gui.setString( item, atr[0], "+" + atr[1] );
}
// 解锁内容
let path = cc.path.join( "prefab/home/bedroom/ui", "type" + cfgs.type );
nx.gui.setSpriteFrame( item, "flag/icon", path );
nx.gui.setString( item, "flag/txt", nx.text.getKey( "BRContentType" + cfgs.type ) );
}
},
} );