Files
fc/dev/project/library/imports/c1/c1f04b5e-2747-4f57-b874-53b75e9c0269.js
2026-05-24 10:21:26 +08:00

97 lines
2.3 KiB
JavaScript

"use strict";
cc._RF.push(module, 'c1f04teJ0dPV7h0U7denAJp', 'cmp.partner.skill.unlock');
// Scripts/mod/partner/cmps/basic/cmp.partner.skill.unlock.js
"use strict";
/******************************************************************
*
* 伙伴进阶技能解锁展示界面
*
******************************************************************/
var BridgeWindow = require("bridge.window");
var 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 onOpenConfigs(_params) {
var _this = this;
// 获取技能信息
this.info = gskilldata('data_get_skill', _params.sid);
// 无效
if (nx.dt.objEmpty(this.info)) {
this.scheduleOnce(function () {
_this.close();
}, 0.03);
return;
}
// 刷新
this.fresh();
// 动画
var sp = this.spTitle;
if (sp) {
sp.node.active = false;
this.scheduleOnce(function () {
sp.node.active = true;
}, 1);
}
},
// 刷新
fresh: function fresh() {
// 图标更新
this.cmpIcon.setData(this.info);
// 描述
var desc = this.info.des || this.info.desc;
nx.gui.setString(this.nodContent, "desc", desc);
// 效果
var 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;
}
var txt = "";
var arr = des[0];
for (var i = 0; i < arr.length; ++i) {
var id = arr[i];
var 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);
}
});
cc._RF.pop();