"use strict"; cc._RF.push(module, '2d295UrpZxDapw9xWaFtdMc', 'cmp.bedroom.help.wnd'); // Scripts/mod/home/bedroom/cmp.bedroom.help.wnd.js "use strict"; /****************************************************************** * * 闺蜜升级加成说明 * ******************************************************************/ var BridgeWindow = require("bridge.window"); cc.Class({ "extends": BridgeWindow, properties: { nodContent: { "default": null, type: cc.Node }, nodList: { "default": null, type: cc.Node } }, // 显示 onEnable: function onEnable() { // 判空 var 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); var DATA = game.configs.favor_data.data_intimacy_lev; var chds = this.nodList.children; nx.gui.gocChildren(this.nodList, "", LEN - 1, chds[0]); for (var i = 0; i < LEN - 1; ++i) { var cfgs = DATA[i + 1]; if (nx.dt.objEmpty(cfgs)) { continue; } // 等级 var item = chds[i]; nx.gui.setString(item, "level", nx.text.format("LvNumber", cfgs.lev)); // 加成 for (var k in cfgs.attr) { var atr = cfgs.attr[k]; nx.gui.setString(item, atr[0], "+" + atr[1]); } // 解锁内容 var 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)); } } }); cc._RF.pop();