/****************************************************************** * * 召唤主界面 * ******************************************************************/ const MenuWnd = require( "cmp.com.menu.wnd" ); const BackPackController = require( "backpack_controller" ); const FID = require( "bridge.function.ids" ); // 标签页对应关系 const Actives = { def: { rule: false, score: false }, // 空缺 base: { rule: true, score: true }, // 基础召唤 adv: { rule: true, score: true }, // 高级召唤 friend: { rule: true, score: true }, // 友情召唤 step: { rule: false, score: false }, // StepUP召唤 elite: { rule: false, score: false }, // 精英召唤 crystal: { rule: false, score: false }, // 水晶召唤 infinite: { rule: false, score: false }, // 无限十连召唤 }; cc.Class( { extends: MenuWnd, properties: { nodScore: { default: null, type: cc.Node }, nodRule: { default: null, type: cc.Node }, }, // 重载:参数打开 onOpenConfigs: function( _params ) { let args = _params || {}; args.page = args.key || "base"; this._super( args ); // 无限十连显隐 this.showInfinite(); }, // 切换菜单 togMenu: function( _key ) { this._super( _key ); let ifo = Actives[ _key ] || Actives[ "def" ]; this.nodScore.active = ifo.score; this.nodRule.active = ifo.rule; }, // 无限十连显隐 showInfinite: function() { const BC = BackPackController.getInstance(); let count = BC.getModel().getBackPackItemNumByBid( 11407 ); let open_cfg = game.configs.source_data.data_source_data[ FID.SummonInfinite ].lev_limit; let ret = nx.bridge.checkConditions( [ open_cfg ] ); nx.gui.setActive( this.menu, "infinite", count > 0 && nx.dt.objEmpty( ret ) ); }, } );