Files
fc/dev/project/assets/Scripts/mod/partner/cmps/artifact/cmp.partner.holy.preview.js
T

84 lines
1.9 KiB
JavaScript
Raw Normal View History

2026-05-23 22:10:14 +08:00
/******************************************************************
*
* 战斗义肢预览
*
******************************************************************/
const BridgeWindow = require( "bridge.window" );
const FxTogs = require( "nx.fx.togs" );
const HeroController = require( "hero_controller" );
const FxSVC = require( "nx.fx.sv.expand" );
cc.Class( {
extends: BridgeWindow,
properties: {
holyList : {
default: null,
type : FxSVC,
displayName: "战斗义肢列表",
},
nodMenus : {
default: null,
type: FxTogs,
displayName: "菜单",
},
},
onLoad: function() {
this.nodMenus.posTog = this.onTogMenu.bind( this );
},
// 重载:参数打开
onOpenConfigs: function( _params ) {
this.titles = _params.titles;
nx.gui.gocChildren( this.nodMenus,"", this.titles.length );
for (let i = 0; i < this.nodMenus.node.children.length; i++) {
let node = this.nodMenus.node.children[i];
nx.gui.setString( node, "off/txt",this.titles[i].prefix );
nx.gui.setString( node, "on/txt",this.titles[i].prefix );
}
let cmp = this.nodMenus.getComponent( FxTogs );
cmp.rebuildTogs();
cmp._freshTogShow();
this.nodMenus.togTo( 0 );
this.activeMenu( 1 );
},
// 重载:关闭前
onPreClosed: function() {
this.holyList.rebuild( [] );
},
// 商城切换
onTogMenu: function( _index ) {
this.activeMenu( parseInt( _index ) + 1 );
},
// 激活菜单
activeMenu: function( _bagCode ) {
let HC = HeroController.getInstance();
let model = HC.getModel();
let lst = [];
if( model ){
lst = model.getHolyPreviewInfo( _bagCode );
}
this.holyList.rebuild( lst );
},
} );