Files
fc/dev/project/library/imports/84/8480d38e-93e1-452c-9606-fc70c81e6b8e.js
T
2026-05-24 10:21:26 +08:00

69 lines
1.9 KiB
JavaScript

"use strict";
cc._RF.push(module, '8480dOOk+FFLJYG/HDIHmuO', 'cmp.partner.holy.preview');
// Scripts/mod/partner/cmps/artifact/cmp.partner.holy.preview.js
"use strict";
/******************************************************************
*
* 战斗义肢预览
*
******************************************************************/
var BridgeWindow = require("bridge.window");
var FxTogs = require("nx.fx.togs");
var HeroController = require("hero_controller");
var 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 onLoad() {
this.nodMenus.posTog = this.onTogMenu.bind(this);
},
// 重载:参数打开
onOpenConfigs: function onOpenConfigs(_params) {
this.titles = _params.titles;
nx.gui.gocChildren(this.nodMenus, "", this.titles.length);
for (var i = 0; i < this.nodMenus.node.children.length; i++) {
var 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);
}
var cmp = this.nodMenus.getComponent(FxTogs);
cmp.rebuildTogs();
cmp._freshTogShow();
this.nodMenus.togTo(0);
this.activeMenu(1);
},
// 重载:关闭前
onPreClosed: function onPreClosed() {
this.holyList.rebuild([]);
},
// 商城切换
onTogMenu: function onTogMenu(_index) {
this.activeMenu(parseInt(_index) + 1);
},
// 激活菜单
activeMenu: function activeMenu(_bagCode) {
var HC = HeroController.getInstance();
var model = HC.getModel();
var lst = [];
if (model) {
lst = model.getHolyPreviewInfo(_bagCode);
}
this.holyList.rebuild(lst);
}
});
cc._RF.pop();