Files
fc/dev/project/assets/Scripts/mod/home/base_kernel/cmp.kernel.unlocked.back.js
T
2026-05-23 22:10:14 +08:00

71 lines
2.1 KiB
JavaScript

const BridgeWindow = require( "bridge.window" );
const 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( _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(){
let cfg = game.configs.halidom_data.data_base;
let camp = this.info.id;
let name = cfg[camp].name;
nx.gui.setString( this.nodCamp, "", name );
let 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 );
let arrfg = game.configs.attr_data.data_id_to_name;
for (let i = 0; i < this.info.all_attr.length; i++) {
let attr = this.info.all_attr[i];
let 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 );
},
});