95 lines
2.4 KiB
JavaScript
95 lines
2.4 KiB
JavaScript
/******************************************************************
|
|
*
|
|
* 伙伴进阶技能解锁展示界面
|
|
*
|
|
******************************************************************/
|
|
|
|
const BridgeWindow = require( "bridge.window" );
|
|
const SkillBase = require( "cmp.skill.base" );
|
|
|
|
cc.Class( {
|
|
|
|
extends: BridgeWindow,
|
|
|
|
properties: {
|
|
|
|
cmpIcon: { default: null, type: SkillBase },
|
|
nodContent: { default: null, type: cc.Node },
|
|
spTitle: { default: null, type: sp.Skeleton },
|
|
},
|
|
|
|
// 重载:参数打开
|
|
onOpenConfigs: function( _params ) {
|
|
|
|
// 获取技能信息
|
|
this.info = gskilldata( 'data_get_skill', _params.sid );
|
|
|
|
// 无效
|
|
if( nx.dt.objEmpty( this.info ) ) {
|
|
this.scheduleOnce( () => {
|
|
this.close();
|
|
}, 0.03 );
|
|
return;
|
|
}
|
|
|
|
// 刷新
|
|
this.fresh();
|
|
|
|
// 动画
|
|
let sp = this.spTitle;
|
|
if( sp ) {
|
|
sp.node.active = false;
|
|
this.scheduleOnce( () => {
|
|
sp.node.active = true;
|
|
}, 1 );
|
|
}
|
|
|
|
},
|
|
|
|
// 刷新
|
|
fresh: function() {
|
|
|
|
// 图标更新
|
|
this.cmpIcon.setData( this.info );
|
|
|
|
// 描述
|
|
let desc = this.info.des || this.info.desc;
|
|
nx.gui.setString( this.nodContent, "desc", desc );
|
|
|
|
// 效果
|
|
let des = this.info.buff_des;
|
|
if( nx.dt.arrEmpty( desc ) || nx.dt.arrEmpty( desc[0] ) ) {
|
|
nx.gui.setActive( this.nodContent, "line", false );
|
|
nx.gui.setActive( this.nodContent, "bufs", false );
|
|
return;
|
|
}
|
|
|
|
let txt = "";
|
|
let arr = des[0];
|
|
for( let i = 0; i < arr.length; ++i ) {
|
|
|
|
let id = arr[i];
|
|
let cfg = game.configs.skill_data.data_get_buff[id];
|
|
if( !cfg ) { continue; }
|
|
|
|
if( i != 0 ) {
|
|
txt += "<br/>";
|
|
}
|
|
|
|
txt += nx.text.format( "SkillBufDesc", cfg.name, cfg.desc );
|
|
}
|
|
|
|
if( nx.dt.strEmpty( txt ) ) {
|
|
nx.gui.setActive( this.nodContent, "line", false );
|
|
nx.gui.setActive( this.nodContent, "bufs", false );
|
|
return;
|
|
}
|
|
|
|
nx.gui.setActive( this.nodContent, "line", true );
|
|
nx.gui.setActive( this.nodContent, "bufs", true );
|
|
nx.gui.setString( this.nodContent, "bufs", txt );
|
|
|
|
},
|
|
|
|
} );
|