Files
fc/dev/project/library/imports/a3/a35ae5be-38a1-497f-9811-6c8c817f6504.js
2026-05-24 10:21:26 +08:00

95 lines
2.3 KiB
JavaScript

"use strict";
cc._RF.push(module, 'a35aeW+OKFJf5gRbIyBf2UE', 'cmp.kernel.unlocked.back');
// Scripts/mod/home/base_kernel/cmp.kernel.unlocked.back.js
"use strict";
var BridgeWindow = require("bridge.window");
var KernelController = require("halidom_controller");
cc.Class({
"extends": BridgeWindow,
properties: {
nodCamp: {
"default": null,
type: cc.Node
},
nodCampLogo: {
"default": null,
type: cc.Node
},
nodAttr: {
"default": null,
type: cc.Node
},
nodDesc: {
"default": null,
type: cc.Node
}
},
// 重载:参数打开
onOpenConfigs: function onOpenConfigs(_params) {
// 当前的初始解锁达成状态
this.info = _params;
// this.cb = _params.cb;
// 道具刷新
this.freshInfo();
},
/*******
* send] >>>[14:27:54][22200]:{}
[22200]:{"list":[{"id":5,"lev":1,"exp":0,"step":0,
"all_attr":[{"name":104,"val":1014},{"name":101,"val":84}]}]}
[22201]:{"id":3,"lev":1,"exp":0,"step":0,
"all_attr":[{"name":104,"val":875},{"name":101,"val":81}]}
*/
freshInfo: function freshInfo() {
var cfg = game.configs.halidom_data.data_base;
var camp = this.info.id;
var name = cfg[camp].name;
nx.gui.setString(this.nodCamp, "", name);
var path = "";
switch (camp) {
case 1:
{
path = "prefab/home/base_kernel/ui/img_core_blue";
}
;
break;
case 2:
{
path = "prefab/home/base_kernel/ui/img_core_red";
}
;
break;
case 3:
{
path = "prefab/home/base_kernel/ui/img_core_green";
}
;
break;
case 4:
{
path = "prefab/home/base_kernel/ui/img_core_yellow";
}
;
break;
case 5:
{
path = "prefab/home/base_kernel/ui/img_core_puple";
}
;
break;
}
nx.gui.setSpriteFrame(this.nodCampLogo, "", path);
var arrfg = game.configs.attr_data.data_id_to_name;
for (var i = 0; i < this.info.all_attr.length; i++) {
var attr = this.info.all_attr[i];
var node = this.nodAttr.children[i];
if (attr) {
nx.gui.setString(node, "txt", arrfg[attr.name] + ":" + attr.val);
}
}
nx.gui.setString(this.nodDesc, "", cfg[camp].desc);
}
});
cc._RF.pop();